use of org.springframework.core.ResolvableType in project spring-framework by spring-projects.
the class HttpEntityArgumentResolverTests method emptyBodyWithFlux.
@Test
public void emptyBodyWithFlux() throws Exception {
ResolvableType type = httpEntityType(Flux.class, String.class);
HttpEntity<Flux<String>> entity = resolveValueWithEmptyBody(type);
StepVerifier.create(entity.getBody()).expectNextCount(0).expectComplete().verify();
}
use of org.springframework.core.ResolvableType in project spring-framework by spring-projects.
the class HttpEntityArgumentResolverTests method emptyBodyWithSingle.
@Test
public void emptyBodyWithSingle() throws Exception {
ResolvableType type = httpEntityType(Single.class, String.class);
HttpEntity<Single<String>> entity = resolveValueWithEmptyBody(type);
StepVerifier.create(RxReactiveStreams.toPublisher(entity.getBody())).expectNextCount(0).expectError(ServerWebInputException.class).verify();
}
use of org.springframework.core.ResolvableType in project spring-framework by spring-projects.
the class HttpEntityArgumentResolverTests method httpEntityWithStringBody.
@Test
public void httpEntityWithStringBody() throws Exception {
ServerWebExchange exchange = postExchange("line1");
ResolvableType type = httpEntityType(String.class);
HttpEntity<String> httpEntity = resolveValue(exchange, type);
assertEquals(exchange.getRequest().getHeaders(), httpEntity.getHeaders());
assertEquals("line1", httpEntity.getBody());
}
use of org.springframework.core.ResolvableType in project spring-framework by spring-projects.
the class HttpEntityArgumentResolverTests method emptyBodyWithObservable.
@Test
public void emptyBodyWithObservable() throws Exception {
ResolvableType type = httpEntityType(Observable.class, String.class);
HttpEntity<Observable<String>> entity = resolveValueWithEmptyBody(type);
StepVerifier.create(RxReactiveStreams.toPublisher(entity.getBody())).expectNextCount(0).expectComplete().verify();
}
use of org.springframework.core.ResolvableType in project spring-framework by spring-projects.
the class HttpEntityArgumentResolverTests method httpEntityWithFluxBody.
@Test
public void httpEntityWithFluxBody() throws Exception {
ServerWebExchange exchange = postExchange("line1\nline2\nline3\n");
ResolvableType type = httpEntityType(Flux.class, String.class);
HttpEntity<Flux<String>> httpEntity = resolveValue(exchange, type);
assertEquals(exchange.getRequest().getHeaders(), httpEntity.getHeaders());
StepVerifier.create(httpEntity.getBody()).expectNext("line1\n").expectNext("line2\n").expectNext("line3\n").expectComplete().verify();
}
Aggregations