StubDescriptorStatusServlet extends HttpServlet { @Override protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { doGet(req, resp); } @Autowired  StubDescriptorStatusServlet(RoutingService routingService, ExpirationTimeProvider expirationTimeProvider);   }
@Test public void testDoPostWhenThereAreMultipleDDsShouldWriteAlwaysInResponse() throws ServletException, IOException { dialogDescriptors.add(dialogDescriptor); dialogDescriptors.add(dialogDescriptor); given(dialogDescriptor.getAttributes().getName()).willReturn(NAME); given(dialogDescriptor.getAttributes().getUsage()).willReturn(DialogDescriptorUsage.ALWAYS); underTest.doPost(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("\"}"); }