@Test public void testDoGetWhenThereAreMultipleDDsShouldWriteAlwaysInResponse() throws ServletException, IOException { dialogDescriptors.add(dialogDescriptor); dialogDescriptors.add(dialogDescriptor); given(dialogDescriptor.getAttributes().getName()).willReturn(NAME); given(dialogDescriptor.getAttributes().getUsage()).willReturn(DialogDescriptorUsage.ALWAYS); underTest.doGet(request, response); InOrder order = Mockito.inOrder(out); order.verify(out).write("{\"Name\":\"" + NAME + "\", \"Usage\":\"" + DialogDescriptorUsage.ALWAYS); order.verify(out).write("\"}"); order.verify(out).write(","); order.verify(out).write("{\"Name\":\"" + NAME + "\", \"Usage\":\"" + DialogDescriptorUsage.ALWAYS); order.verify(out).write("\"}"); }
@Override protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { response.setContentType("application/json"); PrintWriter out = response.getWriter(); Map<String, StubDescriptor> stubDescriptors = routingService.getStubDescriptors(); writeAllDialogDescriptors(out, stubDescriptors); out.flush(); out.close(); }
StubDescriptorStatusServlet extends HttpServlet { @Override protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { response.setContentType("application/json"); PrintWriter out = response.getWriter(); Map<String, StubDescriptor> stubDescriptors = routingService.getStubDescriptors(); writeAllDialogDescriptors(out, stubDescriptors); out.flush(); out.close(); } }
StubDescriptorStatusServlet extends HttpServlet { @Override protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { response.setContentType("application/json"); PrintWriter out = response.getWriter(); Map<String, StubDescriptor> stubDescriptors = routingService.getStubDescriptors(); writeAllDialogDescriptors(out, stubDescriptors); out.flush(); out.close(); } @Autowired  StubDescriptorStatusServlet(RoutingService routingService, ExpirationTimeProvider expirationTimeProvider); }
StubDescriptorStatusServlet extends HttpServlet { @Override protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { response.setContentType("application/json"); PrintWriter out = response.getWriter(); Map<String, StubDescriptor> stubDescriptors = routingService.getStubDescriptors(); writeAllDialogDescriptors(out, stubDescriptors); out.flush(); out.close(); } @Autowired  StubDescriptorStatusServlet(RoutingService routingService, ExpirationTimeProvider expirationTimeProvider);  }
StubDescriptorStatusServlet extends HttpServlet { @Override protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { response.setContentType("application/json"); PrintWriter out = response.getWriter(); Map<String, StubDescriptor> stubDescriptors = routingService.getStubDescriptors(); writeAllDialogDescriptors(out, stubDescriptors); out.flush(); out.close(); } @Autowired  StubDescriptorStatusServlet(RoutingService routingService, ExpirationTimeProvider expirationTimeProvider);   }