Skip to content

Commit

Permalink
When testing 415 response, we should indicate the content type of the…
Browse files Browse the repository at this point in the history
… request body, not the accepted encodings
  • Loading branch information
tsegismont authored and Stefan Negrea committed Aug 13, 2015
1 parent dcca3c9 commit 914de12
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import static org.junit.Assert.assertEquals;

import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

Expand Down Expand Up @@ -88,11 +89,10 @@ public void testNotAcceptableException() {
public void testNotSupportedException() {
response = target.clone()
.path("/gauges/test/data")
.request(MediaType.TEXT_PLAIN)
.request(MediaType.APPLICATION_JSON_TYPE)
.header(HttpHeaders.CONTENT_TYPE, MediaType.TEXT_PLAIN)
.header(TENANT_HEADER_NAME, "test")
.post(null);
assertEquals(415, response.getStatus());
ApiErrorJson apiErrorJson = response.readEntity(ApiErrorJson.class);
assertEquals("Cannot consume content type", apiErrorJson.getErrorMsg());
}
}

0 comments on commit 914de12

Please sign in to comment.