File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
spring-web/src/test/java/org/springframework/web/service/registry Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 3838
3939import static org .assertj .core .api .Assertions .assertThat ;
4040import static org .mockito .ArgumentMatchers .any ;
41+ import static org .mockito .BDDMockito .given ;
42+ import static org .mockito .Mockito .atLeastOnce ;
4143import static org .mockito .Mockito .verify ;
42- import static org .mockito .Mockito .when ;
4344import static org .springframework .web .service .registry .HttpServiceGroup .ClientType .REST_CLIENT ;
4445
4546/**
@@ -83,15 +84,15 @@ void initializeClientBuilder() throws Exception {
8384 ClientHttpRequestFactory requestFactory = Mockito .mock (ClientHttpRequestFactory .class );
8485 MockClientHttpRequest request = new MockClientHttpRequest ();
8586 request .setResponse (new MockClientHttpResponse ());
86- when (requestFactory .createRequest (any (), any ())).thenReturn (request );
87+ given (requestFactory .createRequest (any (), any ())).willReturn (request );
8788
8889 RestClient .Builder clientBuilder = RestClient .builder ().baseUrl ("/" ).requestFactory (requestFactory );
8990 RestClientHttpServiceGroupConfigurer groupConfigurer = groups -> groups .forEachClient (group -> clientBuilder );
9091
9192 HttpServiceProxyRegistry registry = initProxyRegistry (groupConfigurer , groupsMetadata );
9293 registry .getClient (EchoA .class ).handle ("foo" );
9394
94- verify (requestFactory );
95+ verify (requestFactory , atLeastOnce ()). createRequest ( any (), any () );
9596 }
9697
9798 private HttpServiceProxyRegistry initProxyRegistry (
You can’t perform that action at this time.
0 commit comments