Misc fixes
This commit is contained in:
parent
668b1059f5
commit
38cc03ae9e
|
@ -4,7 +4,6 @@ import datadog.trace.agent.test.base.HttpServerTest
|
||||||
import io.vertx.circuitbreaker.CircuitBreakerOptions
|
import io.vertx.circuitbreaker.CircuitBreakerOptions
|
||||||
import io.vertx.reactivex.circuitbreaker.CircuitBreaker
|
import io.vertx.reactivex.circuitbreaker.CircuitBreaker
|
||||||
import io.vertx.reactivex.core.AbstractVerticle
|
import io.vertx.reactivex.core.AbstractVerticle
|
||||||
import io.vertx.reactivex.core.Future
|
|
||||||
import io.vertx.reactivex.ext.web.Router
|
import io.vertx.reactivex.ext.web.Router
|
||||||
|
|
||||||
import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.ERROR
|
import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.ERROR
|
||||||
|
@ -39,7 +38,7 @@ class VertxRxCircuitBreakerHttpServerTest extends VertxHttpServerTest {
|
||||||
}
|
}
|
||||||
result.setHandler {
|
result.setHandler {
|
||||||
if (it.failed()) {
|
if (it.failed()) {
|
||||||
throw it.cause();
|
throw it.cause()
|
||||||
}
|
}
|
||||||
HttpServerTest.ServerEndpoint endpoint = it.result()
|
HttpServerTest.ServerEndpoint endpoint = it.result()
|
||||||
controller(endpoint) {
|
controller(endpoint) {
|
||||||
|
@ -53,7 +52,7 @@ class VertxRxCircuitBreakerHttpServerTest extends VertxHttpServerTest {
|
||||||
}
|
}
|
||||||
result.setHandler {
|
result.setHandler {
|
||||||
if (it.failed()) {
|
if (it.failed()) {
|
||||||
throw it.cause();
|
throw it.cause()
|
||||||
}
|
}
|
||||||
HttpServerTest.ServerEndpoint endpoint = it.result()
|
HttpServerTest.ServerEndpoint endpoint = it.result()
|
||||||
controller(endpoint) {
|
controller(endpoint) {
|
||||||
|
@ -67,7 +66,7 @@ class VertxRxCircuitBreakerHttpServerTest extends VertxHttpServerTest {
|
||||||
}
|
}
|
||||||
result.setHandler {
|
result.setHandler {
|
||||||
if (it.failed()) {
|
if (it.failed()) {
|
||||||
throw it.cause();
|
throw it.cause()
|
||||||
}
|
}
|
||||||
HttpServerTest.ServerEndpoint endpoint = it.result()
|
HttpServerTest.ServerEndpoint endpoint = it.result()
|
||||||
controller(endpoint) {
|
controller(endpoint) {
|
||||||
|
|
|
@ -76,7 +76,7 @@ abstract class HttpServerTest<DECORATOR extends HttpServerDecorator> extends Age
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ServerEndpoint {
|
enum ServerEndpoint {
|
||||||
SUCCESS("success", 200, "success"),
|
SUCCESS("success", 200, "success"),
|
||||||
REDIRECT("redirect", 302, null),
|
REDIRECT("redirect", 302, null),
|
||||||
ERROR("error", 500, "controller error"),
|
ERROR("error", 500, "controller error"),
|
||||||
|
@ -96,11 +96,11 @@ abstract class HttpServerTest<DECORATOR extends HttpServerDecorator> extends Age
|
||||||
this.errored = status >= 500
|
this.errored = status >= 500
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPath() {
|
String getPath() {
|
||||||
return "/$path"
|
return "/$path"
|
||||||
}
|
}
|
||||||
|
|
||||||
public String rawPath() {
|
String rawPath() {
|
||||||
return path
|
return path
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,9 +124,8 @@ abstract class HttpServerTest<DECORATOR extends HttpServerDecorator> extends Age
|
||||||
static <T> T controller(ServerEndpoint endpoint, Closure<T> closure) {
|
static <T> T controller(ServerEndpoint endpoint, Closure<T> closure) {
|
||||||
if (endpoint == NOT_FOUND) {
|
if (endpoint == NOT_FOUND) {
|
||||||
return closure()
|
return closure()
|
||||||
} else {
|
|
||||||
return runUnderTrace("controller", closure)
|
|
||||||
}
|
}
|
||||||
|
return runUnderTrace("controller", closure)
|
||||||
}
|
}
|
||||||
|
|
||||||
def "test success with #count requests"() {
|
def "test success with #count requests"() {
|
||||||
|
|
Loading…
Reference in New Issue