Skip to content

Commit f7ebd56

Browse files
committed
Various fixes + start adding new query tests
1 parent 497eff3 commit f7ebd56

File tree

7 files changed

+1546
-289
lines changed

7 files changed

+1546
-289
lines changed

codegen/src/main/java/software/amazon/awssdk/codegen/model/service/XmlNamespace.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717

1818
public class XmlNamespace {
1919

20+
public XmlNamespace() {}
21+
22+
public XmlNamespace(String uri) {
23+
this.uri = uri;
24+
}
25+
2026
private String prefix;
2127

2228
private String uri;

test/protocol-tests-core/src/main/java/software/amazon/awssdk/protocol/asserts/marshalling/HeadersAssertion.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import com.github.tomakehurst.wiremock.http.HttpHeaders;
2323
import com.github.tomakehurst.wiremock.verification.LoggedRequest;
24+
import java.util.Collections;
2425
import java.util.List;
2526
import java.util.Map;
2627

@@ -64,6 +65,9 @@ private void assertHeadersContains(HttpHeaders actual) {
6465
assertTrue(String.format("Header '%s' was expected to be present. Actual headers: %s", expectedKey, actual),
6566
actual.getHeader(expectedKey).isPresent());
6667
List<String> actualValues = actual.getHeader(expectedKey).values();
68+
if (expectedKey.equalsIgnoreCase("Content-Type") && actualValues.size() == 1) {
69+
actualValues = Collections.singletonList(actualValues.get(0).replace("; charset=UTF-8", ""));
70+
}
6771
assertEquals(expectedValues, actualValues);
6872
});
6973
}

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,16 @@ public class Then {
2929
private final MarshallingAssertion serializedAs;
3030
private final UnmarshallingAssertion deserializedAs;
3131
private final UnmarshallingAssertion errorDeserializedAs;
32+
private final String errorCode;
3233

3334
@JsonCreator
3435
public Then(@JsonProperty("serializedAs") SerializedAs serializedAs,
35-
@JsonProperty("deserializedAs") JsonNode deserializedAs) {
36+
@JsonProperty("deserializedAs") JsonNode deserializedAs,
37+
@JsonProperty("errorCode") String errorCode) {
3638
this.serializedAs = serializedAs;
3739
this.deserializedAs = new UnmarshalledResultAssertion(deserializedAs);
3840
this.errorDeserializedAs = new UnmarshalledErrorAssertion(deserializedAs);
41+
this.errorCode = errorCode;
3942
}
4043

4144
/**
@@ -53,10 +56,16 @@ public UnmarshallingAssertion getUnmarshallingAssertion() {
5356
}
5457

5558
/**
56-
*
5759
* @return The assertion object to use for error unmarshalling tests
5860
*/
5961
public UnmarshallingAssertion getErrorUnmarshallingAssertion() {
6062
return errorDeserializedAs;
6163
}
64+
65+
/**
66+
* @return The error code to assert.
67+
*/
68+
public String getErrorCode() {
69+
return errorCode;
70+
}
6271
}

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

Lines changed: 825 additions & 166 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)