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