Class ExpectedResult

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.integtests.ExpectedResult
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:36.696Z") @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"));
 IAwsApiCall 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

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

    Modifier and Type
    Method
    Description
    arrayWith(List<? extends Object> expected)
    (experimental) The actual results must be a list and must contain an item with the expected results.
    exact(Object expected)
    (experimental) The actual results must match exactly.
    abstract String
    (experimental) The expected results encoded as a string.
    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.
    (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.
    • exact

      @Stability(Experimental) @NotNull public static ExpectedResult exact(@NotNull Object expected)
      (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.
    • 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);
       // pass
       ExpectedResult.objectLike(Map.of(
               "stringParam", "hello"));
       

      Parameters:
      expected - This parameter is required.
    • 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.
    • getResult

      @Stability(Experimental) @NotNull public abstract String getResult()
      (experimental) The expected results encoded as a string.
    • setResult

      @Stability(Experimental) public abstract void setResult(@NotNull String value)
      (experimental) The expected results encoded as a string.