From 38cc03ae9ea103bb31ef023a810daabfd56834ed Mon Sep 17 00:00:00 2001 From: Tyler Benson Date: Tue, 6 Aug 2019 08:11:37 -0700 Subject: [PATCH] Misc fixes --- .../server/VertxRxCircuitBreakerHttpServerTest.groovy | 7 +++---- .../datadog/trace/agent/test/base/HttpServerTest.groovy | 9 ++++----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/dd-java-agent/instrumentation/vertx/src/test/groovy/server/VertxRxCircuitBreakerHttpServerTest.groovy b/dd-java-agent/instrumentation/vertx/src/test/groovy/server/VertxRxCircuitBreakerHttpServerTest.groovy index 1f944983a1..56bbbbce2a 100644 --- a/dd-java-agent/instrumentation/vertx/src/test/groovy/server/VertxRxCircuitBreakerHttpServerTest.groovy +++ b/dd-java-agent/instrumentation/vertx/src/test/groovy/server/VertxRxCircuitBreakerHttpServerTest.groovy @@ -4,7 +4,6 @@ import datadog.trace.agent.test.base.HttpServerTest import io.vertx.circuitbreaker.CircuitBreakerOptions import io.vertx.reactivex.circuitbreaker.CircuitBreaker import io.vertx.reactivex.core.AbstractVerticle -import io.vertx.reactivex.core.Future import io.vertx.reactivex.ext.web.Router import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.ERROR @@ -39,7 +38,7 @@ class VertxRxCircuitBreakerHttpServerTest extends VertxHttpServerTest { } result.setHandler { if (it.failed()) { - throw it.cause(); + throw it.cause() } HttpServerTest.ServerEndpoint endpoint = it.result() controller(endpoint) { @@ -53,7 +52,7 @@ class VertxRxCircuitBreakerHttpServerTest extends VertxHttpServerTest { } result.setHandler { if (it.failed()) { - throw it.cause(); + throw it.cause() } HttpServerTest.ServerEndpoint endpoint = it.result() controller(endpoint) { @@ -67,7 +66,7 @@ class VertxRxCircuitBreakerHttpServerTest extends VertxHttpServerTest { } result.setHandler { if (it.failed()) { - throw it.cause(); + throw it.cause() } HttpServerTest.ServerEndpoint endpoint = it.result() controller(endpoint) { diff --git a/dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/base/HttpServerTest.groovy b/dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/base/HttpServerTest.groovy index 9aa9a3fca0..ba4ae11c3d 100644 --- a/dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/base/HttpServerTest.groovy +++ b/dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/base/HttpServerTest.groovy @@ -76,7 +76,7 @@ abstract class HttpServerTest extends Age true } - public enum ServerEndpoint { + enum ServerEndpoint { SUCCESS("success", 200, "success"), REDIRECT("redirect", 302, null), ERROR("error", 500, "controller error"), @@ -96,11 +96,11 @@ abstract class HttpServerTest extends Age this.errored = status >= 500 } - public String getPath() { + String getPath() { return "/$path" } - public String rawPath() { + String rawPath() { return path } @@ -124,9 +124,8 @@ abstract class HttpServerTest extends Age static T controller(ServerEndpoint endpoint, Closure closure) { if (endpoint == NOT_FOUND) { return closure() - } else { - return runUnderTrace("controller", closure) } + return runUnderTrace("controller", closure) } def "test success with #count requests"() {