Skip to content
v2.278.0

Experimental

@aws-cdk/integ-tests-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

ActualResult Class ​

Represents the "actual" results to compare.

Example ​

ts
declare const myCustomResource: CustomResource;
declare const stack: Stack;
declare const app: App;

const integ = new IntegTest(app, 'Integ', { testCases: [stack] });
integ.assertions.expect(
  'CustomAssertion',
  ExpectedResult.objectLike({ foo: 'bar' }),
  ActualResult.fromCustomResource(myCustomResource, 'data'),
);
python
# my_custom_resource: CustomResource
# stack: Stack
# app: App


integ = IntegTest(app, "Integ", test_cases=[stack])
integ.assertions.expect("CustomAssertion",
    ExpectedResult.object_like({"foo": "bar"}),
    ActualResult.from_custom_resource(my_custom_resource, "data"))
java
CustomResource myCustomResource;
Stack stack;
App app;


IntegTest integ = IntegTest.Builder.create(app, "Integ").testCases(List.of(stack)).build();
integ.assertions.expect("CustomAssertion", ExpectedResult.objectLike(Map.of("foo", "bar")), ActualResult.fromCustomResource(myCustomResource, "data"));
csharp
// Install: dotnet add package Amazon.CDK.IntegTests.Alpha
CustomResource myCustomResource;
Stack stack;
App app;


var integ = new IntegTest(app, "Integ", new IntegTestProps { TestCases = new [] { stack } });
integ.Assertions.Expect("CustomAssertion", ExpectedResult.ObjectLike(new Dictionary<string, object> { { "foo", "bar" } }), ActualResult.FromCustomResource(myCustomResource, "data"));
go
// Install: go get github.com/aws/aws-cdk-go/awscdkintegtestsalpha/v2
var myCustomResource CustomResource
var stack Stack
var app App


integ := awscdkintegtestsalpha.NewIntegTest(app, jsii.String("Integ"), &IntegTestProps{
	TestCases: []Stack{
		stack,
	},
})
integ.Assertions.Expect(jsii.String("CustomAssertion"), awscdkintegtestsalpha.ExpectedResult_ObjectLike(map[string]interface{}{
	"foo": jsii.String("bar"),
}), awscdkintegtestsalpha.ActualResult_FromCustomResource(myCustomResource, jsii.String("data")))

Initializer ​

ts
new ActualResult()
python
ActualResult()
java
new ActualResult()
csharp
new ActualResult()
go
NewActualResult()

Properties ​

resultstringresultstrresultStringResultstringResult*string #
The actual results as a string.

Methods ​

fromAwsApiCall(query: IApiCall, attribute: string): ActualResult // chainable@staticmethod def from_aws_api_call(query: IApiCall, attribute: str) -> ActualResultpublic static ActualResult fromAwsApiCall(IApiCall query, String attribute)public static ActualResult FromAwsApiCall(IApiCall query, string attribute)func FromAwsApiCall(Query IApiCall, Attribute *string) ActualResult static #
Get the actual results from a AwsApiCall.
fromCustomResource(customResource: CustomResource, attribute: string): ActualResult // chainable@staticmethod def from_custom_resource(custom_resource: CustomResource, attribute: str) -> ActualResultpublic static ActualResult fromCustomResource(CustomResource customResource, String attribute)public static ActualResult FromCustomResource(CustomResource customResource, string attribute)func FromCustomResource(CustomResource CustomResource, Attribute *string) ActualResult static #
Get the actual results from a CustomResource.