IdentityServlet extends HttpServlet { @Override public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { resp.setContentType("text/plain"); ApiProxy.Environment env = ApiProxy.getCurrentEnvironment(); resp.getWriter().print("default_version_hostname: "); resp.getWriter() .println(env.getAttributes().get("com.google.appengine.runtime.default_version_hostname")); }  @Override void doGet(HttpServletRequest req, HttpServletResponse resp);  }
@Test public void doGet_defaultEnvironment_writesResponse() throws Exception { servletUnderTest.doGet(mockRequest, mockResponse); assertWithMessage("IdentityServlet response") .that(responseWriter.toString()) .contains("default_version_hostname:"); }