BuildInformationServlet extends HttpServlet { @Override protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { doGet(req, resp); } @Autowired  BuildInformationServlet(VersionTitleProvider versionTitleProvider);   }
@Test public final void testDoPostSetsResponseTypeAndWritesResponseUsingBuildInformation() throws ServletException, IOException { Whitebox.setInternalState(underTest, "wilmaBuildInformation", ""); given(response.getWriter()).willReturn(printWriter); underTest.doPost(request, response); verify(response).setContentType("application/json"); verify(printWriter).write(Mockito.anyString()); }