Skip to content

Issue-782 # Support {{...}} double curly brace based as alternate placeholder delimiter alongside ${...} - #790

Merged
authorjapps merged 1 commit into
authorjapps:masterfrom
umer901:issue-782-support-double-curly-brace
Aug 17, 2026
Merged

Issue-782 # Support {{...}} double curly brace based as alternate placeholder delimiter alongside ${...}#790
authorjapps merged 1 commit into
authorjapps:masterfrom
umer901:issue-782-support-double-curly-brace

Conversation

@umer901

@umer901 umer901 commented Aug 16, 2026

Copy link
Copy Markdown

Added support for {{...}} double curly braces as alternate placeholder delimiter alongside ${...}

Fixed Which Issue?

PR Branch
https://github.com/umer901/zerocode/tree/issue-782-support-double-curly-brace

Motivation and Context

Zerocode currently supports ${...} placeholders in test steps, target-env property files, and CSV-parameterized scenarios. This PR adds {{...}} as an equivalent alternative without changing existing ${...} behavior.

Both styles can be used in the same scenario. The implementation covers known runtime tokens, system properties/environment variables, random tokens, masked values, host-property keys, JSON-path values, CSV positional/named PARAM values, and target-env file placeholders.

The change is intentionally scoped to existing placeholder-resolution paths and adds no dependencies.

Implementation:

  • Changed the regex in ApplicationMainModule.java‎ and ZeroCodeParameterizedProcessorImpl.java‎
  • Updated all comments that mention the placeholders
  • Added a replaceTokens helper that passes after existing StringSubstitutor (to avoid adding the {{...}} separately at each site), and
  • Updated ZeroCodeAssertionsProcessorImpl.java and SmartUtils to use the shared resolver.
  • In token utils, token extraction now captures the parameter name from either bracket format. I also moved the token and masked token regexes from the function to pattern constants.

Tests:

  • TokenUtilsTest.java: verifies tokens work with {{...}}, masked values work in double braces, and an unknown Handlebars-shaped token stays literal.
  • ZeroCodeAssertionsProcessorImplTest.java: verified double-brace host-property resolution and mixed ${...}/{{...}} JSON-path resolution.
  • ZeroCodeParameterizedProcessorImplTest.java: verified double-brace positional and named CSV parameters, plus the missing-header error path.
  • ApplicationMainModuleTest.java: verified target-env properties resolve from both delimiter styles and unresolved values remain unchanged.
  • SmartUtilsTest.java: verified generic map-based replacement works with double braces.
  • Added integration coverage in DoubleBracePlaceholdersInMemoryTest.java which starts the in-memory simulator and executes a real HTTP scenario using {{...}} host-property, CSV PARAM, random, system-property, and masked tokens. It also mixes ${...} and {{...}} in the same scenario and confirms the Handlebars-shaped header remains literal.

Checklist:

  • 1. New Unit tests were added

    • 1.1 Covered in existing Unit tests
  • 2. Integration tests were added

    • 2.1 Covered in existing Integration tests
  • 3. Test names are meaningful

  • 3.1 Feature manually tested and outcome is successful

  • 4. PR doesn't break any of the earlier features for end users

    • 4.1 WARNING! This might break one or more earlier earlier features, hence left a comment tagging all reviewrs
  • 5. PR doesn't break the HTML report features directly

    • 5.1 Yes! I've manually run it locally and seen the HTML reports are generated perfectly fine
    • 5.2 Yes! I've opened the generated HTML reports from the /target folder and they look fine
  • 6. PR doesn't break any HTML report features indirectly

    • 6.1 I have not added or amended any dependencies in this PR
    • 6.2 I have double checked, the new dependency added or removed has not affected the report generation indirectly
    • 6.3 Yes! I've seen the Sample report screenshots here, and HTML report of the current PR looks simillar.
  • 7. Branch build passed in CI

  • 8. No 'package.*' in the imports

  • 9. Relevant DOcumentation page added or updated with clear instructions and examples for the end user

    • 9.1 Not applicable. This was only a code refactor change, no functional or behaviourial changes were introduced
  • 10. Http test added to http-testing-examples module(if applicable) ?

    • 10.1 Not applicable. The changes did not affect HTTP automation flow
  • 11. Kafka test added to kafka-testing-examples module(if applicable) ?

    • 11.1 Not applicable. The changes did not affect Kafka automation flow

I have one question, is there a need to add documentation, and if so where? I reflected the changes in the comments where needed.

@authorjapps

Copy link
Copy Markdown
Owner

CI run is is-progress here. Keep an eye please.

@IgnatiosSar IgnatiosSar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me! Acceptance criteria are met and the implementation is covered by tests.

@authorjapps
authorjapps merged commit 891ed82 into authorjapps:master Aug 17, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants