Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
akphi committed May 27, 2023
1 parent d817fd6 commit 341b281
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,31 +95,31 @@ public Response getSubtypeInfo()
}));
result.storeSubtypes = storeSubtypes.toList();

MutableSet<String> functionActivatorsSubtypes = Sets.mutable.empty();
MutableSet<String> functionActivatorSubtypes = Sets.mutable.empty();
PureProtocolExtensionLoader.extensions().forEach(extension ->
LazyIterate.flatCollect(extension.getExtraProtocolSubTypeInfoCollectors(), Function0::value).forEach(info ->
{
info.getSubTypes().forEach(subType ->
{
if (FunctionActivator.class.isAssignableFrom(subType.getOne()))
{
if (functionActivatorsSubtypes.contains(subType.getTwo()))
if (functionActivatorSubtypes.contains(subType.getTwo()))
{
// ignore duplications
return;
}
functionActivatorsSubtypes.add(subType.getTwo());
functionActivatorSubtypes.add(subType.getTwo());
}
});
}));
result.functionActivatorsSubtypes = functionActivatorsSubtypes.toList();
result.functionActivatorSubtypes = functionActivatorSubtypes.toList();
return Response.status(200).type(MediaType.APPLICATION_JSON).entity(result).build();
}

public static class SubtypeInfoResult
{
public List<String> storeSubtypes;
public List<String> functionActivatorsSubtypes;
public List<String> functionActivatorSubtypes;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,27 @@

public class TestAuthenticationGrammarRoundtrip_AuthenticationTypes extends TestGrammarRoundtrip.TestGrammarRoundtripTestSuite
{
@Test
public void userPasswordAuthenticationWithImport()
{
testWithSectionInfoPreserved("###AuthenticationDemo\n" +
"import test::*;\n" +
"AuthenticationDemo demo::demo1\n" +
"{\n" +
" authentication: # UserPassword {\n" +
" username: 'alice';\n" +
" password: PropertiesFileSecret\n" +
" {\n" +
" propertyName: 'property1';\n" +
" };\n" +
" }#;\n" +
"}\n");
}

@Test
public void userPasswordAuthentication()
{
test("###AuthenticationDemo\n" +
"import test::*;\n" +
"AuthenticationDemo demo::demo1\n" +
"{\n" +
" authentication: # UserPassword {\n" +
Expand All @@ -40,7 +56,6 @@ public void userPasswordAuthentication()
public void apiTokenAuthentication()
{
test("###AuthenticationDemo\n" +
"import test::*;\n" +
"AuthenticationDemo demo::demo1\n" +
"{\n" +
" authentication: # ApiKey {\n" +
Expand All @@ -58,7 +73,6 @@ public void apiTokenAuthentication()
public void encryptedKeyPairAuthentication()
{
test("###AuthenticationDemo\n" +
"import test::*;\n" +
"AuthenticationDemo demo::demo1\n" +
"{\n" +
" authentication: # EncryptedPrivateKey {\n" +
Expand All @@ -79,7 +93,6 @@ public void encryptedKeyPairAuthentication()
public void gcpWIFWithAWSIdP()
{
test("###AuthenticationDemo\n" +
"import test::*;\n" +
"AuthenticationDemo demo::demo1\n" +
"{\n" +
" authentication: # GCPWIFWithAWSIdP {\n" +
Expand Down

0 comments on commit 341b281

Please sign in to comment.