Skip to content

Commit 94dec6b

Browse files
committed
Adapt to removed deprecations in Spring HATEOAS 1.4.
Fixes #2072.
1 parent 388a043 commit 94dec6b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

spring-data-rest-tests/spring-data-rest-tests-jpa/src/test/java/org/springframework/data/rest/webmvc/json/PersistentEntitySerializationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public void serializesReferencesWithinPagedResourceCorrectly() throws Exception
200200
withLink(Link.of("/orders/1")).//
201201
build();
202202

203-
PagedModel<PersistentEntityResource> persistentEntityResource = new PagedModel<PersistentEntityResource>(
203+
PagedModel<PersistentEntityResource> persistentEntityResource = PagedModel.of(
204204
Arrays.asList(orderResource), new PageMetadata(1, 0, 10));
205205

206206
String result = mapper.writeValueAsString(persistentEntityResource);
@@ -256,7 +256,7 @@ public void rendersProjectionWithinSimpleResourceCorrectly() throws Exception {
256256
ProjectionFactory factory = new SpelAwareProxyProjectionFactory();
257257
PersonSummary projection = factory.createProjection(PersonSummary.class, person);
258258

259-
String result = mapper.writeValueAsString(new EntityModel<PersonSummary>(projection));
259+
String result = mapper.writeValueAsString(EntityModel.of(projection));
260260

261261
assertThat(JsonPath.<Object> read(result, "$._links.self")).isNotNull();
262262
}

spring-data-rest-tests/spring-data-rest-tests-mongodb/src/test/java/org/springframework/data/rest/webmvc/json/PersistentEntitySerializationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public void serializesEmbeddedReferencesCorrectly() throws Exception {
107107
withLink(Link.of("/users/1")).//
108108
build();
109109

110-
PagedModel<PersistentEntityResource> persistentEntityResource = new PagedModel<PersistentEntityResource>(
110+
PagedModel<PersistentEntityResource> persistentEntityResource = PagedModel.of(
111111
Arrays.asList(userResource), new PageMetadata(1, 0, 10));
112112

113113
String result = mapper.writeValueAsString(persistentEntityResource);

0 commit comments

Comments
 (0)