Skip to content

Commit 70b4349

Browse files
committed
fix visibility of setup/cleanup methods, add beforeEach for resetting context
1 parent c258180 commit 70b4349

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

instrumentation/aws-sdk/aws-sdk-1.11/testing/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/AbstractBaseAwsClientTest.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import java.util.Map;
3838
import org.junit.jupiter.api.AfterAll;
3939
import org.junit.jupiter.api.BeforeAll;
40+
import org.junit.jupiter.api.BeforeEach;
4041

4142
public abstract class AbstractBaseAwsClientTest {
4243
protected abstract InstrumentationExtension testing();
@@ -49,16 +50,20 @@ public abstract class AbstractBaseAwsClientTest {
4950
new AWSStaticCredentialsProvider(new AnonymousAWSCredentials());
5051

5152
@BeforeAll
52-
public static void setUp() {
53+
static void setUp() {
5354
System.setProperty(SDKGlobalConfiguration.ACCESS_KEY_SYSTEM_PROPERTY, "my-access-key");
5455
System.setProperty(SDKGlobalConfiguration.SECRET_KEY_SYSTEM_PROPERTY, "my-secret-key");
5556
server.start();
5657
endpoint = new AwsClientBuilder.EndpointConfiguration(server.httpUri().toString(), "us-west-2");
58+
}
59+
60+
@BeforeEach
61+
void reset() {
5762
server.beforeTestExecution(null);
5863
}
5964

6065
@AfterAll
61-
public static void cleanUp() {
66+
static void cleanUp() {
6267
System.clearProperty(SDKGlobalConfiguration.ACCESS_KEY_SYSTEM_PROPERTY);
6368
System.clearProperty(SDKGlobalConfiguration.SECRET_KEY_SYSTEM_PROPERTY);
6469
server.stop();

0 commit comments

Comments
 (0)