request.setRequestURI("http://localhost:8080/accounts/ClientLogin");
request.setMethod(FakeHttpServletRequest.POST_METHOD);
File file = new File("out");
file.deleteOnExit();
PrintWriter pw = new PrintWriter(file);
GetAuthTokenServlet authTokenServlet = new GetAuthTokenServlet();
authTokenServlet.setTokenManager(tokenManager);
FakeHttpServletResponse response = new FakeHttpServletResponse();
response.setWriter(pw);
authTokenServlet.service(request, response);
response.getWriter().flush();
InputStream is = new FileInputStream(file);
byte[] buf = new byte[1024];
is.read(buf, 0, (int) file.length());
String authToken = new String(buf).trim().split("=")[1];