TransDataServlet extends BaseCartePlugin { public String getContextPath() { return CONTEXT_PATH; } TransDataServlet( DataServiceClient client ); void handleRequest( CarteRequest request ); String getContextPath(); static final String CONTEXT_PATH; }
@Test public void testDoGetBadPath() throws Exception { when( request.getContextPath() ).thenReturn( BAD_CONTEXT_PATH ); servlet.service( request, response ); verify( response, never() ).setStatus( HttpServletResponse.SC_OK ); }
@Test public void testGetContextPath() { assertEquals( CONTEXT_PATH, servlet.getContextPath() ); }