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];