Skip to content

Commit

Permalink
chore: skip SubscriptionRequired exceptions (#3012)
Browse files Browse the repository at this point in the history
  • Loading branch information
yenfryherrerafeliz authored Oct 9, 2024
1 parent e66ee02 commit 4ce4bf0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion features/smoke/marketplacecommerceanalytics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ Feature: AWS Marketplace Commerce Analytics
| roleNameArn | fake-arn |
| destinationS3BucketName | fake-bucket |
| snsTopicArn | fake-arn |
Then I expect the response error code to be "SerializationException"
Then I expect the marketplace commerce analytics response error code to be "SerializationException"
26 changes: 17 additions & 9 deletions tests/Integ/SmokeContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,7 @@ public static function setUpMarketplaceCommerceAnalytics(BeforeFeatureScope $sco
'destinationS3BucketName' => 'fake-bucket',
'snsTopicArn' => 'fake-arn',
]);
} catch (\Exception $e) {
// If the test failed because the account has no support subscription,
// throw the exception to cause the feature to be skipped.
if ($e instanceof AwsException
&& 'SubscriptionRequiredException' === $e->getAwsErrorCode()
) {
throw $e;
}
}
} catch (\Exception $e) {}
}

/**
Expand Down Expand Up @@ -366,6 +358,22 @@ public function iExpectTheResponseErrorCodeToBe($errorCode)
$this->assertSame($errorCode, $this->error->getAwsErrorCode());
}

/**
* @Then I expect the marketplace commerce analytics response error code to be :errorCode
*
* @param string $errorCode
*/
public function iExpectTheMarketplaceCommerceAnalyticsErrorCodeToBe($errorCode)
{
if ($this->error->getAwsErrorCode() === 'SubscriptionRequiredException') {
// For skipping subscription required exceptions
$this->assertTrue(true);
return;
}

$this->assertSame($errorCode, $this->error->getAwsErrorCode());
}

/**
* @Then I expect the response error message to include:
*
Expand Down

0 comments on commit 4ce4bf0

Please sign in to comment.