Skip to content

Commit

Permalink
some not capable tests
Browse files Browse the repository at this point in the history
  • Loading branch information
melissaahn committed Aug 16, 2024
1 parent 818ff76 commit c6a6f63
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,34 @@ public void testAppendToExtraQueryParametersIfWebAuthnCapable_setPropertyAndPara
Assert.assertEquals(combinedQueryParameters.size(), 0);
}

@Test
@Config(sdk=28)
public void testAppendToExtraQueryParametersIfWebAuthnCapable_WebAuthnCapableFalse() {
final List<Map.Entry<String, String>> queryParameters = Arrays.asList(
new AbstractMap.SimpleEntry<>("field1", "property1"),
new AbstractMap.SimpleEntry<>("field2", "property2"));
final List<Map.Entry<String, String>> combinedQueryParameters = CommandParametersAdapter.appendToExtraQueryParametersIfWebAuthnCapable(
queryParameters,
getConfiguration(AAD_NONE_CONFIG_FILE)
);
Assert.assertNotNull(combinedQueryParameters);
Assert.assertEquals(combinedQueryParameters.size(), 2);
}

@Test
@Config(sdk=28)
public void testAppendToExtraQueryParametersIfWebAuthnCapable_WebAuthnCapableFalseKeepPresentParam() {
final List<Map.Entry<String, String>> queryParameters = Collections.singletonList(new AbstractMap.SimpleEntry<>(
FidoConstants.WEBAUTHN_QUERY_PARAMETER_FIELD,
FidoConstants.WEBAUTHN_QUERY_PARAMETER_VALUE));
final List<Map.Entry<String, String>> combinedQueryParameters = CommandParametersAdapter.appendToExtraQueryParametersIfWebAuthnCapable(
queryParameters,
getConfiguration(AAD_NONE_CONFIG_FILE)
);
Assert.assertNotNull(combinedQueryParameters);
Assert.assertEquals(combinedQueryParameters.size(), 1);
}

private ClaimsRequest getAccessTokenClaimsRequest(@NonNull String claimName, @NonNull String claimValue) {
ClaimsRequest cp1ClaimsRequest = new ClaimsRequest();
RequestedClaimAdditionalInformation info = new RequestedClaimAdditionalInformation();
Expand Down

0 comments on commit c6a6f63

Please sign in to comment.