@Test
public void cookieAuthentication200() throws ServletException, IOException, ListenerException, ConfigurationException {

	String uri = "cookie";
	addListener(uri, Methods.POST, AuthMethods.COOKIE);
	String authToken = "random-token_thing";
	ApiPrincipal principal = new ApiPrincipal();
	assertTrue("principal is not logged in? ttl expired?", principal.isLoggedIn());
	ApiCacheManager.getInstance().put(authToken, principal);
	Map<String, String> headers = new HashMap<String, String>();
	MockHttpServletRequest request = createRequest(uri, Methods.POST, "{\"tralalalallala\":true}", headers);
	Cookie cookies = new Cookie("authenticationToken", authToken);
	request.setCookies(cookies);
	Response result = service(request);
	String sessionAuthToken = (String) session.get("authorizationToken");
	assertNotNull("session should contain auth token", sessionAuthToken);
	assertEquals("auth tokens should match", authToken, sessionAuthToken);
	assertEquals(200, result.getStatus());
	assertTrue(result.containsHeader("Allow"));
	assertNull(result.getErrorMessage());
	assertTrue("response contains auth cookie", result.containsCookie("authenticationToken"));
}