Skip to content

Commit 8422888

Browse files
committed
Add support for test case id
1 parent c9a018b commit 8422888

File tree

7 files changed

+18
-3
lines changed

7 files changed

+18
-3
lines changed

test/protocol-tests-core/src/main/java/software/amazon/awssdk/protocol/model/TestCase.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,20 @@
1717

1818
public class TestCase {
1919

20+
private String id;
2021
private String description;
2122
// Given is optional
2223
private Given given = new Given();
2324
private When when;
2425
private Then then;
2526

27+
public String getId() {
28+
return id;
29+
}
30+
31+
public void setId(String id) {
32+
this.id = id;
33+
}
2634
public String getDescription() {
2735
return description;
2836
}
@@ -57,7 +65,7 @@ public void setThen(Then then) {
5765

5866
@Override
5967
public String toString() {
60-
return description;
68+
return id;
6169
}
6270

6371
}

test/protocol-tests-core/src/main/java/software/amazon/awssdk/protocol/runners/ProtocolTestRunner.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void runTests(List<TestCase> tests) throws Exception {
6666
}
6767

6868
public void runTest(TestCase testCase) throws Exception {
69-
log.info("Running test: {}", testCase.getDescription());
69+
log.info("Running test: [{}] {}", testCase.getId(), testCase.getDescription());
7070
switch (testCase.getWhen().getAction()) {
7171
case MARSHALL:
7272
marshallingTestRunner.runTest(testCase);

test/protocol-tests-core/src/main/resources/software/amazon/awssdk/protocol/suites/cases/json-querycompatible-input.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[
22
{
3+
"id": "QueryCompatibleAwsJson10CborSendsQueryModeHeader",
34
"description": "Clients for query-compatible services MUST send the x-amzn-query-mode header.",
45
"given": {
56
"input": {}

test/protocol-tests-core/src/main/resources/software/amazon/awssdk/protocol/suites/cases/json-querycompatible-output.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[
22
{
3+
"id": "QueryCompatibleRpcV2CborNoCustomCodeError",
34
"description": "Parses simple errors with no query error code",
45
"given": {
56
"response": {
@@ -24,6 +25,7 @@
2425
}
2526
},
2627
{
28+
"id": "QueryCompatibleRpcV2CborCustomCodeError",
2729
"description": "Parses simple errors with query error code",
2830
"given": {
2931
"response": {

test/protocol-tests-core/src/main/resources/software/amazon/awssdk/protocol/suites/cases/smithy-rpcv2-nonquerycompatible-input.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
[
22
{
3+
"id": "NonQueryCompatibleRpcV2CborForbidsQueryModeHeader",
34
"description": "The query mode header MUST NOT be set on non-query-compatible services.",
45
"given": {
56
"input": {}
67
},
78
"when": {
89
"action": "marshall",
9-
"operation": "NonQueryCompatibleOperation"
10+
"operation": "QueryIncompatibleOperation"
1011
},
1112
"then": {
1213
"serializedAs": {

test/protocol-tests-core/src/main/resources/software/amazon/awssdk/protocol/suites/cases/smithy-rpcv2-querycompatible-input.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[
22
{
3+
"id": "QueryCompatibleRpcV2CborSendsQueryModeHeader",
34
"description": "Clients for query-compatible services MUST send the x-amzn-query-mode header.",
45
"given": {
56
"input": {}

test/protocol-tests-core/src/main/resources/software/amazon/awssdk/protocol/suites/cases/smithy-rpcv2-querycompatible-output.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[
22
{
3+
"id": "QueryCompatibleAwsJson10CborNoCustomCodeError",
34
"description": "Parses simple RpcV2 CBOR errors with no query error code",
45
"given": {
56
"response": {
@@ -25,6 +26,7 @@
2526
}
2627
},
2728
{
29+
"id": "QueryCompatibleAwsJson10CustomCodeError",
2830
"description": "Parses simple RpcV2 CBOR errors with query error code",
2931
"given": {
3032
"response": {

0 commit comments

Comments
 (0)