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 {