Class MatchResult

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

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-22T02:23:55.906Z") @Stability(Stable) public class MatchResult extends software.amazon.jsii.JsiiObject
The result of Match.test().

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.assertions.*;
 Object target;
 MatchResult matchResult = new MatchResult(target);
 
  • Constructor Details

    • MatchResult

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

      protected MatchResult(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • MatchResult

      @Stability(Stable) public MatchResult(@NotNull Object target)
      Parameters:
      target - This parameter is required.
  • Method Details

    • compose

      @Stability(Stable) @NotNull public MatchResult compose(@NotNull String id, @NotNull MatchResult inner)
      Compose the results of a previous match as a subtree.

      Parameters:
      id - the id of the parent tree. This parameter is required.
      inner - This parameter is required.
    • finished

      @Stability(Stable) @NotNull public MatchResult finished()
      Prepare the result to be analyzed.

      This API must be called prior to analyzing these results.

    • hasFailed

      @Stability(Stable) @NotNull public Boolean hasFailed()
      Does the result contain any failures.

      If not, the result is a success

    • push

      @Stability(Deprecated) @Deprecated @NotNull public MatchResult push(@NotNull Matcher matcher, @NotNull List<String> path, @NotNull String message)
      Deprecated.
      use recordFailure()
      (deprecated) DEPRECATED.

      Parameters:
      matcher - This parameter is required.
      path - This parameter is required.
      message - This parameter is required.
    • recordCapture

      @Stability(Stable) public void recordCapture(@NotNull MatchCapture options)
      Record a capture against in this match result.

      Parameters:
      options - This parameter is required.
    • recordFailure

      @Stability(Stable) @NotNull public MatchResult recordFailure(@NotNull MatchFailure failure)
      Record a new failure into this result at a specific path.

      Parameters:
      failure - This parameter is required.
    • renderMismatch

      @Stability(Stable) @NotNull public String renderMismatch()
      Do a deep render of the match result, showing the structure mismatches in context.
    • toHumanStrings

      @Stability(Stable) @NotNull public List<String> toHumanStrings()
      Render the failed match in a presentable way.

      Prefer using renderMismatch over this method. It is left for backwards compatibility for test suites that expect it, but renderMismatch() will produce better output.

    • getFailCost

      @Stability(Stable) @NotNull public Number getFailCost()
      The cost of the failures so far.
    • getFailCount

      @Stability(Stable) @NotNull public Number getFailCount()
      The number of failures.
    • getIsSuccess

      @Stability(Stable) @NotNull public Boolean getIsSuccess()
      Whether the match is a success.
    • getTarget

      @Stability(Stable) @NotNull public Object getTarget()
      The target for which this result was generated.