use of org.springframework.cloud.gcp.security.iap.AudienceValidator in project spring-cloud-gcp by spring-cloud.
the class IapAuthenticationAutoConfigurationTests method testIapBeansReturnedWhenBothIapWithMultipleAudiencesAndSpringSecurityConfigPresent.
@Test
public void testIapBeansReturnedWhenBothIapWithMultipleAudiencesAndSpringSecurityConfigPresent() {
when(mockJwt.getAudience()).thenReturn(Collections.singletonList("aud1"));
this.contextRunner.withPropertyValues("spring.cloud.gcp.security.iap.audience=aud1, aud2").run((context) -> {
AudienceValidator validator = context.getBean(AudienceValidator.class);
OAuth2TokenValidatorResult result = validator.validate(mockJwt);
assertThat(result.hasErrors()).isFalse();
});
}
Aggregations