DATAREST-937 - Polishing.

Moved the newly added test case to the end of the list. Formatting.

Original pull request: #240.
This commit is contained in:
Oliver Gierke
2016-12-06 09:28:59 +01:00
parent c45181d797
commit 7ac44276a3

View File

@@ -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 {