Skip to content

Commit

Permalink
Remove fixes for some now not broken request tests
Browse files Browse the repository at this point in the history
The fixes were upstreamed in
smithy-lang/smithy#1040, which was rolled out long
ago in Smithy v1.18, 10 months ago.
  • Loading branch information
david-perez committed Jan 4, 2023
1 parent 0ab5493 commit 90a7f1a
Showing 1 changed file with 2 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1057,67 +1057,6 @@ class ServerProtocolTestGenerator(
// or because they are flaky
private val DisableTests = setOf<String>()

private fun fixRestJsonSupportsNaNFloatQueryValues(
testCase: HttpRequestTestCase,
@Suppress("UNUSED_PARAMETER")
operationShape: OperationShape,
): HttpRequestTestCase {
val params = Node.parse(
"""
{
"queryFloat": "NaN",
"queryDouble": "NaN",
"queryParamsMapOfStringList": {
"Float": ["NaN"],
"Double": ["NaN"]
}
}
""".trimIndent(),
).asObjectNode().get()

return testCase.toBuilder().params(params).build()
}

private fun fixRestJsonSupportsInfinityFloatQueryValues(
testCase: HttpRequestTestCase,
@Suppress("UNUSED_PARAMETER")
operationShape: OperationShape,
): HttpRequestTestCase =
testCase.toBuilder().params(
Node.parse(
"""
{
"queryFloat": "Infinity",
"queryDouble": "Infinity",
"queryParamsMapOfStringList": {
"Float": ["Infinity"],
"Double": ["Infinity"]
}
}
""".trimMargin(),
).asObjectNode().get(),
).build()

private fun fixRestJsonSupportsNegativeInfinityFloatQueryValues(
testCase: HttpRequestTestCase,
@Suppress("UNUSED_PARAMETER")
operationShape: OperationShape,
): HttpRequestTestCase =
testCase.toBuilder().params(
Node.parse(
"""
{
"queryFloat": "-Infinity",
"queryDouble": "-Infinity",
"queryParamsMapOfStringList": {
"Float": ["-Infinity"],
"Double": ["-Infinity"]
}
}
""".trimMargin(),
).asObjectNode().get(),
).build()

private fun fixRestJsonAllQueryStringTypes(
testCase: HttpRequestTestCase,
@Suppress("UNUSED_PARAMETER")
Expand Down Expand Up @@ -1226,14 +1165,9 @@ class ServerProtocolTestGenerator(
// This is because they have not been written from a server perspective, and as such the expected `params` field is incomplete.
// TODO(https://github.com/awslabs/smithy-rs/issues/1288): Contribute a PR to fix them upstream.
private val BrokenRequestTests = mapOf(
// https://github.com/awslabs/smithy/pull/1040
Pair(RestJson, "RestJsonSupportsNaNFloatQueryValues") to ::fixRestJsonSupportsNaNFloatQueryValues,
Pair(RestJson, "RestJsonSupportsInfinityFloatQueryValues") to ::fixRestJsonSupportsInfinityFloatQueryValues,
Pair(
RestJson,
"RestJsonSupportsNegativeInfinityFloatQueryValues",
) to ::fixRestJsonSupportsNegativeInfinityFloatQueryValues,
// TODO(https://github.com/awslabs/smithy/pull/1564)
Pair(RestJson, "RestJsonAllQueryStringTypes") to ::fixRestJsonAllQueryStringTypes,
// TODO(https://github.com/awslabs/smithy/pull/1562)
Pair(RestJson, "RestJsonQueryStringEscaping") to ::fixRestJsonQueryStringEscaping,

// https://github.com/awslabs/smithy/pull/1392
Expand Down

0 comments on commit 90a7f1a

Please sign in to comment.