Modified UT method name from Spock to Java (#10601)

This commit is contained in:
Steve Rao 2024-02-21 01:01:02 +08:00 committed by GitHub
parent f8788dd2bc
commit 3b15791d49
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 28 additions and 28 deletions

View File

@ -57,7 +57,7 @@ abstract class SmokeTest {
private static GenericContainer backend; private static GenericContainer backend;
@BeforeAll @BeforeAll
static void setupSpec() { static void setup() {
backend = backend =
new GenericContainer<>( new GenericContainer<>(
"ghcr.io/open-telemetry/opentelemetry-java-instrumentation/smoke-test-fake-backend:20221127.3559314891") "ghcr.io/open-telemetry/opentelemetry-java-instrumentation/smoke-test-fake-backend:20221127.3559314891")
@ -92,7 +92,7 @@ abstract class SmokeTest {
} }
@AfterEach @AfterEach
void cleanup() throws IOException { void reset() throws IOException {
client client
.newCall( .newCall(
new Request.Builder() new Request.Builder()
@ -107,7 +107,7 @@ abstract class SmokeTest {
} }
@AfterAll @AfterAll
static void cleanupSpec() { static void cleanup() {
backend.stop(); backend.stop();
} }

View File

@ -62,7 +62,7 @@ abstract class IntegrationTest {
private static GenericContainer backend; private static GenericContainer backend;
@BeforeAll @BeforeAll
static void setupSpec() { static void setup() {
backend = backend =
new GenericContainer<>( new GenericContainer<>(
"ghcr.io/open-telemetry/opentelemetry-java-instrumentation/smoke-test-fake-backend:20221127.3559314891") "ghcr.io/open-telemetry/opentelemetry-java-instrumentation/smoke-test-fake-backend:20221127.3559314891")
@ -119,7 +119,7 @@ abstract class IntegrationTest {
} }
@AfterEach @AfterEach
void cleanup() throws IOException { void reset() throws IOException {
client client
.newCall( .newCall(
new Request.Builder() new Request.Builder()
@ -134,7 +134,7 @@ abstract class IntegrationTest {
} }
@AfterAll @AfterAll
static void cleanupSpec() { static void cleanup() {
backend.stop(); backend.stop();
} }

View File

@ -51,11 +51,11 @@ public abstract class AbstractAws2ClientRecordHttpErrorTest {
protected static List<String> httpErrorMessages = new ArrayList<>(); protected static List<String> httpErrorMessages = new ArrayList<>();
@BeforeAll @BeforeAll
public static void setupSpec() { public static void setup() {
server.start(); server.start();
} }
public static void cleanupSpec() { public static void cleanup() {
server.stop(); server.stop();
} }

View File

@ -32,19 +32,19 @@ class JedisClientTest {
static Jedis jedis; static Jedis jedis;
@BeforeAll @BeforeAll
static void setupSpec() { static void setup() {
redisServer.start(); redisServer.start();
port = redisServer.getMappedPort(6379); port = redisServer.getMappedPort(6379);
jedis = new Jedis("localhost", port); jedis = new Jedis("localhost", port);
} }
@AfterAll @AfterAll
static void cleanupSpec() { static void cleanup() {
redisServer.stop(); redisServer.stop();
} }
@BeforeEach @BeforeEach
void setup() { void reset() {
jedis.flushAll(); jedis.flushAll();
testing.clearData(); testing.clearData();
} }

View File

@ -35,20 +35,20 @@ class Jedis30ClientTest {
static Jedis jedis; static Jedis jedis;
@BeforeAll @BeforeAll
static void setupSpec() { static void setup() {
redisServer.start(); redisServer.start();
port = redisServer.getMappedPort(6379); port = redisServer.getMappedPort(6379);
jedis = new Jedis("localhost", port); jedis = new Jedis("localhost", port);
} }
@AfterAll @AfterAll
static void cleanupSpec() { static void cleanup() {
redisServer.stop(); redisServer.stop();
jedis.close(); jedis.close();
} }
@BeforeEach @BeforeEach
void setup() { void reset() {
jedis.flushAll(); jedis.flushAll();
testing.clearData(); testing.clearData();
} }

View File

@ -33,20 +33,20 @@ class Jedis40ClientTest {
static Jedis jedis; static Jedis jedis;
@BeforeAll @BeforeAll
static void setupSpec() { static void setup() {
redisServer.start(); redisServer.start();
port = redisServer.getMappedPort(6379); port = redisServer.getMappedPort(6379);
jedis = new Jedis("localhost", port); jedis = new Jedis("localhost", port);
} }
@AfterAll @AfterAll
static void cleanupSpec() { static void cleanup() {
redisServer.stop(); redisServer.stop();
jedis.close(); jedis.close();
} }
@BeforeEach @BeforeEach
void setup() { void reset() {
jedis.flushAll(); jedis.flushAll();
testing.clearData(); testing.clearData();
} }

View File

@ -37,7 +37,7 @@ public class OkHttp2Test extends AbstractHttpClientTest<Request> {
private static final OkHttpClient clientWithReadTimeout = new OkHttpClient(); private static final OkHttpClient clientWithReadTimeout = new OkHttpClient();
@BeforeAll @BeforeAll
void setupSpec() { void setup() {
client.setConnectTimeout(CONNECTION_TIMEOUT.toMillis(), TimeUnit.MILLISECONDS); client.setConnectTimeout(CONNECTION_TIMEOUT.toMillis(), TimeUnit.MILLISECONDS);
clientWithReadTimeout.setConnectTimeout(CONNECTION_TIMEOUT.toMillis(), TimeUnit.MILLISECONDS); clientWithReadTimeout.setConnectTimeout(CONNECTION_TIMEOUT.toMillis(), TimeUnit.MILLISECONDS);
clientWithReadTimeout.setReadTimeout(READ_TIMEOUT.toMillis(), TimeUnit.MILLISECONDS); clientWithReadTimeout.setReadTimeout(READ_TIMEOUT.toMillis(), TimeUnit.MILLISECONDS);

View File

@ -22,7 +22,7 @@ public class RxJava2SubscriptionTest extends AbstractRxJava2SubscriptionTest {
} }
@BeforeAll @BeforeAll
public static void setupSpec() { public static void setup() {
tracingAssembly.enable(); tracingAssembly.enable();
} }
} }

View File

@ -22,7 +22,7 @@ public class RxJava2Test extends AbstractRxJava2Test {
} }
@BeforeAll @BeforeAll
public void setupSpec() { public void setup() {
tracingAssembly.enable(); tracingAssembly.enable();
} }
} }

View File

@ -23,7 +23,7 @@ public class RxJava3SubscriptionTest extends AbstractRxJava3SubscriptionTest {
static TracingAssembly tracingAssembly = TracingAssembly.create(); static TracingAssembly tracingAssembly = TracingAssembly.create();
@BeforeAll @BeforeAll
public static void setupSpec() { public static void setup() {
tracingAssembly.enable(); tracingAssembly.enable();
} }
} }

View File

@ -22,7 +22,7 @@ public class RxJava3Test extends AbstractRxJava3Test {
} }
@BeforeAll @BeforeAll
public void setupSpec() { public void setup() {
tracingAssembly.enable(); tracingAssembly.enable();
} }
} }

View File

@ -23,7 +23,7 @@ public class RxJava3SubscriptionTest extends AbstractRxJava3SubscriptionTest {
static TracingAssembly tracingAssembly = TracingAssembly.create(); static TracingAssembly tracingAssembly = TracingAssembly.create();
@BeforeAll @BeforeAll
public static void setupSpec() { public static void setup() {
tracingAssembly.enable(); tracingAssembly.enable();
} }
} }

View File

@ -22,7 +22,7 @@ public class RxJava3Test extends AbstractRxJava3Test {
} }
@BeforeAll @BeforeAll
public void setupSpec() { public void setup() {
tracingAssembly.enable(); tracingAssembly.enable();
} }
} }

View File

@ -32,14 +32,14 @@ public class SparkJavaBasedTest {
static WebClient client; static WebClient client;
@BeforeAll @BeforeAll
static void setupSpec() { static void setup() {
port = PortUtils.findOpenPort(); port = PortUtils.findOpenPort();
TestSparkJavaApplication.initSpark(port); TestSparkJavaApplication.initSpark(port);
client = WebClient.of("http://localhost:" + port); client = WebClient.of("http://localhost:" + port);
} }
@AfterAll @AfterAll
static void cleanupSpec() { static void cleanup() {
Spark.stop(); Spark.stop();
} }

View File

@ -39,7 +39,7 @@ class VertxRedisClientTest {
private static RedisAPI redis; private static RedisAPI redis;
@BeforeAll @BeforeAll
static void setupSpec() throws Exception { static void setup() throws Exception {
redisServer.start(); redisServer.start();
port = redisServer.getMappedPort(6379); port = redisServer.getMappedPort(6379);
@ -51,7 +51,7 @@ class VertxRedisClientTest {
} }
@AfterAll @AfterAll
static void cleanupSpec() { static void cleanup() {
redis.close(); redis.close();
client.close(); client.close();
redisServer.stop(); redisServer.stop();