Class Annotations

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.assertions.Annotations
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.95.0 (build f1ff514)", date="2024-03-26T18:09:18.575Z") @Stability(Stable) public class Annotations extends software.amazon.jsii.JsiiObject
Suite of assertions that can be run on a CDK Stack.

Focused on asserting annotations.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.*;
 import software.amazon.awscdk.assertions.*;
 Stack stack;
 Annotations annotations = Annotations.fromStack(stack);
 
  • Nested Class Summary

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Annotations(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    Annotations(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    findError(String constructPath, Object message)
    Get the set of matching errors of a given construct path and message.
    findInfo(String constructPath, Object message)
    Get the set of matching infos of a given construct path and message.
    findWarning(String constructPath, Object message)
    Get the set of matching warning of a given construct path and message.
    Base your assertions on the messages returned by a synthesized CDK Stack.
    void
    hasError(String constructPath, Object message)
    Assert that an error with the given message exists in the synthesized CDK Stack.
    void
    hasInfo(String constructPath, Object message)
    Assert that an info with the given message exists in the synthesized CDK Stack.
    void
    hasNoError(String constructPath, Object message)
    Assert that an error with the given message does not exist in the synthesized CDK Stack.
    void
    hasNoInfo(String constructPath, Object message)
    Assert that an info with the given message does not exist in the synthesized CDK Stack.
    void
    hasNoWarning(String constructPath, Object message)
    Assert that an warning with the given message does not exist in the synthesized CDK Stack.
    void
    hasWarning(String constructPath, Object message)
    Assert that an warning with the given message exists in the synthesized CDK Stack.

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Constructor Details

    • Annotations

      protected Annotations(software.amazon.jsii.JsiiObjectRef objRef)
    • Annotations

      protected Annotations(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
  • Method Details

    • fromStack

      @Stability(Stable) @NotNull public static Annotations fromStack(@NotNull Stack stack)
      Base your assertions on the messages returned by a synthesized CDK Stack.

      Parameters:
      stack - the CDK Stack to run assertions on. This parameter is required.
    • findError

      @Stability(Stable) @NotNull public List<SynthesisMessage> findError(@NotNull String constructPath, @NotNull Object message)
      Get the set of matching errors of a given construct path and message.

      Parameters:
      constructPath - the construct path to the error. This parameter is required.
      message - the error message as should be expected. This parameter is required.
    • findInfo

      @Stability(Stable) @NotNull public List<SynthesisMessage> findInfo(@NotNull String constructPath, @NotNull Object message)
      Get the set of matching infos of a given construct path and message.

      Parameters:
      constructPath - the construct path to the info. This parameter is required.
      message - the info message as should be expected. This parameter is required.
    • findWarning

      @Stability(Stable) @NotNull public List<SynthesisMessage> findWarning(@NotNull String constructPath, @NotNull Object message)
      Get the set of matching warning of a given construct path and message.

      Parameters:
      constructPath - the construct path to the warning. This parameter is required.
      message - the warning message as should be expected. This parameter is required.
    • hasError

      @Stability(Stable) public void hasError(@NotNull String constructPath, @NotNull Object message)
      Assert that an error with the given message exists in the synthesized CDK Stack.

      Parameters:
      constructPath - the construct path to the error. This parameter is required.
      message - the error message as should be expected. This parameter is required.
    • hasInfo

      @Stability(Stable) public void hasInfo(@NotNull String constructPath, @NotNull Object message)
      Assert that an info with the given message exists in the synthesized CDK Stack.

      Parameters:
      constructPath - the construct path to the info. This parameter is required.
      message - the info message as should be expected. This parameter is required.
    • hasNoError

      @Stability(Stable) public void hasNoError(@NotNull String constructPath, @NotNull Object message)
      Assert that an error with the given message does not exist in the synthesized CDK Stack.

      Parameters:
      constructPath - the construct path to the error. This parameter is required.
      message - the error message as should be expected. This parameter is required.
    • hasNoInfo

      @Stability(Stable) public void hasNoInfo(@NotNull String constructPath, @NotNull Object message)
      Assert that an info with the given message does not exist in the synthesized CDK Stack.

      Parameters:
      constructPath - the construct path to the info. This parameter is required.
      message - the info message as should be expected. This parameter is required.
    • hasNoWarning

      @Stability(Stable) public void hasNoWarning(@NotNull String constructPath, @NotNull Object message)
      Assert that an warning with the given message does not exist in the synthesized CDK Stack.

      Parameters:
      constructPath - the construct path to the warning. This parameter is required.
      message - the warning message as should be expected. This parameter is required.
    • hasWarning

      @Stability(Stable) public void hasWarning(@NotNull String constructPath, @NotNull Object message)
      Assert that an warning with the given message exists in the synthesized CDK Stack.

      Parameters:
      constructPath - the construct path to the warning. This parameter is required.
      message - the warning message as should be expected. This parameter is required.