From 9b0f0c7101cf6e9b460f560901fe61ae11b69285 Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Wed, 10 Jan 2018 12:47:24 +0100 Subject: [PATCH] DATAREST-1174 - Enable constructor properties to make sure WrappedPropertiesUnitTests continue to work. Removed Lombok constructor and accessor generation to avoid having to deal with the changed default in Lombok 1.16.20 not generating @ConstructorProperties by default anymore. --- .../json/WrappedPropertiesUnitTests.java | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/json/WrappedPropertiesUnitTests.java b/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/json/WrappedPropertiesUnitTests.java index 7569d461e..19e0e9f4d 100644 --- a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/json/WrappedPropertiesUnitTests.java +++ b/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/json/WrappedPropertiesUnitTests.java @@ -18,10 +18,6 @@ package org.springframework.data.rest.webmvc.json; import static org.hamcrest.MatcherAssert.*; import static org.hamcrest.Matchers.*; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - import java.util.Collections; import java.util.List; @@ -32,6 +28,8 @@ import org.springframework.data.mapping.PersistentEntity; import org.springframework.data.mapping.PersistentProperty; import org.springframework.data.mapping.context.PersistentEntities; +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonUnwrapped; @@ -130,9 +128,7 @@ public class WrappedPropertiesUnitTests { assertThat(wrappedProperties.hasPersistentPropertiesForField("street"), is(false)); } - @Data - @AllArgsConstructor - @NoArgsConstructor + @JsonAutoDetect(fieldVisibility = Visibility.ANY) static class OneLevelNesting { String one; @@ -171,9 +167,7 @@ public class WrappedPropertiesUnitTests { * */ - @Data - @AllArgsConstructor - @NoArgsConstructor + @JsonAutoDetect(fieldVisibility = Visibility.ANY) static class MultiLevelNesting { String multi; @@ -182,9 +176,7 @@ public class WrappedPropertiesUnitTests { @JsonUnwrapped(enabled = false) OneLevelNesting nested; } - @Data - @AllArgsConstructor - @NoArgsConstructor + @JsonAutoDetect(fieldVisibility = Visibility.ANY) static class Address { String street;