I have added a simple test to verify my health controller works fine:
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"file:src/main/webapp/WEB-INF/application-context.xml"})
@WebAppConfiguration
public class HealthControllerTest {
@Test
public void testGetAlive() throws Exception {
mvc.perform(get("/non-existing-url")).andExpect(status().isOk());
}
}
This test always returns 200.
But, when we deploy the application without the default-servlet-handler, the test works as expected and returns 404
<mvc:default-servlet-handler/>
Do you have any idea, what kind of issue this might be?
Thanks.
This looks to be an issue with the testing platform and not this server, you should post the issue with JUnit, Spring, or some other project/forum like StackOverflow to find an answer.
I have added a simple test to verify my health controller works fine:
This test always returns 200. But, when we deploy the application without the default-servlet-handler, the test works as expected and returns 404
<mvc:default-servlet-handler/>
Do you have any idea, what kind of issue this might be? Thanks.