diff --git a/spring-data-rest-tests/spring-data-rest-tests-jpa/src/test/java/org/springframework/data/rest/webmvc/json/PersistentEntitySerializationTests.java b/spring-data-rest-tests/spring-data-rest-tests-jpa/src/test/java/org/springframework/data/rest/webmvc/json/PersistentEntitySerializationTests.java index 699982630..07a813fe8 100755 --- a/spring-data-rest-tests/spring-data-rest-tests-jpa/src/test/java/org/springframework/data/rest/webmvc/json/PersistentEntitySerializationTests.java +++ b/spring-data-rest-tests/spring-data-rest-tests-jpa/src/test/java/org/springframework/data/rest/webmvc/json/PersistentEntitySerializationTests.java @@ -200,7 +200,7 @@ public class PersistentEntitySerializationTests { withLink(Link.of("/orders/1")).// build(); - PagedModel persistentEntityResource = new PagedModel( + PagedModel persistentEntityResource = PagedModel.of( Arrays.asList(orderResource), new PageMetadata(1, 0, 10)); String result = mapper.writeValueAsString(persistentEntityResource); @@ -256,7 +256,7 @@ public class PersistentEntitySerializationTests { ProjectionFactory factory = new SpelAwareProxyProjectionFactory(); PersonSummary projection = factory.createProjection(PersonSummary.class, person); - String result = mapper.writeValueAsString(new EntityModel(projection)); + String result = mapper.writeValueAsString(EntityModel.of(projection)); assertThat(JsonPath. read(result, "$._links.self")).isNotNull(); } diff --git a/spring-data-rest-tests/spring-data-rest-tests-mongodb/src/test/java/org/springframework/data/rest/webmvc/json/PersistentEntitySerializationTests.java b/spring-data-rest-tests/spring-data-rest-tests-mongodb/src/test/java/org/springframework/data/rest/webmvc/json/PersistentEntitySerializationTests.java index 5f285a0af..28cee295b 100755 --- a/spring-data-rest-tests/spring-data-rest-tests-mongodb/src/test/java/org/springframework/data/rest/webmvc/json/PersistentEntitySerializationTests.java +++ b/spring-data-rest-tests/spring-data-rest-tests-mongodb/src/test/java/org/springframework/data/rest/webmvc/json/PersistentEntitySerializationTests.java @@ -107,7 +107,7 @@ public class PersistentEntitySerializationTests { withLink(Link.of("/users/1")).// build(); - PagedModel persistentEntityResource = new PagedModel( + PagedModel persistentEntityResource = PagedModel.of( Arrays.asList(userResource), new PageMetadata(1, 0, 10)); String result = mapper.writeValueAsString(persistentEntityResource);