Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Tietew committed Feb 28, 2025
1 parent 03b08fa commit 33d406c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/aws-cdk/test/context-providers/cc-api-provider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,22 @@ test('looks up RDS instance using CC API listResources - nested prop', async ()
expect(results.length).toEqual(1);
});

test('looks up RDS instance using CC API listResources - error in CC API', async () => {
// GIVEN
mockCloudControlClient.on(ListResourcesCommand).rejects('No data found');

await expect(
// WHEN
provider.getValue({
account: '123456789012',
region: 'us-east-1',
typeName: 'AWS::RDS::DBInstance',
propertyMatch: { 'Endpoint.Port': '5432' },
propertiesToReturn: ['DBInstanceArn', 'StorageEncrypted'],
}),
).rejects.toThrow('Could not get resources {"Endpoint.Port":"5432"}.'); // THEN
});

test('error by specifying both exactIdentifier and propertyMatch', async () => {
// GIVEN
mockCloudControlClient.on(GetResourceCommand).resolves({
Expand Down

0 comments on commit 33d406c

Please sign in to comment.