@Internal public static interface IAwsApiCall.Jsii$Default extends IAwsApiCall, IConstruct.Jsii$Default
IAwsApiCall.IAwsApiCall.Jsii$Default, IAwsApiCall.Jsii$Proxy| Modifier and Type | Method and Description |
|---|---|
default void |
assertAtPath(String path,
ExpectedResult expected)
(experimental) Assert that the ExpectedResult is equal to the result of the AwsApiCall at the given path.
|
default void |
expect(ExpectedResult expected)
(experimental) Assert that the ExpectedResult is equal to the result of the AwsApiCall.
|
default Reference |
getAtt(String attributeName)
(experimental) Returns the value of an attribute of the custom resource of an arbitrary type.
|
default String |
getAttString(String attributeName)
(experimental) Returns the value of an attribute of the custom resource of type string.
|
default ConstructNode |
getNode()
(experimental) The construct tree node for this construct.
|
@Stability(value=Experimental) @NotNull default ConstructNode getNode()
@Stability(value=Experimental)
default void assertAtPath(@NotNull
String path,
@NotNull
ExpectedResult expected)
For example the SQS.receiveMessage api response would look like:
If you wanted to assert the value of Body you could do
Example:
IntegTest integ;
Map<String, Map<String, Object>[]> actual = Map.of(
"Messages", List.of(Map.of(
"MessageId", "",
"ReceiptHandle", "",
"MD5OfBody", "",
"Body", "hello",
"Attributes", Map.of(),
"MD5OfMessageAttributes", Map.of(),
"MessageAttributes", Map.of())));
IAwsApiCall message = integ.assertions.awsApiCall("SQS", "receiveMessage");
message.assertAtPath("Messages.0.Body", ExpectedResult.stringLikeRegexp("hello"));
assertAtPath in interface IAwsApiCallpath - This parameter is required.expected - This parameter is required.@Stability(value=Experimental)
default void expect(@NotNull
ExpectedResult expected)
Example:
IntegTest integ;
IAwsApiCall invoke = integ.assertions.invokeFunction(LambdaInvokeFunctionProps.builder()
.functionName("my-func")
.build());
invoke.expect(ExpectedResult.objectLike(Map.of("Payload", "OK")));
expect in interface IAwsApiCallexpected - This parameter is required.@Stability(value=Experimental) @NotNull default Reference getAtt(@NotNull String attributeName)
Attributes are returned from the custom resource provider through the
Data map where the key is the attribute name.
getAtt in interface IAwsApiCallattributeName - the name of the attribute. This parameter is required.@Stability(value=Experimental) @NotNull default String getAttString(@NotNull String attributeName)
Attributes are returned from the custom resource provider through the
Data map where the key is the attribute name.
getAttString in interface IAwsApiCallattributeName - the name of the attribute. This parameter is required.Copyright © 2022. All rights reserved.