Skip to content

Commit 26f4655

Browse files
committed
#1590 - Polishing.
1 parent 28e8b6d commit 26f4655

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

Diff for: src/test/java/org/springframework/hateoas/config/HypermediaWebClientBeanPostProcessorTest.java

+6-7
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
import static org.assertj.core.api.Assertions.*;
1919
import static org.springframework.hateoas.support.ContextTester.*;
2020

21+
import reactor.test.StepVerifier;
22+
2123
import java.net.URI;
2224

2325
import org.junit.jupiter.api.AfterEach;
2426
import org.junit.jupiter.api.BeforeEach;
2527
import org.junit.jupiter.api.Test;
26-
import reactor.test.StepVerifier;
2728
import org.springframework.context.annotation.Bean;
2829
import org.springframework.context.annotation.Configuration;
29-
import org.springframework.core.ParameterizedTypeReference;
3030
import org.springframework.hateoas.EntityModel;
3131
import org.springframework.hateoas.Link;
3232
import org.springframework.hateoas.MediaTypes;
@@ -39,8 +39,9 @@
3939
import org.springframework.web.reactive.function.client.WebClient;
4040

4141
/**
42-
* Tests registration of proper decoders by the {@link org.springframework.hateoas.config.WebClientHateoasConfiguration.HypermediaWebClientBeanPostProcessor}.
43-
*
42+
* Tests registration of proper decoders by the
43+
* {@link org.springframework.hateoas.config.WebClientHateoasConfiguration.HypermediaWebClientBeanPostProcessor}.
44+
*
4445
* @author Greg Turnquist
4546
*/
4647
class HypermediaWebClientBeanPostProcessorTest {
@@ -104,8 +105,6 @@ void shouldHandleRootHalDocument() {
104105
@Test
105106
void shouldHandleNavigatingToAResourceObject() {
106107

107-
ParameterizedTypeReference<EntityModel<Actor>> typeReference = new EntityModelType<Actor>() {};
108-
109108
withContext(HalConfig.class, context -> {
110109

111110
WebClient webClient = context.getBean(WebClient.class);
@@ -123,7 +122,7 @@ void shouldHandleNavigatingToAResourceObject() {
123122
.flatMap(link -> webClient //
124123
.get().uri(link.expand().getHref()) //
125124
.retrieve() //
126-
.bodyToMono(typeReference)) //
125+
.bodyToMono(new EntityModelType<Actor>() {})) //
127126
.as(StepVerifier::create) //
128127
.expectNext(EntityModel.of(new Actor("Keanu Reaves"))) //
129128
.verifyComplete();

Diff for: src/test/java/org/springframework/hateoas/mediatype/hal/forms/Jackson2HalFormsIntegrationTest.java

-3
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,6 @@ void serializesMultipleAnnotatedResourceResourcesAsEmbedded() throws Exception {
308308
@Test
309309
void deserializesMultipleAnnotatedResourceResourcesAsEmbedded() throws Exception {
310310

311-
mapper.readFile("annotated-embedded-resources-reference.json",
312-
CollectionModel.class, EntityModel.class, SimpleAnnotatedPojo.class);
313-
314311
CollectionModel<EntityModel<SimpleAnnotatedPojo>> result = mapper.readFile(
315312
"annotated-embedded-resources-reference.json", CollectionModel.class, EntityModel.class,
316313
SimpleAnnotatedPojo.class);

0 commit comments

Comments
 (0)