diff --git a/spring-boot-rest-2/src/main/java/com/baeldung/unsupportedmediatype/User.java b/spring-boot-rest-2/src/main/java/com/baeldung/unsupportedmediatype/User.java
index f9c3d9c191..765149dad5 100644
--- a/spring-boot-rest-2/src/main/java/com/baeldung/unsupportedmediatype/User.java
+++ b/spring-boot-rest-2/src/main/java/com/baeldung/unsupportedmediatype/User.java
@@ -55,11 +55,11 @@ public class User implements Serializable {
@Override
public String toString() {
return "User{"
- + "id=" + id
- + ", name='" + name + '\''
- + ", age=" + age
- + ", address='" + address + '\''
- + '}';
+ + "id=" + id
+ + ", name='" + name + '\''
+ + ", age=" + age
+ + ", address='" + address + '\''
+ + '}';
}
diff --git a/spring-boot-rest-2/src/test/java/com/baeldung/unsupportedmediatype/ApplicationUnitTest.java b/spring-boot-rest-2/src/test/java/com/baeldung/unsupportedmediatype/ApplicationUnitTest.java
index 95de780106..498ad9d537 100644
--- a/spring-boot-rest-2/src/test/java/com/baeldung/unsupportedmediatype/ApplicationUnitTest.java
+++ b/spring-boot-rest-2/src/test/java/com/baeldung/unsupportedmediatype/ApplicationUnitTest.java
@@ -20,39 +20,39 @@ public class ApplicationUnitTest {
@Test
public void JsonTestCase() throws Exception {
mockMvc.perform(MockMvcRequestBuilders.post("/user/")
- .contentType(MediaType.APPLICATION_JSON_VALUE)
- .content( "{\n"
- + " \"name\": \"Andy\",\n"
- + " \"age\": 1,\n"
- + " \"address\": \"Hello world\"\n"
- + "}"))
- .andExpect(status().isOk());
+ .contentType(MediaType.APPLICATION_JSON_VALUE)
+ .content( "{\n"
+ + " \"name\": \"Andy\",\n"
+ + " \"age\": 1,\n"
+ + " \"address\": \"Hello world\"\n"
+ + "}"))
+ .andExpect(status().isOk());
}
@Test
public void JsonFailTestCase() throws Exception {// Because no content-type added
mockMvc.perform(MockMvcRequestBuilders.post("/user/")
- .content( "{\n"
- + " \"name\": \"Andy\",\n"
- + " \"age\": 1,\n"
- + " \"address\": \"Hello world\"\n"
- + "}"))
- .andExpect(status().isUnsupportedMediaType());
+ .content( "{\n"
+ + " \"name\": \"Andy\",\n"
+ + " \"age\": 1,\n"
+ + " \"address\": \"Hello world\"\n"
+ + "}"))
+ .andExpect(status().isUnsupportedMediaType());
}
@Test
public void XmlTestCase() throws Exception {
mockMvc.perform(MockMvcRequestBuilders.post("/user/")
- .contentType(MediaType.APPLICATION_XML_VALUE)
- .content("Andy1Hello world"))
- .andExpect(status().isOk());
+ .contentType(MediaType.APPLICATION_XML_VALUE)
+ .content("Andy1Hello world"))
+ .andExpect(status().isOk());
}
@Test
public void StringFailTestCase() throws Exception { // Because content-type is not supported
mockMvc.perform(MockMvcRequestBuilders.post("/user/")
- .contentType(MediaType.TEXT_PLAIN_VALUE)
- .content("Andy1Hello world"))
- .andExpect(status().isUnsupportedMediaType());
+ .contentType(MediaType.TEXT_PLAIN_VALUE)
+ .content("Andy1Hello world"))
+ .andExpect(status().isUnsupportedMediaType());
}
}