@Test public void headers() throws Exception { Response response = httpHeader.headers().build(); assertThat(response.getStatus(), is(OK.getStatusCode())); MultivaluedMap<String, Object> metaData = response.getMetadata(); assertThat(metaData.size(), is(7)); assertThat(metaData.get(HttpHeaders.CACHE_CONTROL), hasItem(CACHE_CONTROL)); assertThat(metaData.get(ACCESS_CONTROL_ALLOW_ORIGIN), hasItem("*")); assertThat(metaData.get(ACCESS_CONTROL_ALLOW_HEADERS), hasItem("Authorization,X-Forwarded-For,Accept-Language,Content-Type")); assertThat(metaData.get(ACCESS_CONTROL_ALLOW_METHODS), hasItem("GET,POST,PUT,DELETE,OPTIONS")); assertThat(metaData.get(ACCESS_CONTROL_REQUEST_METHOD), hasItem("GET,POST,PUT,DELETE,OPTIONS")); assertThat(metaData.get(ACCESS_CONTROL_MAX_AGE), hasItem("600")); assertThat(metaData.get("X-Application-Id"), hasItem("name")); assertThat(response.getEntity(), is(nullValue())); }
public ResponseBuilder headers() { return headers(OK); }
HttpHeader { public ResponseBuilder headers() { return headers(OK); } }
HttpHeader { public ResponseBuilder headers() { return headers(OK); } @Inject  HttpHeader(final @Named(APPLICATION_ID) String applicationName,
                      final @Named(ACCESS_CONTROL_MAX_AGE_DELTA_SECONDS) String deltaSeconds); }
HttpHeader { public ResponseBuilder headers() { return headers(OK); } @Inject  HttpHeader(final @Named(APPLICATION_ID) String applicationName,
                      final @Named(ACCESS_CONTROL_MAX_AGE_DELTA_SECONDS) String deltaSeconds); String getApplicationName(); ResponseBuilder headers(); ResponseBuilder headers(Status status); ResponseBuilder headers(int status); }
HttpHeader { public ResponseBuilder headers() { return headers(OK); } @Inject  HttpHeader(final @Named(APPLICATION_ID) String applicationName,
                      final @Named(ACCESS_CONTROL_MAX_AGE_DELTA_SECONDS) String deltaSeconds); String getApplicationName(); ResponseBuilder headers(); ResponseBuilder headers(Status status); ResponseBuilder headers(int status);  }