Skip to content

Commit f664941

Browse files
committed
Revert "Change text/xml to application/xml"
This reverts commit b61b82c.
1 parent b61b82c commit f664941

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

apache-cxf/cxf-jaxrs-implementation/src/main/java/com/baeldung/cxf/jaxrs/implementation/CourseRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import java.util.Map;
99

1010
@Path("baeldung")
11-
@Produces("application/xml")
11+
@Produces("text/xml")
1212
public class CourseRepository {
1313
private Map<Integer, Course> courses = new HashMap<>();
1414

apache-cxf/cxf-jaxrs-implementation/src/test/java/com/baeldung/cxf/jaxrs/implementation/ServiceLiveTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public void whenUpdateNonExistentCourse_thenReceiveNotFoundResponse() throws IOE
3939
final HttpPut httpPut = new HttpPut(BASE_URL + "3");
4040
final InputStream resourceStream = this.getClass().getClassLoader().getResourceAsStream("non_existent_course.xml");
4141
httpPut.setEntity(new InputStreamEntity(resourceStream));
42-
httpPut.setHeader("Content-Type", "application/xml");
42+
httpPut.setHeader("Content-Type", "text/xml");
4343

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

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

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

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

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

0 commit comments

Comments
 (0)