@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:35.963Z") @Stability(value=Stable) public abstract class Matcher extends software.amazon.jsii.JsiiObject
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")))));
| Modifier | Constructor and Description |
|---|---|
protected |
Matcher() |
protected |
Matcher(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Matcher(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
abstract String |
getName()
A name for the matcher.
|
static Boolean |
isMatcher(Object x)
Check whether the provided object is a subtype of the `IMatcher`.
|
abstract MatchResult |
test(Object actual)
Test whether a target matches the provided pattern.
|
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected Matcher(software.amazon.jsii.JsiiObjectRef objRef)
protected Matcher(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable) protected Matcher()
@Stability(value=Stable) @NotNull public static Boolean isMatcher(@NotNull Object x)
x - This parameter is required.@Stability(value=Stable) @NotNull public abstract MatchResult test(@NotNull Object actual)
Every Matcher must implement this method. This method will be invoked by the assertions framework. Do not call this method directly.
actual - the target to match. This parameter is required.@Stability(value=Stable) @NotNull public abstract String getName()
This is collected as part of the result and may be presented to the user.
Copyright © 2022. All rights reserved.