Search in sources :

Example 46 with Mono

use of reactor.core.publisher.Mono in project spring-cloud-sleuth by spring-cloud.

the class TraceUserInfoRestTemplateCustomizer method wrapHttpClientRequestSending.

Mono<HttpClientResponse> wrapHttpClientRequestSending(ProceedingJoinPoint pjp, HttpMethod method, String url, Function<? super HttpClientRequest, ? extends Publisher<Void>> handler) throws Throwable {
    // add headers and set CS
    final Span currentSpan = this.tracer.currentSpan();
    final AtomicReference<Span> span = new AtomicReference<>();
    Function<HttpClientRequest, Publisher<Void>> combinedFunction = req -> {
        try (Tracer.SpanInScope spanInScope = this.tracer.withSpanInScope(currentSpan)) {
            io.netty.handler.codec.http.HttpHeaders originalHeaders = req.requestHeaders().copy();
            io.netty.handler.codec.http.HttpHeaders tracedHeaders = req.requestHeaders();
            span.set(this.handler.handleSend(this.injector, tracedHeaders, req));
            io.netty.handler.codec.http.HttpHeaders addedHeaders = tracedHeaders.copy();
            originalHeaders.forEach(header -> addedHeaders.remove(header.getKey()));
            try (Tracer.SpanInScope clientInScope = this.tracer.withSpanInScope(span.get())) {
                if (log.isDebugEnabled()) {
                    log.debug("Created a new client span for Netty client");
                }
                return handle(handler, new TracedHttpClientRequest(req, addedHeaders));
            }
        }
    };
    // run
    Mono<HttpClientResponse> responseMono = (Mono<HttpClientResponse>) pjp.proceed(new Object[] { method, url, combinedFunction });
    // get response
    return responseMono.doOnSuccessOrError((httpClientResponse, throwable) -> {
        try (Tracer.SpanInScope ws = this.tracer.withSpanInScope(span.get())) {
            // status codes and CR
            this.handler.handleReceive(httpClientResponse, throwable, span.get());
            if (log.isDebugEnabled()) {
                log.debug("Setting client sent spans");
            }
        }
    });
}
Also used : HttpHeaders(io.netty.handler.codec.http.HttpHeaders) ByteBufAllocator(io.netty.buffer.ByteBufAllocator) HttpRequest(org.springframework.http.HttpRequest) Span(brave.Span) Autowired(org.springframework.beans.factory.annotation.Autowired) WebClient(org.springframework.web.reactive.function.client.WebClient) NettyOutbound(reactor.ipc.netty.NettyOutbound) UserInfoRestTemplateCustomizer(org.springframework.boot.autoconfigure.security.oauth2.resource.UserInfoRestTemplateCustomizer) HttpClientConfiguration(org.springframework.cloud.commons.httpclient.HttpClientConfiguration) Aspect(org.aspectj.lang.annotation.Aspect) Map(java.util.Map) Path(java.nio.file.Path) RestTemplate(org.springframework.web.client.RestTemplate) HttpTracing(brave.http.HttpTracing) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Tracer(brave.Tracer) Set(java.util.Set) Pointcut(org.aspectj.lang.annotation.Pointcut) Cookie(io.netty.handler.codec.http.cookie.Cookie) TraceContext(brave.propagation.TraceContext) HttpClientResponse(reactor.ipc.netty.http.client.HttpClientResponse) Around(org.aspectj.lang.annotation.Around) BeanPostProcessor(org.springframework.beans.factory.config.BeanPostProcessor) Configuration(org.springframework.context.annotation.Configuration) List(java.util.List) ClientHttpRequestInterceptor(org.springframework.http.client.ClientHttpRequestInterceptor) HttpAsyncClientBuilder(org.apache.http.impl.nio.client.HttpAsyncClientBuilder) TraceWebServletAutoConfiguration(org.springframework.cloud.sleuth.instrument.web.TraceWebServletAutoConfiguration) HttpClientHandler(brave.http.HttpClientHandler) LogFactory(org.apache.commons.logging.LogFactory) ListableBeanFactory(org.springframework.beans.factory.ListableBeanFactory) HttpVersion(io.netty.handler.codec.http.HttpVersion) ConditionalOnClass(org.springframework.boot.autoconfigure.condition.ConditionalOnClass) RestTemplateCustomizer(org.springframework.boot.web.client.RestTemplateCustomizer) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) OAuth2RestTemplate(org.springframework.security.oauth2.client.OAuth2RestTemplate) ArrayList(java.util.ArrayList) AutoConfigureAfter(org.springframework.boot.autoconfigure.AutoConfigureAfter) Charset(java.nio.charset.Charset) ByteBuf(io.netty.buffer.ByteBuf) NettyPipeline(reactor.ipc.netty.NettyPipeline) HttpClient(reactor.ipc.netty.http.client.HttpClient) Propagation(brave.propagation.Propagation) WebsocketOutbound(reactor.ipc.netty.http.websocket.WebsocketOutbound) Subscriber(org.reactivestreams.Subscriber) ClientHttpResponse(org.springframework.http.client.ClientHttpResponse) ClientHttpRequestExecution(org.springframework.http.client.ClientHttpRequestExecution) ConditionalOnBean(org.springframework.boot.autoconfigure.condition.ConditionalOnBean) Order(org.springframework.core.annotation.Order) FileChunkedStrategy(reactor.ipc.netty.channel.data.FileChunkedStrategy) Publisher(org.reactivestreams.Publisher) TracingClientHttpRequestInterceptor(brave.spring.web.TracingClientHttpRequestInterceptor) HttpMethod(io.netty.handler.codec.http.HttpMethod) IOException(java.io.IOException) BeansException(org.springframework.beans.BeansException) Mono(reactor.core.publisher.Mono) Consumer(java.util.function.Consumer) Flux(reactor.core.publisher.Flux) TracingHttpAsyncClientBuilder(brave.httpasyncclient.TracingHttpAsyncClientBuilder) BeanFactory(org.springframework.beans.factory.BeanFactory) NettyContext(reactor.ipc.netty.NettyContext) HttpClientRequest(reactor.ipc.netty.http.client.HttpClientRequest) TracingHttpClientBuilder(brave.httpclient.TracingHttpClientBuilder) Log(org.apache.commons.logging.Log) HttpClientBuilder(org.apache.http.impl.client.HttpClientBuilder) Bean(org.springframework.context.annotation.Bean) AutoConfigureBefore(org.springframework.boot.autoconfigure.AutoConfigureBefore) ProceedingJoinPoint(org.aspectj.lang.ProceedingJoinPoint) HttpHeaders(io.netty.handler.codec.http.HttpHeaders) Tracer(brave.Tracer) Mono(reactor.core.publisher.Mono) AtomicReference(java.util.concurrent.atomic.AtomicReference) Publisher(org.reactivestreams.Publisher) Span(brave.Span) HttpClientRequest(reactor.ipc.netty.http.client.HttpClientRequest) HttpClientResponse(reactor.ipc.netty.http.client.HttpClientResponse)

Example 47 with Mono

use of reactor.core.publisher.Mono in project spring-cloud-sleuth by spring-cloud.

the class TraceWebFilter method filter.

@Override
public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain) {
    if (tracer().currentSpan() != null) {
        // clear any previous trace
        tracer().withSpanInScope(null);
    }
    ServerHttpRequest request = exchange.getRequest();
    ServerHttpResponse response = exchange.getResponse();
    String uri = request.getPath().pathWithinApplication().value();
    if (log.isDebugEnabled()) {
        log.debug("Received a request to uri [" + uri + "]");
    }
    Span spanFromAttribute = getSpanFromAttribute(exchange);
    final String CONTEXT_ERROR = "sleuth.webfilter.context.error";
    return chain.filter(exchange).compose(f -> f.then(Mono.subscriberContext()).onErrorResume(t -> Mono.subscriberContext().map(c -> c.put(CONTEXT_ERROR, t))).flatMap(c -> {
        // reactivate span from context
        Span span = spanFromContext(c);
        Mono<Void> continuation;
        Throwable t = null;
        if (c.hasKey(CONTEXT_ERROR)) {
            t = c.get(CONTEXT_ERROR);
            continuation = Mono.error(t);
        } else {
            continuation = Mono.empty();
        }
        Object attribute = exchange.getAttribute(HandlerMapping.BEST_MATCHING_HANDLER_ATTRIBUTE);
        if (attribute instanceof HandlerMethod) {
            HandlerMethod handlerMethod = (HandlerMethod) attribute;
            addClassMethodTag(handlerMethod, span);
            addClassNameTag(handlerMethod, span);
        }
        addResponseTagsForSpanWithoutParent(exchange, response, span);
        handler().handleSend(response, t, span);
        if (log.isDebugEnabled()) {
            log.debug("Handled send of " + span);
        }
        return continuation;
    }).subscriberContext(c -> {
        Span span;
        if (c.hasKey(Span.class)) {
            Span parent = c.get(Span.class);
            span = tracer().nextSpan(TraceContextOrSamplingFlags.create(parent.context())).start();
            if (log.isDebugEnabled()) {
                log.debug("Found span in reactor context" + span);
            }
        } else {
            if (spanFromAttribute != null) {
                span = spanFromAttribute;
                if (log.isDebugEnabled()) {
                    log.debug("Found span in attribute " + span);
                }
            } else {
                span = handler().handleReceive(extractor(), request.getHeaders(), request);
                if (log.isDebugEnabled()) {
                    log.debug("Handled receive of span " + span);
                }
            }
            exchange.getAttributes().put(TRACE_REQUEST_ATTR, span);
        }
        return c.put(Span.class, span);
    }));
}
Also used : HttpTracing(brave.http.HttpTracing) Ordered(org.springframework.core.Ordered) Tracer(brave.Tracer) ServerHttpResponse(org.springframework.http.server.reactive.ServerHttpResponse) TraceContextOrSamplingFlags(brave.propagation.TraceContextOrSamplingFlags) HttpHeaders(org.springframework.http.HttpHeaders) Context(reactor.util.context.Context) Span(brave.Span) Mono(reactor.core.publisher.Mono) TraceContext(brave.propagation.TraceContext) ServerWebExchange(org.springframework.web.server.ServerWebExchange) TraceKeys(org.springframework.cloud.sleuth.TraceKeys) HandlerMethod(org.springframework.web.method.HandlerMethod) WebFilter(org.springframework.web.server.WebFilter) BeanFactory(org.springframework.beans.factory.BeanFactory) Propagation(brave.propagation.Propagation) Log(org.apache.commons.logging.Log) LogFactory(org.apache.commons.logging.LogFactory) HttpServerHandler(brave.http.HttpServerHandler) HandlerMapping(org.springframework.web.reactive.HandlerMapping) ServerHttpRequest(org.springframework.http.server.reactive.ServerHttpRequest) WebFilterChain(org.springframework.web.server.WebFilterChain) ServerHttpRequest(org.springframework.http.server.reactive.ServerHttpRequest) Span(brave.Span) ServerHttpResponse(org.springframework.http.server.reactive.ServerHttpResponse) HandlerMethod(org.springframework.web.method.HandlerMethod)

Example 48 with Mono

use of reactor.core.publisher.Mono in project spring-integration by spring-projects.

the class MessagingGatewaySupport method doSendAndReceiveMessageReactive.

@SuppressWarnings("unchecked")
private Mono<Message<?>> doSendAndReceiveMessageReactive(MessageChannel requestChannel, Object object, boolean error) {
    return Mono.defer(() -> {
        Message<?> message;
        try {
            message = object instanceof Message<?> ? (Message<?>) object : this.requestMapper.toMessage(object);
            message = this.historyWritingPostProcessor.postProcessMessage(message);
        } catch (Exception e) {
            throw new MessageMappingException("Cannot map to message: " + object, e);
        }
        Object originalReplyChannelHeader = message.getHeaders().getReplyChannel();
        Object originalErrorChannelHeader = message.getHeaders().getErrorChannel();
        FutureReplyChannel replyChannel = new FutureReplyChannel();
        Message<?> requestMessage = MutableMessageBuilder.fromMessage(message).setReplyChannel(replyChannel).setHeader(this.messagingTemplate.getSendTimeoutHeader(), null).setHeader(this.messagingTemplate.getReceiveTimeoutHeader(), null).setErrorChannel(replyChannel).build();
        if (requestChannel instanceof ReactiveStreamsSubscribableChannel) {
            ((ReactiveStreamsSubscribableChannel) requestChannel).subscribeTo(Mono.just(requestMessage));
        } else {
            long sendTimeout = sendTimeout(requestMessage);
            boolean sent = sendTimeout >= 0 ? requestChannel.send(requestMessage, sendTimeout) : requestChannel.send(requestMessage);
            if (!sent) {
                throw new MessageDeliveryException(requestMessage, "Failed to send message to channel '" + requestChannel + "' within timeout: " + sendTimeout);
            }
        }
        return Mono.fromFuture(replyChannel.messageFuture).doOnSubscribe(s -> {
            if (!error && this.countsEnabled) {
                this.messageCount.incrementAndGet();
            }
        }).<Message<?>>map(replyMessage -> MessageBuilder.fromMessage(replyMessage).setHeader(MessageHeaders.REPLY_CHANNEL, originalReplyChannelHeader).setHeader(MessageHeaders.ERROR_CHANNEL, originalErrorChannelHeader).build()).onErrorResume(t -> error ? Mono.error(t) : handleSendError(requestMessage, t));
    });
}
Also used : MessagingException(org.springframework.messaging.MessagingException) AbstractEndpoint(org.springframework.integration.endpoint.AbstractEndpoint) TrackableComponent(org.springframework.integration.support.management.TrackableComponent) IntegrationManagedResource(org.springframework.integration.support.management.IntegrationManagedResource) SubscribableChannel(org.springframework.messaging.SubscribableChannel) CompletableFuture(java.util.concurrent.CompletableFuture) ReactiveStreamsConsumer(org.springframework.integration.endpoint.ReactiveStreamsConsumer) ErrorMessage(org.springframework.messaging.support.ErrorMessage) PollingConsumer(org.springframework.integration.endpoint.PollingConsumer) ErrorMessageStrategy(org.springframework.integration.support.ErrorMessageStrategy) MessagingTemplate(org.springframework.integration.core.MessagingTemplate) OutboundMessageMapper(org.springframework.integration.mapping.OutboundMessageMapper) MessageTimeoutException(org.springframework.integration.MessageTimeoutException) EventDrivenConsumer(org.springframework.integration.endpoint.EventDrivenConsumer) Map(java.util.Map) InboundMessageMapper(org.springframework.integration.mapping.InboundMessageMapper) Nullable(org.springframework.lang.Nullable) Message(org.springframework.messaging.Message) PollableChannel(org.springframework.messaging.PollableChannel) Subscriber(org.reactivestreams.Subscriber) HistoryWritingMessagePostProcessor(org.springframework.integration.history.HistoryWritingMessagePostProcessor) DefaultErrorMessageStrategy(org.springframework.integration.support.DefaultErrorMessageStrategy) MessageBuilderFactory(org.springframework.integration.support.MessageBuilderFactory) SimpleMessageConverter(org.springframework.integration.support.converter.SimpleMessageConverter) Mono(reactor.core.publisher.Mono) ReactiveStreamsSubscribableChannel(org.springframework.integration.channel.ReactiveStreamsSubscribableChannel) MessageSourceMetrics(org.springframework.integration.support.management.MessageSourceMetrics) MessageChannel(org.springframework.messaging.MessageChannel) MessageHeaders(org.springframework.messaging.MessageHeaders) BridgeHandler(org.springframework.integration.handler.BridgeHandler) AtomicLong(java.util.concurrent.atomic.AtomicLong) MessageDeliveryException(org.springframework.messaging.MessageDeliveryException) AttributeAccessor(org.springframework.core.AttributeAccessor) MessageMappingException(org.springframework.integration.mapping.MessageMappingException) ErrorMessageUtils(org.springframework.integration.support.ErrorMessageUtils) MessageBuilder(org.springframework.messaging.support.MessageBuilder) DefaultMessageBuilderFactory(org.springframework.integration.support.DefaultMessageBuilderFactory) MutableMessageBuilder(org.springframework.integration.support.MutableMessageBuilder) Assert(org.springframework.util.Assert) MessageMappingException(org.springframework.integration.mapping.MessageMappingException) ErrorMessage(org.springframework.messaging.support.ErrorMessage) Message(org.springframework.messaging.Message) ReactiveStreamsSubscribableChannel(org.springframework.integration.channel.ReactiveStreamsSubscribableChannel) MessageDeliveryException(org.springframework.messaging.MessageDeliveryException) MessagingException(org.springframework.messaging.MessagingException) MessageTimeoutException(org.springframework.integration.MessageTimeoutException) MessageDeliveryException(org.springframework.messaging.MessageDeliveryException) MessageMappingException(org.springframework.integration.mapping.MessageMappingException)

Example 49 with Mono

use of reactor.core.publisher.Mono in project spring-integration by spring-projects.

the class WebFluxRequestExecutingMessageHandler method exchange.

@Override
protected Object exchange(Supplier<URI> uriSupplier, HttpMethod httpMethod, HttpEntity<?> httpRequest, Object expectedResponseType, Message<?> requestMessage) {
    WebClient.RequestBodySpec requestSpec = this.webClient.method(httpMethod).uri(b -> uriSupplier.get()).headers(headers -> headers.putAll(httpRequest.getHeaders()));
    if (httpRequest.hasBody()) {
        requestSpec.body(BodyInserters.fromObject(httpRequest.getBody()));
    }
    Mono<ClientResponse> responseMono = requestSpec.exchange().flatMap(response -> {
        HttpStatus httpStatus = response.statusCode();
        if (httpStatus.isError()) {
            return response.body(BodyExtractors.toDataBuffers()).reduce(DataBuffer::write).map(dataBuffer -> {
                byte[] bytes = new byte[dataBuffer.readableByteCount()];
                dataBuffer.read(bytes);
                DataBufferUtils.release(dataBuffer);
                return bytes;
            }).defaultIfEmpty(new byte[0]).map(bodyBytes -> {
                throw new WebClientResponseException("ClientResponse has erroneous status code: " + httpStatus.value() + " " + httpStatus.getReasonPhrase(), httpStatus.value(), httpStatus.getReasonPhrase(), response.headers().asHttpHeaders(), bodyBytes, response.headers().contentType().map(MimeType::getCharset).orElse(StandardCharsets.ISO_8859_1));
            });
        } else {
            return Mono.just(response);
        }
    });
    if (isExpectReply()) {
        return responseMono.flatMap(response -> {
            ResponseEntity.BodyBuilder httpEntityBuilder = ResponseEntity.status(response.statusCode()).headers(response.headers().asHttpHeaders());
            Mono<?> bodyMono;
            if (expectedResponseType != null) {
                if (this.replyPayloadToFlux) {
                    BodyExtractor<? extends Flux<?>, ReactiveHttpInputMessage> extractor;
                    if (expectedResponseType instanceof ParameterizedTypeReference<?>) {
                        extractor = BodyExtractors.toFlux((ParameterizedTypeReference<?>) expectedResponseType);
                    } else {
                        extractor = BodyExtractors.toFlux((Class<?>) expectedResponseType);
                    }
                    Flux<?> flux = response.body(extractor);
                    bodyMono = Mono.just(flux);
                } else {
                    BodyExtractor<? extends Mono<?>, ReactiveHttpInputMessage> extractor;
                    if (expectedResponseType instanceof ParameterizedTypeReference<?>) {
                        extractor = BodyExtractors.toMono((ParameterizedTypeReference<?>) expectedResponseType);
                    } else {
                        extractor = BodyExtractors.toMono((Class<?>) expectedResponseType);
                    }
                    bodyMono = response.body(extractor);
                }
            } else if (this.bodyExtractor != null) {
                Object body = response.body(this.bodyExtractor);
                if (body instanceof Mono) {
                    bodyMono = (Mono<?>) body;
                } else {
                    bodyMono = Mono.just(body);
                }
            } else {
                bodyMono = Mono.empty();
            }
            return bodyMono.map(httpEntityBuilder::body).defaultIfEmpty(httpEntityBuilder.build());
        }).map(this::getReply);
    } else {
        responseMono.subscribe(v -> {
        }, ex -> sendErrorMessage(requestMessage, ex));
        return null;
    }
}
Also used : ParameterizedTypeReference(org.springframework.core.ParameterizedTypeReference) LiteralExpression(org.springframework.expression.common.LiteralExpression) WebClient(org.springframework.web.reactive.function.client.WebClient) Supplier(java.util.function.Supplier) ClientHttpResponse(org.springframework.http.client.reactive.ClientHttpResponse) MimeType(org.springframework.util.MimeType) ValueExpression(org.springframework.integration.expression.ValueExpression) DataBufferUtils(org.springframework.core.io.buffer.DataBufferUtils) Message(org.springframework.messaging.Message) URI(java.net.URI) ClientResponse(org.springframework.web.reactive.function.client.ClientResponse) HttpMethod(org.springframework.http.HttpMethod) Mono(reactor.core.publisher.Mono) AbstractHttpRequestExecutingMessageHandler(org.springframework.integration.http.outbound.AbstractHttpRequestExecutingMessageHandler) BodyExtractor(org.springframework.web.reactive.function.BodyExtractor) DataBuffer(org.springframework.core.io.buffer.DataBuffer) StandardCharsets(java.nio.charset.StandardCharsets) HttpStatus(org.springframework.http.HttpStatus) Flux(reactor.core.publisher.Flux) HttpEntity(org.springframework.http.HttpEntity) BodyExtractors(org.springframework.web.reactive.function.BodyExtractors) ReactiveHttpInputMessage(org.springframework.http.ReactiveHttpInputMessage) MessageHandler(org.springframework.messaging.MessageHandler) BeanFactory(org.springframework.beans.factory.BeanFactory) Expression(org.springframework.expression.Expression) ResponseEntity(org.springframework.http.ResponseEntity) BodyInserters(org.springframework.web.reactive.function.BodyInserters) WebClientResponseException(org.springframework.web.reactive.function.client.WebClientResponseException) Assert(org.springframework.util.Assert) ClientResponse(org.springframework.web.reactive.function.client.ClientResponse) HttpStatus(org.springframework.http.HttpStatus) Mono(reactor.core.publisher.Mono) Flux(reactor.core.publisher.Flux) WebClient(org.springframework.web.reactive.function.client.WebClient) MimeType(org.springframework.util.MimeType) WebClientResponseException(org.springframework.web.reactive.function.client.WebClientResponseException) BodyExtractor(org.springframework.web.reactive.function.BodyExtractor)

Example 50 with Mono

use of reactor.core.publisher.Mono in project cf-java-client by cloudfoundry.

the class ReactorServerInformation method getAuthenticationCode.

@Override
public Mono<GetAutoLoginAuthenticationCodeResponse> getAuthenticationCode(GetAutoLoginAuthenticationCodeRequest request) {
    return post(request, GetAutoLoginAuthenticationCodeResponse.class, builder -> builder.pathSegment("autologin"), outbound -> outbound.map(r -> {
        String encoded = Base64.getEncoder().encodeToString(new AsciiString(request.getClientId()).concat(":").concat(request.getClientSecret()).toByteArray());
        r.requestHeaders().set(AUTHORIZATION, BASIC_PREAMBLE + encoded);
        return r;
    })).checkpoint();
}
Also used : GetAutoLoginAuthenticationCodeResponse(org.cloudfoundry.uaa.serverinformation.GetAutoLoginAuthenticationCodeResponse) IdentityZones(org.cloudfoundry.uaa.identityzones.IdentityZones) AsciiString(io.netty.util.AsciiString) AutoLoginRequest(org.cloudfoundry.uaa.serverinformation.AutoLoginRequest) Mono(reactor.core.publisher.Mono) TokenProvider(org.cloudfoundry.reactor.TokenProvider) Base64(java.util.Base64) ServerInformation(org.cloudfoundry.uaa.serverinformation.ServerInformation) GetInfoResponse(org.cloudfoundry.uaa.serverinformation.GetInfoResponse) GetInfoRequest(org.cloudfoundry.uaa.serverinformation.GetInfoRequest) ConnectionContext(org.cloudfoundry.reactor.ConnectionContext) AbstractUaaOperations(org.cloudfoundry.reactor.uaa.AbstractUaaOperations) GetAutoLoginAuthenticationCodeRequest(org.cloudfoundry.uaa.serverinformation.GetAutoLoginAuthenticationCodeRequest) AUTHORIZATION(io.netty.handler.codec.http.HttpHeaderNames.AUTHORIZATION) GetAutoLoginAuthenticationCodeResponse(org.cloudfoundry.uaa.serverinformation.GetAutoLoginAuthenticationCodeResponse) AsciiString(io.netty.util.AsciiString) AsciiString(io.netty.util.AsciiString)

Aggregations

Mono (reactor.core.publisher.Mono)350 Test (org.junit.jupiter.api.Test)174 StepVerifier (reactor.test.StepVerifier)140 List (java.util.List)137 Flux (reactor.core.publisher.Flux)137 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)124 Collections (java.util.Collections)93 Duration (java.time.Duration)86 Map (java.util.Map)81 ArrayList (java.util.ArrayList)73 HttpStatus (org.springframework.http.HttpStatus)66 ServerWebExchange (org.springframework.web.server.ServerWebExchange)65 TimeUnit (java.util.concurrent.TimeUnit)58 Publisher (org.reactivestreams.Publisher)55 AtomicReference (java.util.concurrent.atomic.AtomicReference)52 MockServerHttpRequest (org.springframework.web.testfixture.http.server.reactive.MockServerHttpRequest)52 DataBuffer (org.springframework.core.io.buffer.DataBuffer)51 Assert (org.springframework.util.Assert)51 Arrays (java.util.Arrays)48 Mockito.mock (org.mockito.Mockito.mock)48