use of org.springframework.core.ResolvableType in project spring-framework by spring-projects.
the class HttpEntityArgumentResolverTests method emptyBodyWithRxJava2Single.
@Test
public void emptyBodyWithRxJava2Single() throws Exception {
ResolvableType type = httpEntityType(io.reactivex.Single.class, String.class);
HttpEntity<io.reactivex.Single<String>> entity = resolveValueWithEmptyBody(type);
StepVerifier.create(entity.getBody().toFlowable()).expectNextCount(0).expectError(ServerWebInputException.class).verify();
}
use of org.springframework.core.ResolvableType in project spring-framework by spring-projects.
the class HttpEntityArgumentResolverTests method emptyBodyWithRxJava2Maybe.
@Test
public void emptyBodyWithRxJava2Maybe() throws Exception {
ResolvableType type = httpEntityType(Maybe.class, String.class);
HttpEntity<Maybe<String>> entity = resolveValueWithEmptyBody(type);
StepVerifier.create(entity.getBody().toFlowable()).expectNextCount(0).expectComplete().verify();
}
use of org.springframework.core.ResolvableType in project spring-framework by spring-projects.
the class HttpEntityArgumentResolverTests method requestEntity.
@Test
public void requestEntity() throws Exception {
ServerWebExchange exchange = postExchange("line1");
ResolvableType type = forClassWithGenerics(RequestEntity.class, String.class);
RequestEntity<String> requestEntity = resolveValue(exchange, type);
assertEquals(exchange.getRequest().getMethod(), requestEntity.getMethod());
assertEquals(exchange.getRequest().getURI(), requestEntity.getUrl());
assertEquals(exchange.getRequest().getHeaders(), requestEntity.getHeaders());
assertEquals("line1", requestEntity.getBody());
}
use of org.springframework.core.ResolvableType in project spring-framework by spring-projects.
the class HttpEntityArgumentResolverTests method httpEntityWithSingleBody.
@Test
public void httpEntityWithSingleBody() throws Exception {
ServerWebExchange exchange = postExchange("line1");
ResolvableType type = httpEntityType(Single.class, String.class);
HttpEntity<Single<String>> httpEntity = resolveValue(exchange, type);
assertEquals(exchange.getRequest().getHeaders(), httpEntity.getHeaders());
assertEquals("line1", httpEntity.getBody().toBlocking().value());
}
use of org.springframework.core.ResolvableType in project spring-framework by spring-projects.
the class HttpEntityArgumentResolverTests method httpEntityWithRxJava2SingleBody.
@Test
public void httpEntityWithRxJava2SingleBody() throws Exception {
ServerWebExchange exchange = postExchange("line1");
ResolvableType type = httpEntityType(io.reactivex.Single.class, String.class);
HttpEntity<io.reactivex.Single<String>> httpEntity = resolveValue(exchange, type);
assertEquals(exchange.getRequest().getHeaders(), httpEntity.getHeaders());
assertEquals("line1", httpEntity.getBody().blockingGet());
}
Aggregations