Allows for mocking and testing usages of RxHttpClientBuilder in application code
Below is an example:
client.expect {
uriTemplate '/foo/bar'
method "POST"
contentType 'application/json'
json {
title "Ping"
}
}.respond {
created()
json {
title "Pong"
}
}
Observable p = client.post("https://localhost:8080/foo/bar") {
contentType 'application/json'
json {
title "Ping"
}
}
assert client.verify()
| Type | Name and description |
|---|---|
java.nio.charset.Charset |
charset |
java.util.List<io.netty.handler.codec.http.FullHttpRequest> |
expectedFullRequests |
java.util.List<io.reactivex.netty.protocol.http.server.HttpServerRequest> |
expectedRequests |
java.util.List<groovy.lang.Closure> |
expectedResponses |
int |
expectedTotal |
HttpTestServer |
httpTestServer |
java.util.List<io.netty.buffer.ByteBuf> |
inboundBodies |
java.util.List<io.reactivex.netty.protocol.http.server.HttpServerRequest> |
inboundMessages |
| Constructor and description |
|---|
TestHttpServerRequestBuilder
(HttpTestServer httpTestServer) |
| Type | Name and description |
|---|---|
TestHttpServerRequestBuilder |
expect(groovy.lang.Closure callable) |
protected io.netty.buffer.ByteBuf |
getExpectedBody(io.reactivex.netty.protocol.http.server.HttpServerRequest expected) |
void |
reset() |
TestHttpServerRequestBuilder |
respond(groovy.lang.Closure callable) |
java.net.URI |
serverURI() |
java.net.InetSocketAddress |
socketAddress() |
boolean |
verify()Verifies the expected requests were produced |
protected void |
verifyRequest(io.reactivex.netty.protocol.http.server.HttpServerRequest expected, io.reactivex.netty.protocol.http.server.HttpServerRequest actual, int index) |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Verifies the expected requests were produced