@Test public void testPorcessRequestAnswersErrorResponse() { SampleRequest request = new SampleRequest("testError"); SampleExceptionHandler handler = new SampleExceptionHandler(); controller.addHandler(request, handler); Response response = controller.processRequest(request); assertNotNull("Must not return a null response", response); assertEquals(ErrorResponse.class, response.getClass()); }
// test 건너뛰 @Test(timeout = 130) @Ignore(value = "Ignore for now until new decide a decent time - limit") public void testProcessMultipleRequestsTimeout() { Request request; Response response = new SampleResponse(); RequestHandler handler = new SampleHandler(); for (int i = 0; i < 99999; i++) { request = new SampleRequest(String.valueOf(i)); controller.addHandler(request, handler); response = controller.processRequest(request); assertNotNull(response); assertNotSame(ErrorResponse.class, response.getClass()); } }
@Test public void testProcessRequest() { /* * instance init Request request = new SampleRequest(); RequestHandler * handler = new SampleHandler(); controller.addHandler(request, * handler); */ Response response = controller.processRequest(request); assertNotNull("Muset not return a null response", response); assertEquals( "Response should be of type SampleResponse", SampleResponse.class, response.getClass()); assertEquals("Response should be of type SampleResponse", new SampleResponse(), response); }