diff --git a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/json/PersistentEntityToJsonSchemaConverterUnitTests.java b/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/json/PersistentEntityToJsonSchemaConverterUnitTests.java index ea77899ce..32f1e4497 100644 --- a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/json/PersistentEntityToJsonSchemaConverterUnitTests.java +++ b/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/json/PersistentEntityToJsonSchemaConverterUnitTests.java @@ -50,6 +50,7 @@ import com.jayway.jsonpath.JsonPath; /** * @author Oliver Gierke + * @author Greg Turnquist */ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = { MongoDbRepositoryConfig.class, TestConfiguration.class }) @@ -84,10 +85,14 @@ public class PersistentEntityToJsonSchemaConverterUnitTests { converter = new PersistentEntityToJsonSchemaConverter(entities, mappings, accessor, objectMapper, configuration); } + /** + * @see DATAREST-631, DATAREST-632 + */ @Test public void fulfillsConstraintsForProfile() { List constraints = new ArrayList(); + constraints.add(new Constraint("$.properties.id", is(notNullValue()), "Has descriptor for id property")); constraints.add(new Constraint("$.description", is("Profile description"), "Adds description to schema root")); constraints.add(new Constraint("$.properties.renamed", is(notNullValue()), "Has descriptor for renamed property")); constraints.add(new Constraint("$.properties.aliased", is(nullValue()), @@ -96,10 +101,14 @@ public class PersistentEntityToJsonSchemaConverterUnitTests { assertConstraints(Profile.class, constraints); } + /** + * @see DATAREST-632 + */ @Test - public void fulfilsConstraintsForUser() throws Exception { + public void fulfillsConstraintsForUser() throws Exception { List constraints = new ArrayList(); + constraints.add(new Constraint("$.properties.id", is(nullValue()), "Does NOT have descriptor for id property")); constraints.add(new Constraint("$.properties.firstname.type", is("string"), "Exposes firstname as String")); constraints.add(new Constraint("$.descriptors.address", is(notNullValue()), "Exposes nested objects as descriptors.")); @@ -133,18 +142,6 @@ public class PersistentEntityToJsonSchemaConverterUnitTests { assertConstraints(User.class, constraints); } - /** - * @see DATAREST-631 - */ - @Test - public void fulfilsConstraintsForProfile() { - - List constraints = new ArrayList(); - constraints.add(new Constraint("$.properties.id", is(notNullValue()), "Has descriptor for id property")); - - assertConstraints(Profile.class, constraints); - } - @SuppressWarnings("unchecked") private void assertConstraints(Class type, Iterable constraints) {