Skip to content

Commit

Permalink
test(aws-protocoltests-json-10): remove Json10WithQueryCompatibleGree…
Browse files Browse the repository at this point in the history
…tingError (#3997)
  • Loading branch information
trivikr committed Sep 28, 2022
1 parent 02e47f1 commit 7cdbd11
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 47 deletions.
Expand Up @@ -317,9 +317,8 @@ private static boolean filterProtocolTests(
HttpMessageTestCase testCase,
TypeScriptSettings settings
) {
// TODO: Consume AWSQueryError trait as a follow-up in JS-2681.
if (testCase.getId().equals("QueryCustomizedError")
|| testCase.getId().equals("Json10WithQueryCompatibleGreetingError")) {
// TODO: Consume AWSQueryError trait as a follow-up.
if (testCase.getId().equals("QueryCustomizedError")) {
return true;
}

Expand Down
Expand Up @@ -276,50 +276,6 @@ it("AwsJson10EndpointTraitWithHostLabel:Request", async () => {
}
});

/**
* @awsQueryCompatible trait is applied to service
*/
it.skip("Json10WithQueryCompatibleGreetingError:Error:GreetingWithErrors", async () => {
const client = new JSONRPC10Client({
...clientParams,
requestHandler: new ResponseDeserializationTestHandler(
false,
402,
{
"x-amzn-query-error": "CustomGreetingErrorCode;Sender",
"content-type": "application/x-amz-json-1.0",
},
`{"__type": "InvalidGreetingError","Message": "Hi"}`
),
});

const params: any = {};
const command = new GreetingWithErrorsCommand(params);

try {
await client.send(command);
} catch (err) {
if (err.name !== "InvalidGreeting") {
console.log(err);
fail(`Expected a InvalidGreeting to be thrown, got ${err.name} instead`);
return;
}
const r: any = err;
expect(r["$metadata"].httpStatusCode).toBe(402);
const paramsToValidate: any = [
{
message: "Hi",
},
][0];
Object.keys(paramsToValidate).forEach((param) => {
expect(r[param]).toBeDefined();
expect(equivalentContents(r[param], paramsToValidate[param])).toBe(true);
});
return;
}
fail("Expected an exception to be thrown from response");
});

/**
* Parses simple JSON errors
*/
Expand Down

0 comments on commit 7cdbd11

Please sign in to comment.