Skip to content

Commit 742c255

Browse files
committed
Fix the dynamodb integration tests
The new localstack version emulates AWS better, returning a consumed capacity only when the request asks for it.
1 parent 96e3dda commit 742c255

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Service/DynamoDb/tests/Integration/DynamoDbClientTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use AsyncAws\DynamoDb\DynamoDbClient;
88
use AsyncAws\DynamoDb\Enum\KeyType;
99
use AsyncAws\DynamoDb\Enum\ProjectionType;
10+
use AsyncAws\DynamoDb\Enum\ReturnConsumedCapacity;
1011
use AsyncAws\DynamoDb\Input\BatchGetItemInput;
1112
use AsyncAws\DynamoDb\Input\BatchWriteItemInput;
1213
use AsyncAws\DynamoDb\Input\CreateTableInput;
@@ -348,9 +349,11 @@ public function testPutItem(): void
348349
'Subject' => ['S' => 'How do I update multiple items?'],
349350
'LastPostedBy' => ['S' => 'fred@example.com'],
350351
],
352+
'ReturnConsumedCapacity' => ReturnConsumedCapacity::INDEXES,
351353
]);
352354

353355
$result = $client->putItem($input);
356+
self::assertNotNull($result->getConsumedCapacity());
354357
self::assertSame(1.0, $result->getConsumedCapacity()->getCapacityUnits());
355358
}
356359

0 commit comments

Comments
 (0)