Skip to content

Commit eaf1cc8

Browse files
committed
feat: set up contract tests for secrets manager and step functions
1 parent 76f87a3 commit eaf1cc8

File tree

9 files changed

+1195
-7
lines changed

9 files changed

+1195
-7
lines changed

appsignals-tests/contract-tests/src/test/java/software/amazon/opentelemetry/appsignals/test/awssdk/base/AwsSdkBaseTest.java

Lines changed: 540 additions & 6 deletions
Large diffs are not rendered by default.

appsignals-tests/contract-tests/src/test/java/software/amazon/opentelemetry/appsignals/test/awssdk/v1/AwsSdkV1Test.java

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,16 @@ protected String getBedrockAgentRuntimeSpanNamePrefix() {
7676
return "AWSBedrockAgentRuntime";
7777
}
7878

79+
@Override
80+
protected String getSecretsManagerSpanNamePrefix() {
81+
return "AWSSecretsManager";
82+
}
83+
84+
@Override
85+
protected String getStepFunctionsSpanNamePrefix() {
86+
return "AWSStepFunctions";
87+
}
88+
7989
protected String getS3RpcServiceName() {
8090
return "Amazon S3";
8191
}
@@ -90,6 +100,16 @@ protected String getSqsRpcServiceName() {
90100
return "AmazonSQS";
91101
}
92102

103+
@Override
104+
protected String getSecretsManagerRpcServiceName() {
105+
return "AWSSecretsManager";
106+
}
107+
108+
@Override
109+
protected String getStepFunctionsRpcServiceName() {
110+
return "AWSStepFunctions";
111+
}
112+
93113
protected String getKinesisRpcServiceName() {
94114
return "AmazonKinesis";
95115
}
@@ -235,4 +255,39 @@ void testBedrockAgentRuntimeAgentId() {
235255
void testBedrockAgentRuntimeKnowledgeBaseId() {
236256
doTestBedrockAgentRuntimeKnowledgeBaseId();
237257
}
258+
259+
@Test
260+
void testSecretsManagerDescribeSecret() throws Exception {
261+
doTestSecretsManagerDescribeSecret();
262+
}
263+
264+
@Test
265+
void testSecretsManagerError() throws Exception {
266+
doTestSecretsManagerError();
267+
}
268+
269+
@Test
270+
void testSecretsManagerFault() throws Exception {
271+
doTestSecretsManagerFault();
272+
}
273+
274+
@Test
275+
void testStepFunctionsDescribeStateMachine() throws Exception {
276+
doTestStepFunctionsDescribeStateMachine();
277+
}
278+
279+
@Test
280+
void testStepFunctionsDescribeActivity() throws Exception {
281+
doTestStepFunctionsDescribeActivity();
282+
}
283+
284+
@Test
285+
void testStepFunctionsError() throws Exception {
286+
doTestStepFunctionsError();
287+
}
288+
289+
@Test
290+
void testStepFunctionsFault() throws Exception {
291+
doTestStepFunctionsFault();
292+
}
238293
}

appsignals-tests/contract-tests/src/test/java/software/amazon/opentelemetry/appsignals/test/awssdk/v2/AwsSdkV2Test.java

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,16 @@ protected String getBedrockAgentRuntimeSpanNamePrefix() {
7575
return "BedrockAgentRuntime";
7676
}
7777

78+
@Override
79+
protected String getSecretsManagerSpanNamePrefix() {
80+
return "SecretsManager";
81+
}
82+
83+
@Override
84+
protected String getStepFunctionsSpanNamePrefix() {
85+
return "Sfn";
86+
}
87+
7888
@Override
7989
protected String getS3RpcServiceName() {
8090
return "S3";
@@ -114,6 +124,16 @@ protected String getBedrockAgentRuntimeRpcServiceName() {
114124
return "BedrockAgentRuntime";
115125
}
116126

127+
@Override
128+
protected String getSecretsManagerRpcServiceName() {
129+
return "SecretsManager";
130+
}
131+
132+
@Override
133+
protected String getStepFunctionsRpcServiceName() {
134+
return "Sfn";
135+
}
136+
117137
@Test
118138
void testS3CreateBucket() throws Exception {
119139
doTestS3CreateBucket();
@@ -240,4 +260,39 @@ void testBedrockAgentRuntimeAgentId() {
240260
// void testBedrockAgentRuntimeKnowledgeBaseId() {
241261
// doTestBedrockAgentRuntimeKnowledgeBaseId();
242262
// }
263+
264+
@Test
265+
void testSecretsManagerDescribeSecret() throws Exception {
266+
doTestSecretsManagerDescribeSecret();
267+
}
268+
269+
@Test
270+
void testSecretsManagerError() throws Exception {
271+
doTestSecretsManagerError();
272+
}
273+
274+
@Test
275+
void testSecretsManagerFault() throws Exception {
276+
doTestSecretsManagerFault();
277+
}
278+
279+
@Test
280+
void testStepFunctionsDescribeStateMachine() throws Exception {
281+
doTestStepFunctionsDescribeStateMachine();
282+
}
283+
284+
@Test
285+
void testStepFunctionsDescribeActivity() throws Exception {
286+
doTestStepFunctionsDescribeActivity();
287+
}
288+
289+
@Test
290+
void testStepFunctionsError() throws Exception {
291+
doTestStepFunctionsError();
292+
}
293+
294+
@Test
295+
void testStepFunctionsFault() throws Exception {
296+
doTestStepFunctionsFault();
297+
}
243298
}

appsignals-tests/contract-tests/src/test/java/software/amazon/opentelemetry/appsignals/test/utils/AppSignalsConstants.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ public class AppSignalsConstants {
3131
public static final String AWS_REMOTE_OPERATION = "aws.remote.operation";
3232
public static final String AWS_REMOTE_RESOURCE_TYPE = "aws.remote.resource.type";
3333
public static final String AWS_REMOTE_RESOURCE_IDENTIFIER = "aws.remote.resource.identifier";
34-
public static final String AWS_CLOUDFORMATION_PRIMARY_IDENTIFIER = "aws.remote.resource.cfn.primary.identifier";
34+
public static final String AWS_CLOUDFORMATION_PRIMARY_IDENTIFIER =
35+
"aws.remote.resource.cfn.primary.identifier";
3536
public static final String AWS_SPAN_KIND = "aws.span.kind";
3637
public static final String AWS_REMOTE_DB_USER = "aws.remote.db.user";
3738
}

appsignals-tests/contract-tests/src/test/java/software/amazon/opentelemetry/appsignals/test/utils/SemanticConventionsConstants.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ public class SemanticConventionsConstants {
6464
public static final String AWS_GUARDRAIL_ID = "aws.bedrock.guardrail.id";
6565
public static final String AWS_GUARDRAIL_ARN = "aws.bedrock.guardrail.arn";
6666
public static final String GEN_AI_REQUEST_MODEL = "gen_ai.request.model";
67+
public static final String AWS_SECRET_ARN = "aws.secretsmanager.secret.arn";
68+
public static final String AWS_STATE_MACHINE_ARN = "aws.stepfunctions.state_machine.arn";
69+
public static final String AWS_ACTIVITY_ARN = "aws.stepfunctions.activity.arn";
6770

6871
// kafka
6972
public static final String MESSAGING_CLIENT_ID = "messaging.client_id";

appsignals-tests/images/aws-sdk/aws-sdk-v1/build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ dependencies {
3737
implementation("com.amazonaws:aws-java-sdk-bedrockagent")
3838
implementation("com.amazonaws:aws-java-sdk-bedrockruntime")
3939
implementation("com.amazonaws:aws-java-sdk-bedrockagentruntime")
40+
implementation("com.amazonaws:aws-java-sdk-secretsmanager")
41+
implementation("com.amazonaws:aws-java-sdk-iam")
42+
implementation("com.amazonaws:aws-java-sdk-stepfunctions")
4043
implementation("commons-logging:commons-logging")
4144
implementation("com.linecorp.armeria:armeria")
4245
implementation("com.fasterxml.jackson.core:jackson-databind:2.13.3")

0 commit comments

Comments
 (0)