Class ExpectedResult
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.integtests.alpha.ExpectedResult
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)",
date="2024-08-15T01:32:56.821Z")
@Stability(Experimental)
public abstract class ExpectedResult
extends software.amazon.jsii.JsiiObject
(experimental) Represents the "expected" results to compare.
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")))));
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
protected
ExpectedResult
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
ExpectedResult
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionstatic ExpectedResult
(experimental) The actual results must be a list and must contain an item with the expected results.static ExpectedResult
(experimental) The actual results must match exactly.abstract String
(experimental) The expected results encoded as a string.static ExpectedResult
objectLike
(Map<String, ? extends Object> expected) (experimental) The expected results must be a subset of the actual results.abstract void
(experimental) The expected results encoded as a string.static ExpectedResult
stringLikeRegexp
(String expected) (experimental) Actual results is a string that matches the Expected result regex.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
-
ExpectedResult
protected ExpectedResult(software.amazon.jsii.JsiiObjectRef objRef) -
ExpectedResult
protected ExpectedResult(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
ExpectedResult
@Stability(Experimental) protected ExpectedResult()
-
-
Method Details
-
arrayWith
@Stability(Experimental) @NotNull public static ExpectedResult arrayWith(@NotNull List<? extends Object> expected) (experimental) The actual results must be a list and must contain an item with the expected results.Example:
// actual results Map<String, String>[] actual = List.of(Map.of( "stringParam", "hello"), Map.of( "stringParam", "world")); // pass ExpectedResult.arrayWith(List.of(Map.of( "stringParam", "hello")));
- Parameters:
expected
- This parameter is required.- See Also:
-
exact
(experimental) The actual results must match exactly.Missing data will result in a failure
Example:
// actual results Map<String, Object> actual = Map.of( "stringParam", "hello", "numberParam", 3, "booleanParam", true); // pass ExpectedResult.exact(Map.of( "stringParam", "hello", "numberParam", 3, "booleanParam", true)); // fail ExpectedResult.exact(Map.of( "stringParam", "hello"));
- Parameters:
expected
- This parameter is required.- See Also:
-
objectLike
@Stability(Experimental) @NotNull public static ExpectedResult objectLike(@NotNull Map<String, ? extends Object> expected) (experimental) The expected results must be a subset of the actual results.Example:
// actual results Map<String, Object> actual = Map.of( "stringParam", "hello", "numberParam", 3, "booleanParam", true, "objectParam", Map.of("prop1", "value", "prop2", "value")); // pass ExpectedResult.objectLike(Map.of( "stringParam", "hello", "objectParam", Map.of("prop1", "value")));
- Parameters:
expected
- This parameter is required.- See Also:
-
stringLikeRegexp
@Stability(Experimental) @NotNull public static ExpectedResult stringLikeRegexp(@NotNull String expected) (experimental) Actual results is a string that matches the Expected result regex.Example:
// actual results String actual = "some string value"; // pass ExpectedResult.stringLikeRegexp("value");
- Parameters:
expected
- This parameter is required.- See Also:
-
getResult
(experimental) The expected results encoded as a string. -
setResult
(experimental) The expected results encoded as a string.
-