From 6cc485a9c162ab81ba812d9017b8b044a21e21d2 Mon Sep 17 00:00:00 2001 From: Greg Turnquist Date: Thu, 8 Aug 2019 10:35:06 -0500 Subject: [PATCH] DATAREST-1421 - Polishing. --- .../org/springframework/data/rest/tests/CommonWebTests.java | 6 ++---- .../data/rest/webmvc/alps/AlpsController.java | 4 ++-- .../data/rest/webmvc/alps/AlpsJsonHttpMessageConverter.java | 3 ++- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/CommonWebTests.java b/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/CommonWebTests.java index 6e3687b5d..a231574ce 100755 --- a/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/CommonWebTests.java +++ b/spring-data-rest-tests/spring-data-rest-tests-core/src/test/java/org/springframework/data/rest/tests/CommonWebTests.java @@ -21,12 +21,11 @@ import static org.junit.Assume.*; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; -import net.minidev.json.JSONArray; - import java.net.URI; import java.util.List; import java.util.Map; +import net.minidev.json.JSONArray; import org.junit.Test; import org.springframework.data.rest.webmvc.RestMediaTypes; import org.springframework.hateoas.Link; @@ -45,8 +44,7 @@ import com.jayway.jsonpath.JsonPath; * This class contains a common test suite used to verify multiple data stores with the same domain space. When * verifying support of a new data store, it's good to start with extending this suite of tests. However, if the data * store doesn't map well onto this, then a good alternative would be write a new test suite using - * {@link org.springframework.data.rest.webmvc.AbstractWebIntegrationTests AbstractWebIntegrationTests} as the test - * harness. + * {@link AbstractWebIntegrationTests AbstractWebIntegrationTests} as the test harness. * * @author Oliver Gierke * @author Greg Turnquist diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/alps/AlpsController.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/alps/AlpsController.java index 9d2bf5847..125dbf06b 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/alps/AlpsController.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/alps/AlpsController.java @@ -76,7 +76,7 @@ public class AlpsController { HttpHeaders headers = new HttpHeaders(); headers.setAllow(Collections.singleton(HttpMethod.GET)); - return new ResponseEntity(headers, HttpStatus.OK); + return new ResponseEntity<>(headers, HttpStatus.OK); } /** @@ -91,7 +91,7 @@ public class AlpsController { verifyAlpsEnabled(); - return new ResponseEntity(information, HttpStatus.OK); + return new ResponseEntity<>(information, HttpStatus.OK); } private void verifyAlpsEnabled() { diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/alps/AlpsJsonHttpMessageConverter.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/alps/AlpsJsonHttpMessageConverter.java index b04a22846..75d0a3f17 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/alps/AlpsJsonHttpMessageConverter.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/alps/AlpsJsonHttpMessageConverter.java @@ -103,7 +103,8 @@ public class AlpsJsonHttpMessageConverter extends MappingJackson2HttpMessageConv ServerHttpResponse response) { return body instanceof RootResourceInformation - ? Collections.singletonMap("alps", converter.convert((RootResourceInformation) body)) : body; + ? Collections.singletonMap("alps", converter.convert((RootResourceInformation) body)) + : body; } /*