Merge branch '1.5.x'

pull/11839/head
Andy Wilkinson 7 years ago
commit f5102516fa

@ -33,7 +33,7 @@ import org.springframework.http.server.reactive.HttpHandler;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doAnswer; import static org.mockito.BDDMockito.willAnswer;
import static org.mockito.Mockito.inOrder; import static org.mockito.Mockito.inOrder;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verify;
@ -72,7 +72,7 @@ public class TomcatReactiveWebServerFactoryTests
public void contextIsAddedToHostBeforeCustomizersAreCalled() throws Exception { public void contextIsAddedToHostBeforeCustomizersAreCalled() throws Exception {
TomcatReactiveWebServerFactory factory = getFactory(); TomcatReactiveWebServerFactory factory = getFactory();
TomcatContextCustomizer customizer = mock(TomcatContextCustomizer.class); TomcatContextCustomizer customizer = mock(TomcatContextCustomizer.class);
doAnswer(new Answer<Void>() { willAnswer(new Answer<Void>() {
@Override @Override
public Void answer(InvocationOnMock invocation) throws Throwable { public Void answer(InvocationOnMock invocation) throws Throwable {
@ -81,7 +81,7 @@ public class TomcatReactiveWebServerFactoryTests
return null; return null;
} }
}).when(customizer).customize(any(Context.class)); }).given(customizer).customize(any(Context.class));
factory.addContextCustomizers(customizer); factory.addContextCustomizers(customizer);
this.webServer = factory.getWebServer(mock(HttpHandler.class)); this.webServer = factory.getWebServer(mock(HttpHandler.class));
verify(customizer).customize(any(Context.class)); verify(customizer).customize(any(Context.class));

@ -63,7 +63,7 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.fail; import static org.junit.Assert.fail;
import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.any;
import static org.mockito.BDDMockito.given; import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.doAnswer; import static org.mockito.BDDMockito.willAnswer;
import static org.mockito.Mockito.inOrder; import static org.mockito.Mockito.inOrder;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verify;
@ -150,7 +150,7 @@ public class TomcatServletWebServerFactoryTests
public void contextIsAddedToHostBeforeCustomizersAreCalled() throws Exception { public void contextIsAddedToHostBeforeCustomizersAreCalled() throws Exception {
TomcatServletWebServerFactory factory = getFactory(); TomcatServletWebServerFactory factory = getFactory();
TomcatContextCustomizer customizer = mock(TomcatContextCustomizer.class); TomcatContextCustomizer customizer = mock(TomcatContextCustomizer.class);
doAnswer(new Answer<Void>() { willAnswer(new Answer<Void>() {
@Override @Override
public Void answer(InvocationOnMock invocation) throws Throwable { public Void answer(InvocationOnMock invocation) throws Throwable {
@ -159,7 +159,7 @@ public class TomcatServletWebServerFactoryTests
return null; return null;
} }
}).when(customizer).customize(any(Context.class)); }).given(customizer).customize(any(Context.class));
factory.addContextCustomizers(customizer); factory.addContextCustomizers(customizer);
this.webServer = factory.getWebServer(); this.webServer = factory.getWebServer();
verify(customizer).customize(any(Context.class)); verify(customizer).customize(any(Context.class));

Loading…
Cancel
Save