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.103.1 (build bef2dea)", date="2024-09-24T10:56:41.772Z") @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 IApiCall awsApiCall(@NotNull String service, @NotNull String api, @Nullable Object parameters, @Nullable List<String> outputPaths)
      (experimental) Query AWS using JavaScript SDK 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

      The service is the name of an AWS service, in one of the following forms:

      • An AWS SDK for JavaScript v3 package name (@aws-sdk/client-api-gateway)
      • An AWS SDK for JavaScript v3 client name (api-gateway)
      • An AWS SDK for JavaScript v2 constructor name (APIGateway)
      • A lowercase AWS SDK for JavaScript v2 constructor name (apigateway)

      The api is the name of an AWS API call, in one of the following forms:

      • An API call name as found in the API Reference documentation (GetObject)
      • The API call name starting with a lowercase letter (getObject)
      • The AWS SDK for JavaScript v3 command class name (GetObjectCommand)

      Example:

       App app;
       IntegTest integ;
       integ.assertions.awsApiCall("SQS", "sendMessage", Map.of(
               "QueueUrl", "url",
               "MessageBody", "hello"));
       IApiCall 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 -
      outputPaths -
    • awsApiCall

      @Stability(Experimental) @NotNull IApiCall awsApiCall(@NotNull String service, @NotNull String api, @Nullable Object parameters)
      (experimental) Query AWS using JavaScript SDK 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

      The service is the name of an AWS service, in one of the following forms:

      • An AWS SDK for JavaScript v3 package name (@aws-sdk/client-api-gateway)
      • An AWS SDK for JavaScript v3 client name (api-gateway)
      • An AWS SDK for JavaScript v2 constructor name (APIGateway)
      • A lowercase AWS SDK for JavaScript v2 constructor name (apigateway)

      The api is the name of an AWS API call, in one of the following forms:

      • An API call name as found in the API Reference documentation (GetObject)
      • The API call name starting with a lowercase letter (getObject)
      • The AWS SDK for JavaScript v3 command class name (GetObjectCommand)

      Example:

       App app;
       IntegTest integ;
       integ.assertions.awsApiCall("SQS", "sendMessage", Map.of(
               "QueueUrl", "url",
               "MessageBody", "hello"));
       IApiCall 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 IApiCall awsApiCall(@NotNull String service, @NotNull String api)
      (experimental) Query AWS using JavaScript SDK 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

      The service is the name of an AWS service, in one of the following forms:

      • An AWS SDK for JavaScript v3 package name (@aws-sdk/client-api-gateway)
      • An AWS SDK for JavaScript v3 client name (api-gateway)
      • An AWS SDK for JavaScript v2 constructor name (APIGateway)
      • A lowercase AWS SDK for JavaScript v2 constructor name (apigateway)

      The api is the name of an AWS API call, in one of the following forms:

      • An API call name as found in the API Reference documentation (GetObject)
      • The API call name starting with a lowercase letter (getObject)
      • The AWS SDK for JavaScript v3 command class name (GetObjectCommand)

      Example:

       App app;
       IntegTest integ;
       integ.assertions.awsApiCall("SQS", "sendMessage", Map.of(
               "QueueUrl", "url",
               "MessageBody", "hello"));
       IApiCall 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.
    • httpApiCall

      @Stability(Experimental) @NotNull IApiCall httpApiCall(@NotNull String url, @Nullable FetchOptions options)
      (experimental) Make an HTTP call to the provided endpoint.

      Example:

       App app;
       IntegTest integ;
       IApiCall call = integ.assertions.httpApiCall("https://example.com/test");
       call.expect(ExpectedResult.objectLike(Map.of(
               "Message", "Hello World!")));
       

      Parameters:
      url - This parameter is required.
      options -
    • httpApiCall

      @Stability(Experimental) @NotNull IApiCall httpApiCall(@NotNull String url)
      (experimental) Make an HTTP call to the provided endpoint.

      Example:

       App app;
       IntegTest integ;
       IApiCall call = integ.assertions.httpApiCall("https://example.com/test");
       call.expect(ExpectedResult.objectLike(Map.of(
               "Message", "Hello World!")));
       

      Parameters:
      url - This parameter is required.
    • invokeFunction

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

      Example:

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

      Parameters:
      props - This parameter is required.