Improve Error Message

Closes gh-13667
This commit is contained in:
Josh Cummings
2023-08-20 22:04:37 -06:00
parent ed96e2cddf
commit 28f98b3351
2 changed files with 23 additions and 4 deletions

View File

@@ -63,12 +63,13 @@ public class AbstractRequestMatcherRegistryTests {
private WebApplicationContext context;
@BeforeEach
public void setUp() {
public void setUp() throws Exception {
this.matcherRegistry = new TestRequestMatcherRegistry();
this.context = mock(WebApplicationContext.class);
given(this.context.getBean(ObjectPostProcessor.class)).willReturn(NO_OP_OBJECT_POST_PROCESSOR);
given(this.context.getServletContext()).willReturn(MockServletContext.mvc());
this.matcherRegistry.setApplicationContext(this.context);
mockMvcPresentClasspath(true);
}
@Test
@@ -219,6 +220,7 @@ public class AbstractRequestMatcherRegistryTests {
@Test
public void requestMatchersWhenUnmappableServletsThenSkips() {
mockMvcIntrospector(true);
MockServletContext servletContext = new MockServletContext();
given(this.context.getServletContext()).willReturn(servletContext);
servletContext.addServlet("dispatcherServlet", DispatcherServlet.class).addMapping("/");