From 7ac44276a3ca73d261aff5e6e13ccb0871a2ea38 Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Tue, 6 Dec 2016 09:28:59 +0100 Subject: [PATCH] DATAREST-937 - Polishing. Moved the newly added test case to the end of the list. Formatting. Original pull request: #240. --- .../json/DomainObjectReaderUnitTests.java | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/json/DomainObjectReaderUnitTests.java b/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/json/DomainObjectReaderUnitTests.java index 2479f3535..9f887b6e5 100644 --- a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/json/DomainObjectReaderUnitTests.java +++ b/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/json/DomainObjectReaderUnitTests.java @@ -56,6 +56,7 @@ import com.google.common.base.Charsets; * Unit tests for {@link DomainObjectReader}. * * @author Oliver Gierke + * @author Craig Andrews */ @RunWith(MockitoJUnitRunner.class) public class DomainObjectReaderUnitTests { @@ -82,23 +83,6 @@ public class DomainObjectReaderUnitTests { this.reader = new DomainObjectReader(entities, mappings); } - /** - * @see DATAREST- - */ - @Test - public void considersTransientProperties() throws Exception { - - SampleWithTransient sample = new SampleWithTransient(); - sample.name="name"; - sample.temporary="temp"; - JsonNode node = new ObjectMapper().readTree("{\"name\": \"new name\", \"temporary\": \"new temp\"}"); - - SampleWithTransient result = reader.readPut((ObjectNode) node, sample, new ObjectMapper()); - - assertThat(result.name, is("new name")); - assertThat(result.temporary, is("new temp")); - } - /** * @see DATAREST-461 */ @@ -319,6 +303,24 @@ public class DomainObjectReaderUnitTests { } } + /** + * @see DATAREST-937 + */ + @Test + public void considersTransientProperties() throws Exception { + + SampleWithTransient sample = new SampleWithTransient(); + sample.name = "name"; + sample.temporary = "temp"; + + JsonNode node = new ObjectMapper().readTree("{ \"name\" : \"new name\", \"temporary\" : \"new temp\" }"); + + SampleWithTransient result = reader.readPut((ObjectNode) node, sample, new ObjectMapper()); + + assertThat(result.name, is("new name")); + assertThat(result.temporary, is("new temp")); + } + @JsonAutoDetect(fieldVisibility = Visibility.ANY) static class TypeWithGenericMap {