Skip to content

Commit f0368a5

Browse files
authored
Add integration tests on DynamoDbClient::tableNotExsits (#343)
1 parent 50d1076 commit f0368a5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/Unit/Exception/Http/ClientExceptionTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,15 @@ public function testRestXmlError()
3838
self::assertEquals('NoSuchKey', $exception->getAwsCode());
3939
self::assertEquals('The specified key does not exist.', $exception->getAwsMessage());
4040
}
41+
42+
public function testDynamoDbError()
43+
{
44+
$json = '{"__type":"com.amazonaws.dynamodb.v20120810#ResourceNotFoundException","message":"Requested resource not found: Table: tablename not found"}';
45+
$response = new SimpleMockedResponse($json, ['content-type' => 'application/x-amz-json-1.0'], 400);
46+
$exception = new ClientException($response);
47+
48+
self::assertSame(400, $exception->getCode());
49+
self::assertSame('ResourceNotFoundException', $exception->getAwsCode());
50+
self::assertSame('Requested resource not found: Table: tablename not found', $exception->getAwsMessage());
51+
}
4152
}

0 commit comments

Comments
 (0)