Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove use of HttpBody and replace with ByteStream #1254

Merged
merged 5 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public struct Sha256TreeHashMiddleware<OperationStackOutput>: Middleware {
}
case .empty:
break
case .none:
case .noStream:
break
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Sha256TreeHashMiddlewareTests: XCTestCase {
let streamInput = MockStreamInput(body: byteStream)
var stack = OperationStack<MockStreamInput, MockOutput>(id: "TreeHashMiddlewareTestStack")
stack.serializeStep.intercept(position: .before, middleware: MockSerializeStreamMiddleware())
let mockHttpResponse = HttpResponse(body: HttpBody.none, statusCode: .accepted)
let mockHttpResponse = HttpResponse(body: .noStream, statusCode: .accepted)
let mockOutput = try MockOutput(httpResponse: mockHttpResponse, decoder: nil)
let output = OperationOutput<MockOutput>(httpResponse: mockHttpResponse, output: mockOutput)
stack.finalizeStep.intercept(position: .after, middleware: Sha256TreeHashMiddleware<MockOutput>())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class RestJSONErrorTests: HttpResponseTestBase {
"X-Header": "Header",
"X-Amzn-Errortype": "ComplexError"
],
content: HttpBody.data("""
content: ByteStream.data("""
{\"TopLevel\": \"Top level\"}
""".data(using: .utf8))
) else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class RestXMLErrorTests: HttpResponseTestBase {
headers: [
"Content-Type": "application/xml"
],
content: HttpBody(byteStream: ByteStream.from(data:"""
content: ByteStream.data("""
<ErrorResponse>
<Error>
<Type>Sender</Type>
Expand All @@ -32,7 +32,7 @@ class RestXMLErrorTests: HttpResponseTestBase {
<RequestId>foo-id</RequestId>
</ErrorResponse>

""".data(using: .utf8)!))
""".data(using: .utf8)!)
) else {
XCTFail("Something is wrong with the created http response")
return
Expand Down Expand Up @@ -66,7 +66,7 @@ class RestXMLErrorTests: HttpResponseTestBase {
"Content-Type": "application/xml",
"X-Header": "Header"
],
content: HttpBody(byteStream: ByteStream.from(data:"""
content: ByteStream.data("""
<ErrorResponse>
<Error>
<Type>Sender</Type>
Expand All @@ -80,7 +80,7 @@ class RestXMLErrorTests: HttpResponseTestBase {
<RequestId>foo-id</RequestId>
</ErrorResponse>

""".data(using: .utf8)!))
""".data(using: .utf8)!)
) else {
XCTFail("Something is wrong with the created http response")
return
Expand Down Expand Up @@ -121,7 +121,7 @@ class RestXMLErrorTests: HttpResponseTestBase {
"Content-Type": "application/xml",
"X-Header": "Header"
],
content: HttpBody(byteStream: ByteStream.from(data:"""
content: ByteStream.data("""
<Error>
<Type>Sender</Type>
<Code>ComplexXMLErrorNoErrorWrapping</Code>
Expand All @@ -132,7 +132,7 @@ class RestXMLErrorTests: HttpResponseTestBase {
</Nested>
<RequestId>foo-id</RequestId>
</Error>
""".data(using: .utf8)!))
""".data(using: .utf8)!)
) else {
XCTFail("Something is wrong with the created http response")
return
Expand Down Expand Up @@ -173,15 +173,15 @@ class RestXMLErrorTests: HttpResponseTestBase {
"Content-Type": "application/xml",
"X-Header": "Header"
],
content: HttpBody(byteStream: ByteStream.from(data:"""
content: ByteStream.data("""
<?xml version="1.0" encoding="UTF-8"?>
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>abcdefg123456</RequestId>
<HostId>987654321abcdefg</HostId>
</Error>
""".data(using: .utf8)!))
""".data(using: .utf8)!)
) else {
XCTFail("Something is wrong with the created http response")
return
Expand Down
Loading