Skip to content

Commit

Permalink
Change text/xml to application/xml
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyennamthai committed Oct 28, 2016
1 parent 4362aab commit b61b82c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import java.util.Map;

@Path("baeldung")
@Produces("text/xml")
@Produces("application/xml")
public class CourseRepository {
private Map<Integer, Course> courses = new HashMap<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void whenUpdateNonExistentCourse_thenReceiveNotFoundResponse() throws IOE
final HttpPut httpPut = new HttpPut(BASE_URL + "3");
final InputStream resourceStream = this.getClass().getClassLoader().getResourceAsStream("non_existent_course.xml");
httpPut.setEntity(new InputStreamEntity(resourceStream));
httpPut.setHeader("Content-Type", "text/xml");
httpPut.setHeader("Content-Type", "application/xml");

final HttpResponse response = client.execute(httpPut);
assertEquals(404, response.getStatusLine().getStatusCode());
Expand All @@ -50,7 +50,7 @@ public void whenUpdateUnchangedCourse_thenReceiveNotModifiedResponse() throws IO
final HttpPut httpPut = new HttpPut(BASE_URL + "1");
final InputStream resourceStream = this.getClass().getClassLoader().getResourceAsStream("unchanged_course.xml");
httpPut.setEntity(new InputStreamEntity(resourceStream));
httpPut.setHeader("Content-Type", "text/xml");
httpPut.setHeader("Content-Type", "application/xml");

final HttpResponse response = client.execute(httpPut);
assertEquals(304, response.getStatusLine().getStatusCode());
Expand All @@ -61,7 +61,7 @@ public void whenUpdateValidCourse_thenReceiveOKResponse() throws IOException {
final HttpPut httpPut = new HttpPut(BASE_URL + "2");
final InputStream resourceStream = this.getClass().getClassLoader().getResourceAsStream("changed_course.xml");
httpPut.setEntity(new InputStreamEntity(resourceStream));
httpPut.setHeader("Content-Type", "text/xml");
httpPut.setHeader("Content-Type", "application/xml");

final HttpResponse response = client.execute(httpPut);
assertEquals(200, response.getStatusLine().getStatusCode());
Expand All @@ -76,7 +76,7 @@ public void whenCreateConflictStudent_thenReceiveConflictResponse() throws IOExc
final HttpPost httpPost = new HttpPost(BASE_URL + "1/students");
final InputStream resourceStream = this.getClass().getClassLoader().getResourceAsStream("conflict_student.xml");
httpPost.setEntity(new InputStreamEntity(resourceStream));
httpPost.setHeader("Content-Type", "text/xml");
httpPost.setHeader("Content-Type", "application/xml");

final HttpResponse response = client.execute(httpPost);
assertEquals(409, response.getStatusLine().getStatusCode());
Expand All @@ -87,7 +87,7 @@ public void whenCreateValidStudent_thenReceiveOKResponse() throws IOException {
final HttpPost httpPost = new HttpPost(BASE_URL + "2/students");
final InputStream resourceStream = this.getClass().getClassLoader().getResourceAsStream("created_student.xml");
httpPost.setEntity(new InputStreamEntity(resourceStream));
httpPost.setHeader("Content-Type", "text/xml");
httpPost.setHeader("Content-Type", "application/xml");

final HttpResponse response = client.execute(httpPost);
assertEquals(200, response.getStatusLine().getStatusCode());
Expand Down

0 comments on commit b61b82c

Please sign in to comment.