From d8df3e01433f46bd85cc3389d7899df48154ce65 Mon Sep 17 00:00:00 2001 From: Chris Jovanovski <96434868+chris-enroly@users.noreply.github.com> Date: Wed, 16 Sep 2026 19:10:58 +0200 Subject: [PATCH] test(cloudformation): restore the dynamic reference Javadoc to the test it describes (#3694) --- .../CloudFormationTemplateEngineTest.java | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/test/java/io/github/hectorvent/floci/services/cloudformation/CloudFormationTemplateEngineTest.java b/src/test/java/io/github/hectorvent/floci/services/cloudformation/CloudFormationTemplateEngineTest.java index 05f7fca3e0..c2e62d85dd 100644 --- a/src/test/java/io/github/hectorvent/floci/services/cloudformation/CloudFormationTemplateEngineTest.java +++ b/src/test/java/io/github/hectorvent/floci/services/cloudformation/CloudFormationTemplateEngineTest.java @@ -380,6 +380,20 @@ class CloudFormationTemplateEngineTest { * literal text because {@code resolveNode}, the general-purpose path every non-RDS property goes * through, had no dynamic-reference stage. */ + @Test + void resolveNodeResolvesDynamicReferenceInPlainStringValue() { + UnaryOperator resolver = value -> { + assertEquals("{{resolve:ssm:/demo/url}}", value); + return "https://real.example.com"; + }; + CloudFormationTemplateEngine e = new CloudFormationTemplateEngine("000000000000", + "us-east-1", "my-stack", "stack/id", Map.of(), Map.of(), Map.of(), Map.of(), + Map.of(), mapper, (Function) name -> null, resolver); + + assertEquals("https://real.example.com", + e.resolveNode(json("\"{{resolve:ssm:/demo/url}}\"")).asText()); + } + /** * CDK emits an RDS master credential as an {@code Fn::Join} whose fragments split one dynamic * reference: {@code ["{{resolve:secretsmanager:", {"Ref": "Secret"}, ":SecretString:password::}}"]}. @@ -424,20 +438,6 @@ class CloudFormationTemplateEngineTest { + "{\"Ref\":\"Secret\"},\":SecretString:password::}}\"]]}"))); } - @Test - void resolveNodeResolvesDynamicReferenceInPlainStringValue() { - UnaryOperator resolver = value -> { - assertEquals("{{resolve:ssm:/demo/url}}", value); - return "https://real.example.com"; - }; - CloudFormationTemplateEngine e = new CloudFormationTemplateEngine("000000000000", - "us-east-1", "my-stack", "stack/id", Map.of(), Map.of(), Map.of(), Map.of(), - Map.of(), mapper, (Function) name -> null, resolver); - - assertEquals("https://real.example.com", - e.resolveNode(json("\"{{resolve:ssm:/demo/url}}\"")).asText()); - } - /** * The same dynamic-reference stage applies to the text an intrinsic function produces, since a * literal {@code {{resolve:...}}} embedded in an {@code Fn::Sub} template survives substitution