CorsHandler { public static void allowOrigin(HttpServletRequest request, HttpServletResponse response) { String origin = request.getHeader(Headers.ORIGIN); origin = NULL_ORIGIN.equals(origin) ? "*" : origin; response.setHeader(Headers.ACCESS_CONTROL_ALLOW_ORIGIN, origin); }  void handle(HttpServletRequest request, HttpServletResponse response); static void allowOrigin(HttpServletRequest request, HttpServletResponse response); static void setAccessControlAllowCredentials(HttpServletResponse response); static final String ALLOWED_METHODS_STRING; }
@Test public void allowOrigin() { initializeValidRequest(request); CorsHandler.allowOrigin(request, response); assertThat(response.getHeader("Access-Control-Allow-Origin")).isEqualTo(ORIGIN); }