Package io.smallrye.mutiny.vertx.core
Interface Expectations
-
public interface Expectations
Helper methods to turn Vert.xExpectation
that work onFuture
intoUni
that can be used in a pipeline using theUni.plug(Function)
operator, as in:vertx.createHttpClient() .request(HttpMethod.GET, port, "localhost", "/") .chain(HttpClientRequest::send) .plug(expectation(HttpClientResponse::getDelegate, status(200).and(contentType("text/plain")))) .onItem().transformToUni(HttpClientResponse::body)
-
-
Method Summary
Static Methods Modifier and Type Method Description static <T> Function<io.smallrye.mutiny.Uni<T>,io.smallrye.mutiny.Uni<T>>
expectation(io.vertx.core.Expectation<? super T> expectation)
Yields a function to turn anExpectation
into aUni
.static <T,R>
Function<io.smallrye.mutiny.Uni<T>,io.smallrye.mutiny.Uni<T>>expectation(Function<T,R> extractor, io.vertx.core.Expectation<? super R> expectation)
Yields a function to turn anExpectation
into aUni
and uses an extractor so that expectations work on the correct types (e.g.,HttpResponseHead
) instead of the Mutiny shim types (e.g.,HttpResponseHead
).
-
-
-
Method Detail
-
expectation
static <T> Function<io.smallrye.mutiny.Uni<T>,io.smallrye.mutiny.Uni<T>> expectation(io.vertx.core.Expectation<? super T> expectation)
Yields a function to turn anExpectation
into aUni
.- Type Parameters:
T
- the element type- Parameters:
expectation
- the expectation- Returns:
- the mapping function
-
expectation
static <T,R> Function<io.smallrye.mutiny.Uni<T>,io.smallrye.mutiny.Uni<T>> expectation(Function<T,R> extractor, io.vertx.core.Expectation<? super R> expectation)
Yields a function to turn anExpectation
into aUni
and uses an extractor so that expectations work on the correct types (e.g.,HttpResponseHead
) instead of the Mutiny shim types (e.g.,HttpResponseHead
).- Type Parameters:
T
- the element typeR
- the extracted element type- Parameters:
extractor
- the extractor function, often a reference to agetDelegate()
methodexpectation
- the expectation- Returns:
- the mapping function
-
-