software.amazon.awscdk.integtests.alpha.ExpectedResult Maven / Gradle / Ivy
Show all versions of cdk-integ-tests-alpha Show documentation
package software.amazon.awscdk.integtests.alpha;
/**
* (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")))));
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-19T18:12:09.661Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.integtests.alpha.$Module.class, fqn = "@aws-cdk/integ-tests-alpha.ExpectedResult")
public abstract class ExpectedResult extends software.amazon.jsii.JsiiObject {
protected ExpectedResult(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected ExpectedResult(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
protected ExpectedResult() {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this);
}
/**
* (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")));
*
*
* @see https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.assertions.Match.html#static-arraywbrwithpattern
* @param expected This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static @org.jetbrains.annotations.NotNull software.amazon.awscdk.integtests.alpha.ExpectedResult arrayWith(final @org.jetbrains.annotations.NotNull java.util.List extends java.lang.Object> expected) {
return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.integtests.alpha.ExpectedResult.class, "arrayWith", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.integtests.alpha.ExpectedResult.class), new Object[] { java.util.Objects.requireNonNull(expected, "expected is required") });
}
/**
* (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"));
*
*
* @see https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.assertions.Match.html#static-exactpattern
* @param expected This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static @org.jetbrains.annotations.NotNull software.amazon.awscdk.integtests.alpha.ExpectedResult exact(final @org.jetbrains.annotations.NotNull java.lang.Object expected) {
return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.integtests.alpha.ExpectedResult.class, "exact", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.integtests.alpha.ExpectedResult.class), new 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")));
*
*
* @see https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.assertions.Match.html#static-objectwbrlikepattern
* @param expected This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static @org.jetbrains.annotations.NotNull software.amazon.awscdk.integtests.alpha.ExpectedResult objectLike(final @org.jetbrains.annotations.NotNull java.util.Map expected) {
return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.integtests.alpha.ExpectedResult.class, "objectLike", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.integtests.alpha.ExpectedResult.class), new Object[] { java.util.Objects.requireNonNull(expected, "expected is required") });
}
/**
* (experimental) Actual results is a string that matches the Expected result regex.
*
* Example:
*
*
* // actual results
* String actual = "some string value";
* // pass
* ExpectedResult.stringLikeRegexp("value");
*
*
* @see https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.assertions.Match.html#static-stringwbrlikewbrregexppattern
* @param expected This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static @org.jetbrains.annotations.NotNull software.amazon.awscdk.integtests.alpha.ExpectedResult stringLikeRegexp(final @org.jetbrains.annotations.NotNull java.lang.String expected) {
return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.integtests.alpha.ExpectedResult.class, "stringLikeRegexp", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.integtests.alpha.ExpectedResult.class), new Object[] { java.util.Objects.requireNonNull(expected, "expected is required") });
}
/**
* (experimental) The expected results encoded as a string.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public abstract @org.jetbrains.annotations.NotNull java.lang.String getResult();
/**
* (experimental) The expected results encoded as a string.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public abstract void setResult(final @org.jetbrains.annotations.NotNull java.lang.String value);
/**
* A proxy class which represents a concrete javascript instance of this type.
*/
@software.amazon.jsii.Internal
private static final class Jsii$Proxy extends software.amazon.awscdk.integtests.alpha.ExpectedResult {
protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
/**
* (experimental) The expected results encoded as a string.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public final @org.jetbrains.annotations.NotNull java.lang.String getResult() {
return software.amazon.jsii.Kernel.get(this, "result", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* (experimental) The expected results encoded as a string.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public final void setResult(final @org.jetbrains.annotations.NotNull java.lang.String value) {
software.amazon.jsii.Kernel.set(this, "result", java.util.Objects.requireNonNull(value, "result is required"));
}
}
}