18
18
import static org .assertj .core .api .Assertions .*;
19
19
import static org .springframework .hateoas .support .ContextTester .*;
20
20
21
+ import reactor .test .StepVerifier ;
22
+
21
23
import java .net .URI ;
22
24
23
25
import org .junit .jupiter .api .AfterEach ;
24
26
import org .junit .jupiter .api .BeforeEach ;
25
27
import org .junit .jupiter .api .Test ;
26
- import reactor .test .StepVerifier ;
27
28
import org .springframework .context .annotation .Bean ;
28
29
import org .springframework .context .annotation .Configuration ;
29
- import org .springframework .core .ParameterizedTypeReference ;
30
30
import org .springframework .hateoas .EntityModel ;
31
31
import org .springframework .hateoas .Link ;
32
32
import org .springframework .hateoas .MediaTypes ;
39
39
import org .springframework .web .reactive .function .client .WebClient ;
40
40
41
41
/**
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
+ *
44
45
* @author Greg Turnquist
45
46
*/
46
47
class HypermediaWebClientBeanPostProcessorTest {
@@ -104,8 +105,6 @@ void shouldHandleRootHalDocument() {
104
105
@ Test
105
106
void shouldHandleNavigatingToAResourceObject () {
106
107
107
- ParameterizedTypeReference <EntityModel <Actor >> typeReference = new EntityModelType <Actor >() {};
108
-
109
108
withContext (HalConfig .class , context -> {
110
109
111
110
WebClient webClient = context .getBean (WebClient .class );
@@ -123,7 +122,7 @@ void shouldHandleNavigatingToAResourceObject() {
123
122
.flatMap (link -> webClient //
124
123
.get ().uri (link .expand ().getHref ()) //
125
124
.retrieve () //
126
- .bodyToMono (typeReference )) //
125
+ .bodyToMono (new EntityModelType < Actor >() {} )) //
127
126
.as (StepVerifier ::create ) //
128
127
.expectNext (EntityModel .of (new Actor ("Keanu Reaves" ))) //
129
128
.verifyComplete ();
0 commit comments