Class: AWSCDK::Assertions::Annotations
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::Assertions::Annotations
- Defined in:
- assertions/annotations.rb
Overview
Suite of assertions that can be run on a CDK Stack.
Focused on asserting annotations.
Class Method Summary collapse
-
.from_stack(stack) ⇒ AWSCDK::Assertions::Annotations
Base your assertions on the messages returned by a synthesized CDK
Stack. - .jsii_overridable_methods ⇒ Object
Instance Method Summary collapse
-
#find_error(construct_path, message) ⇒ Array<AWSCDK::CXAPI::SynthesisMessage>
Get the set of matching errors of a given construct path and message.
-
#find_info(construct_path, message) ⇒ Array<AWSCDK::CXAPI::SynthesisMessage>
Get the set of matching infos of a given construct path and message.
-
#find_warning(construct_path, message) ⇒ Array<AWSCDK::CXAPI::SynthesisMessage>
Get the set of matching warning of a given construct path and message.
-
#has_error(construct_path, message) ⇒ void
Assert that an error with the given message exists in the synthesized CDK
Stack. -
#has_info(construct_path, message) ⇒ void
Assert that an info with the given message exists in the synthesized CDK
Stack. -
#has_no_error(construct_path, message) ⇒ void
Assert that an error with the given message does not exist in the synthesized CDK
Stack. -
#has_no_info(construct_path, message) ⇒ void
Assert that an info with the given message does not exist in the synthesized CDK
Stack. -
#has_no_warning(construct_path, message) ⇒ void
Assert that a warning with the given message does not exist in the synthesized CDK
Stack. -
#has_warning(construct_path, message) ⇒ void
Assert that a warning with the given message exists in the synthesized CDK
Stack. -
#initialize(*args) ⇒ Annotations
constructor
A new instance of Annotations.
Constructor Details
#initialize(*args) ⇒ Annotations
Returns a new instance of Annotations.
10 11 12 |
# File 'assertions/annotations.rb', line 10 def initialize(*args) raise NoMethodError, "aws-cdk-lib.assertions.Annotations does not have a visible constructor; use the provided factory methods" end |
Class Method Details
.from_stack(stack) ⇒ AWSCDK::Assertions::Annotations
Base your assertions on the messages returned by a synthesized CDK Stack.
32 33 34 35 |
# File 'assertions/annotations.rb', line 32 def self.from_stack(stack) Jsii::Type.check_type(stack, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5TdGFjayJ9")), "stack") Jsii::Kernel.instance.call_static("aws-cdk-lib.assertions.Annotations", "fromStack", [stack]) end |
.jsii_overridable_methods ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'assertions/annotations.rb', line 14 def self.jsii_overridable_methods { :find_error => { kind: :method, name: "findError", is_optional: false }, :find_info => { kind: :method, name: "findInfo", is_optional: false }, :find_warning => { kind: :method, name: "findWarning", is_optional: false }, :has_error => { kind: :method, name: "hasError", is_optional: false }, :has_info => { kind: :method, name: "hasInfo", is_optional: false }, :has_no_error => { kind: :method, name: "hasNoError", is_optional: false }, :has_no_info => { kind: :method, name: "hasNoInfo", is_optional: false }, :has_no_warning => { kind: :method, name: "hasNoWarning", is_optional: false }, :has_warning => { kind: :method, name: "hasWarning", is_optional: false }, } end |
Instance Method Details
#find_error(construct_path, message) ⇒ Array<AWSCDK::CXAPI::SynthesisMessage>
Get the set of matching errors of a given construct path and message.
42 43 44 45 46 |
# File 'assertions/annotations.rb', line 42 def find_error(construct_path, ) Jsii::Type.check_type(construct_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "constructPath") Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "message") jsii_call_method("findError", [construct_path, ]) end |
#find_info(construct_path, message) ⇒ Array<AWSCDK::CXAPI::SynthesisMessage>
Get the set of matching infos of a given construct path and message.
53 54 55 56 57 |
# File 'assertions/annotations.rb', line 53 def find_info(construct_path, ) Jsii::Type.check_type(construct_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "constructPath") Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "message") jsii_call_method("findInfo", [construct_path, ]) end |
#find_warning(construct_path, message) ⇒ Array<AWSCDK::CXAPI::SynthesisMessage>
Get the set of matching warning of a given construct path and message.
64 65 66 67 68 |
# File 'assertions/annotations.rb', line 64 def find_warning(construct_path, ) Jsii::Type.check_type(construct_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "constructPath") Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "message") jsii_call_method("findWarning", [construct_path, ]) end |
#has_error(construct_path, message) ⇒ void
This method returns an undefined value.
Assert that an error with the given message exists in the synthesized CDK Stack.
75 76 77 78 79 |
# File 'assertions/annotations.rb', line 75 def has_error(construct_path, ) Jsii::Type.check_type(construct_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "constructPath") Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "message") jsii_call_method("hasError", [construct_path, ]) end |
#has_info(construct_path, message) ⇒ void
This method returns an undefined value.
Assert that an info with the given message exists in the synthesized CDK Stack.
86 87 88 89 90 |
# File 'assertions/annotations.rb', line 86 def has_info(construct_path, ) Jsii::Type.check_type(construct_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "constructPath") Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "message") jsii_call_method("hasInfo", [construct_path, ]) end |
#has_no_error(construct_path, message) ⇒ void
This method returns an undefined value.
Assert that an error with the given message does not exist in the synthesized CDK Stack.
97 98 99 100 101 |
# File 'assertions/annotations.rb', line 97 def has_no_error(construct_path, ) Jsii::Type.check_type(construct_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "constructPath") Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "message") jsii_call_method("hasNoError", [construct_path, ]) end |
#has_no_info(construct_path, message) ⇒ void
This method returns an undefined value.
Assert that an info with the given message does not exist in the synthesized CDK Stack.
108 109 110 111 112 |
# File 'assertions/annotations.rb', line 108 def has_no_info(construct_path, ) Jsii::Type.check_type(construct_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "constructPath") Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "message") jsii_call_method("hasNoInfo", [construct_path, ]) end |
#has_no_warning(construct_path, message) ⇒ void
This method returns an undefined value.
Assert that a warning with the given message does not exist in the synthesized CDK Stack.
119 120 121 122 123 |
# File 'assertions/annotations.rb', line 119 def has_no_warning(construct_path, ) Jsii::Type.check_type(construct_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "constructPath") Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "message") jsii_call_method("hasNoWarning", [construct_path, ]) end |
#has_warning(construct_path, message) ⇒ void
This method returns an undefined value.
Assert that a warning with the given message exists in the synthesized CDK Stack.
130 131 132 133 134 |
# File 'assertions/annotations.rb', line 130 def has_warning(construct_path, ) Jsii::Type.check_type(construct_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "constructPath") Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "message") jsii_call_method("hasWarning", [construct_path, ]) end |