|
|
@ -83,13 +83,12 @@ class DispatcherServletAutoConfigurationTests {
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
void registrationOverrideWithAutowiredServlet() {
|
|
|
|
void registrationOverrideWithAutowiredServlet() {
|
|
|
|
this.contextRunner.withUserConfiguration(CustomAutowiredRegistration.class)
|
|
|
|
this.contextRunner.withUserConfiguration(CustomAutowiredRegistration.class).run((context) -> {
|
|
|
|
.run((context) -> {
|
|
|
|
ServletRegistrationBean<?> registration = context.getBean(ServletRegistrationBean.class);
|
|
|
|
ServletRegistrationBean<?> registration = context.getBean(ServletRegistrationBean.class);
|
|
|
|
assertThat(registration.getUrlMappings()).containsExactly("/foo");
|
|
|
|
assertThat(registration.getUrlMappings()).containsExactly("/foo");
|
|
|
|
assertThat(registration.getServletName()).isEqualTo("customDispatcher");
|
|
|
|
assertThat(registration.getServletName()).isEqualTo("customDispatcher");
|
|
|
|
assertThat(context).hasSingleBean(DispatcherServlet.class);
|
|
|
|
assertThat(context).hasSingleBean(DispatcherServlet.class);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|