BlockLocalhostUsageOnServlet extends HttpServlet { @Override protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { doGet(req, resp); } @Autowired  BlockLocalhostUsageOnServlet(LocalhostRequestProcessorToggle localhostRequestProcessorToggle,
            UrlAccessLogMessageAssembler urlAccessLogMessageAssembler);   }
@Test public void doPostShouldCallDoGet() throws ServletException, IOException { Whitebox.setInternalState(underTest, "logger", logger); underTest.doPost(req, resp); verify(logger).info(Mockito.anyString()); verify(localhostRequestProcessorToggle).switchOn(); }