Polish test setup

This commit polishes a test configuration to avoid registering a mock
for the same bean twice.
pull/19492/head
Stephane Nicoll 5 years ago
parent cf740add85
commit 5f178db49b

@ -83,7 +83,7 @@ class DispatcherServletAutoConfigurationTests {
@Test
void registrationOverrideWithAutowiredServlet() {
this.contextRunner.withUserConfiguration(CustomAutowiredRegistration.class, CustomDispatcherServletPath.class)
this.contextRunner.withUserConfiguration(CustomAutowiredRegistration.class)
.run((context) -> {
ServletRegistrationBean<?> registration = context.getBean(ServletRegistrationBean.class);
assertThat(registration.getUrlMappings()).containsExactly("/foo");

Loading…
Cancel
Save