Class Matcher
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.assertions.Matcher
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
- Direct Known Subclasses:
Capture
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:29:55.199Z")
@Stability(Stable)
public abstract class Matcher
extends software.amazon.jsii.JsiiObject
Represents a matcher that can perform special data matching capabilities between a given pattern and a target.
Example:
// Given a template - // { // "Resources": { // "MyBar": { // "Type": "Foo::Bar", // "Properties": { // "Fred": ["Flob", "Cat"] // } // } // } // } // The following will NOT throw an assertion error template.hasResourceProperties("Foo::Bar", Map.of( "Fred", Match.arrayWith(List.of("Flob")))); // The following will throw an assertion error template.hasResourceProperties("Foo::Bar", Match.objectLike(Map.of( "Fred", Match.arrayWith(List.of("Wobble")))));
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
-
Constructor Summary
-
Method Summary
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
-
Matcher
protected Matcher(software.amazon.jsii.JsiiObjectRef objRef) -
Matcher
protected Matcher(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
Matcher
@Stability(Stable) protected Matcher()
-
-
Method Details
-
isMatcher
Check whether the provided object is a subtype of theIMatcher
.- Parameters:
x
- This parameter is required.
-
test
Test whether a target matches the provided pattern.Every Matcher must implement this method. This method will be invoked by the assertions framework. Do not call this method directly.
- Parameters:
actual
- the target to match. This parameter is required.- Returns:
- the list of match failures. An empty array denotes a successful match.
-
getName
A name for the matcher.This is collected as part of the result and may be presented to the user.
-