@Test
public void logoutTest() throws Exception {

    Response response = target().path("session").request().delete();
    assertEquals(response.getStatus(), 200);
    verify(tokenManager).generateUnauthToken();
    Map<String, NewCookie> cookies = response.getCookies();
    assertTrue(cookies.containsKey(TOKEN_NAME));
    assertEquals(ANON, cookies.get(TOKEN_NAME).getValue());
    try {
        JSONObject result = JSONObject.fromObject(response.readEntity(String.class));
        assertEquals(removeWhitespace(ANON_USER), removeWhitespace(result.toString()));
    } catch (Exception e) {
        fail("Expected no exception, but got: " + e.getMessage());
    }
}