Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: java and python templates are broken #17357

Merged
merged 10 commits into from Nov 6, 2021
Expand Up @@ -4,7 +4,7 @@
// import software.amazon.awscdk.assertions.Template;
// import java.io.IOException;

// import java.util.Map;
// import java.util.HashMap;

// import org.junit.jupiter.api.Test;

Expand All @@ -19,8 +19,8 @@

// Template template = Template.fromStack(stack);

// template.hasResourceProperties("AWS::SQS::Queue", Map.of(
// "VisibilityTimeout", 300
// ));
// template.hasResourceProperties("AWS::SQS::Queue", new HashMap<String, Number>() {{
// put("VisibilityTimeout", 300);
// }});
// }
// }
@@ -1,2 +1,2 @@
aws-cdk.core>=%cdk-version%,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was just a random but I stumbled upon

aws-cdk.assertions>=%cdk-version%,
aws-cdk.core>=%cdk-version%
aws-cdk.assertions>=%cdk-version%
Expand Up @@ -8,11 +8,12 @@

# example tests. To run these tests, uncomment this file along with the example
# resource in %name.PythonModule%/%name.PythonModule%_stack.py
# def test_sqs_queue_created():
def test_sqs_queue_created():
# app = core.App()
# stack = %name.PascalCased%Stack(app, "%name.StackName%")
# template = assertions.Template.from_stack(stack)

# template.has_resource_properties("AWS::SQS::Queue", {
# "VisibilityTimeout": 300
# })
pass
Expand Up @@ -5,7 +5,7 @@
import software.amazon.awscdk.assertions.Match;
import java.io.IOException;

import java.util.Map;
import java.util.HashMap;

import org.junit.jupiter.api.Test;

Expand All @@ -18,9 +18,9 @@ public void testStack() throws IOException {

Template template = Template.fromStack(stack);

template.hasResourceProperties("AWS::SQS::Queue", Map.of(
"VisibilityTimeout", 300
));
template.hasResourceProperties("AWS::SQS::Queue", new HashMap<String, Number>() {{
put("VisibilityTimeout", 300);
}});
template.resourceCountIs("AWS::SNS::Topic", 1);
}
}
Expand Up @@ -4,7 +4,7 @@
// import software.amazon.awscdk.assertions.alpha.Template;
// import java.io.IOException;

// import java.util.Map;
// import java.util.HashMap;

// import org.junit.jupiter.api.Test;

Expand All @@ -19,8 +19,8 @@

// Template template = Template.fromStack(stack);

// template.hasResourceProperties("AWS::SQS::Queue", Map.of(
// "VisibilityTimeout", 300
// ));
// template.hasResourceProperties("AWS::SQS::Queue", new HashMap<String, Number>() {{
// put("VisibilityTimeout", 300);
// }});
// }
// }
Expand Up @@ -5,7 +5,7 @@
import software.amazon.awscdk.assertions.alpha.Match;
import java.io.IOException;

import java.util.Map;
import java.util.HashMap;

import org.junit.jupiter.api.Test;

Expand All @@ -18,9 +18,9 @@ public void testStack() throws IOException {

Template template = Template.fromStack(stack);

template.hasResourceProperties("AWS::SQS::Queue", Map.of(
"VisibilityTimeout", 300
));
template.hasResourceProperties("AWS::SQS::Queue", new HashMap<String, Number>() {{
put("VisibilityTimeout", 300);
}});

template.resourceCountIs("AWS::SNS::Topic", 1);
}
Expand Down