Interface IDeployAssert

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Subinterfaces:
IDeployAssert.Jsii$Default
All Known Implementing Classes:
IDeployAssert.Jsii$Proxy

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:36.703Z") @Stability(Experimental) public interface IDeployAssert extends software.amazon.jsii.JsiiSerializable
(experimental) Interface that allows for registering a list of assertions that should be performed on a construct.

This is only necessary when writing integration tests.

  • Method Details

    • awsApiCall

      @Stability(Experimental) @NotNull IAwsApiCall awsApiCall(@NotNull String service, @NotNull String api, @Nullable Object parameters)
      (experimental) Query AWS using JavaScript SDK V2 API calls.

      This can be used to either trigger an action or to return a result that can then be asserted against an expected value

      Example:

       App app;
       IntegTest integ;
       integ.assertions.awsApiCall("SQS", "sendMessage", Map.of(
               "QueueUrl", "url",
               "MessageBody", "hello"));
       IAwsApiCall message = integ.assertions.awsApiCall("SQS", "receiveMessage", Map.of(
               "QueueUrl", "url"));
       message.expect(ExpectedResult.objectLike(Map.of(
               "Messages", List.of(Map.of("Body", "hello")))));
       

      Parameters:
      service - This parameter is required.
      api - This parameter is required.
      parameters -
    • awsApiCall

      @Stability(Experimental) @NotNull IAwsApiCall awsApiCall(@NotNull String service, @NotNull String api)
      (experimental) Query AWS using JavaScript SDK V2 API calls.

      This can be used to either trigger an action or to return a result that can then be asserted against an expected value

      Example:

       App app;
       IntegTest integ;
       integ.assertions.awsApiCall("SQS", "sendMessage", Map.of(
               "QueueUrl", "url",
               "MessageBody", "hello"));
       IAwsApiCall message = integ.assertions.awsApiCall("SQS", "receiveMessage", Map.of(
               "QueueUrl", "url"));
       message.expect(ExpectedResult.objectLike(Map.of(
               "Messages", List.of(Map.of("Body", "hello")))));
       

      Parameters:
      service - This parameter is required.
      api - This parameter is required.
    • expect

      @Stability(Experimental) void expect(@NotNull String id, @NotNull ExpectedResult expected, @NotNull ActualResult actual)
      (experimental) Assert that the ExpectedResult is equal to the ActualResult.

      Example:

       IntegTest integ;
       AwsApiCall apiCall;
       integ.assertions.expect("invoke", ExpectedResult.objectLike(Map.of("Payload", "OK")), ActualResult.fromAwsApiCall(apiCall, "Body"));
       

      Parameters:
      id - This parameter is required.
      expected - This parameter is required.
      actual - This parameter is required.
    • invokeFunction

      @Stability(Experimental) @NotNull IAwsApiCall invokeFunction(@NotNull LambdaInvokeFunctionProps props)
      (experimental) Invoke a lambda function and return the response which can be asserted.

      Example:

       App app;
       IntegTest integ;
       IAwsApiCall invoke = integ.assertions.invokeFunction(LambdaInvokeFunctionProps.builder()
               .functionName("my-function")
               .build());
       invoke.expect(ExpectedResult.objectLike(Map.of(
               "Payload", "200")));
       

      Parameters:
      props - This parameter is required.