parent
6df9ef5ba6
commit
04394a63cd
|
@ -100,7 +100,7 @@ public class OidcIdTokenDecoderFactoryTests {
|
|||
@Test
|
||||
public void setRestOperationsFactoryWhenNullThenThrowIllegalArgumentException() {
|
||||
assertThatIllegalArgumentException()
|
||||
.isThrownBy(() -> this.idTokenDecoderFactory.setRestOperationsFactory(null));
|
||||
.isThrownBy(() -> this.idTokenDecoderFactory.setRestOperationsFactory(null));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -187,13 +187,12 @@ public class OidcIdTokenDecoderFactoryTests {
|
|||
|
||||
@Test
|
||||
public void createDecoderWhenCustomRestOperationsFactorySetThenApplied() {
|
||||
Function<ClientRegistration, RestOperations> customRestOperationsFactory = mock(
|
||||
Function.class);
|
||||
Function<ClientRegistration, RestOperations> customRestOperationsFactory = mock(Function.class);
|
||||
this.idTokenDecoderFactory.setRestOperationsFactory(customRestOperationsFactory);
|
||||
ClientRegistration clientRegistration = this.registration.build();
|
||||
given(customRestOperationsFactory.apply(same(clientRegistration)))
|
||||
.willReturn(new RestTemplate());
|
||||
given(customRestOperationsFactory.apply(same(clientRegistration))).willReturn(new RestTemplate());
|
||||
this.idTokenDecoderFactory.createDecoder(clientRegistration);
|
||||
verify(customRestOperationsFactory).apply(same(clientRegistration));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -97,8 +97,7 @@ public class ReactiveOidcIdTokenDecoderFactoryTests {
|
|||
|
||||
@Test
|
||||
public void setWebClientFactoryWhenNullThenThrowIllegalArgumentException() {
|
||||
assertThatIllegalArgumentException()
|
||||
.isThrownBy(() -> this.idTokenDecoderFactory.setWebClientFactory(null));
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> this.idTokenDecoderFactory.setWebClientFactory(null));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -185,13 +184,12 @@ public class ReactiveOidcIdTokenDecoderFactoryTests {
|
|||
|
||||
@Test
|
||||
public void createDecoderWhenCustomWebClientFactorySetThenApplied() {
|
||||
Function<ClientRegistration, WebClient> customWebClientFactory = mock(
|
||||
Function.class);
|
||||
Function<ClientRegistration, WebClient> customWebClientFactory = mock(Function.class);
|
||||
this.idTokenDecoderFactory.setWebClientFactory(customWebClientFactory);
|
||||
ClientRegistration clientRegistration = this.registration.build();
|
||||
given(customWebClientFactory.apply(same(clientRegistration)))
|
||||
.willReturn(WebClient.create());
|
||||
given(customWebClientFactory.apply(same(clientRegistration))).willReturn(WebClient.create());
|
||||
this.idTokenDecoderFactory.createDecoder(clientRegistration);
|
||||
verify(customWebClientFactory).apply(same(clientRegistration));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue