@Test
public void doGetShouldWriteJsonMessage() throws ServletException, IOException {

    //GIVEN request and response
    given(resp.getWriter()).willReturn(printWriter);
    given(localhostRequestProcessorToggle.isOn()).willReturn(true);
    //WHEN
    underTest.doGet(req, resp);
    //THEN
    verify(resp).setContentType("application/json");
    verify(localhostRequestProcessorToggle).isOn();
    verify(printWriter).write("{\"localhostMode\":true}");
}