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:
@@ -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 {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user