Search in sources :

Example 96 with ResolvableType

use of org.springframework.core.ResolvableType in project spring-framework by spring-projects.

the class ResourceHttpMessageWriterTests method testWrite.

private void testWrite(MockServerHttpRequest request) {
    Mono<Resource> input = Mono.just(this.resource);
    ResolvableType type = ResolvableType.forClass(Resource.class);
    MediaType contentType = MediaType.TEXT_PLAIN;
    Map<String, Object> hints = Collections.emptyMap();
    Mono<Void> mono = this.writer.write(input, null, type, contentType, request, this.response, hints);
    StepVerifier.create(mono).expectNextCount(0).expectComplete().verify();
}
Also used : ByteArrayResource(org.springframework.core.io.ByteArrayResource) Resource(org.springframework.core.io.Resource) MediaType(org.springframework.http.MediaType) ResolvableType(org.springframework.core.ResolvableType)

Aggregations

ResolvableType (org.springframework.core.ResolvableType)96 Test (org.junit.Test)66 MethodParameter (org.springframework.core.MethodParameter)20 DataBuffer (org.springframework.core.io.buffer.DataBuffer)15 ServerWebExchange (org.springframework.web.server.ServerWebExchange)14 List (java.util.List)11 MediaType (org.springframework.http.MediaType)10 Flux (reactor.core.publisher.Flux)10 Mono (reactor.core.publisher.Mono)10 Map (java.util.Map)9 Assert (org.springframework.util.Assert)7 Collections (java.util.Collections)6 MockServerWebExchange (org.springframework.mock.http.server.reactive.test.MockServerWebExchange)6 ArrayList (java.util.ArrayList)5 ReactiveAdapter (org.springframework.core.ReactiveAdapter)5 Pojo (org.springframework.http.codec.Pojo)5 ServerWebInputException (org.springframework.web.server.ServerWebInputException)5 Publisher (org.reactivestreams.Publisher)4 HttpMessageReader (org.springframework.http.codec.HttpMessageReader)4 Single (rx.Single)4