From 86dcb518b2d9d95321405d3099ea5ce8fe5857e7 Mon Sep 17 00:00:00 2001 From: Muhammad Abdullah Azam Khan Date: Fri, 26 Nov 2021 20:54:37 +0400 Subject: [PATCH] Indentation and Formatting Changes --- .../baeldung/unsupportedmediatype/User.java | 10 ++--- .../ApplicationUnitTest.java | 38 +++++++++---------- 2 files changed, 24 insertions(+), 24 deletions(-) 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("Andy1
Hello world
")) - .andExpect(status().isOk()); + .contentType(MediaType.APPLICATION_XML_VALUE) + .content("Andy1
Hello 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("Andy1
Hello world
")) - .andExpect(status().isUnsupportedMediaType()); + .contentType(MediaType.TEXT_PLAIN_VALUE) + .content("Andy1
Hello world
")) + .andExpect(status().isUnsupportedMediaType()); } }