Polish test setup
This commit polishes a test configuration to avoid registering a mock for the same bean twice.
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user