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

Add support filename template #2136

Merged
merged 16 commits into from
Apr 24, 2023
Merged

Add support filename template #2136

merged 16 commits into from
Apr 24, 2023

Conversation

craftsman228
Copy link
Contributor

@craftsman228 craftsman228 commented Apr 14, 2023

In scope of this PR implemented:

  • Support filename template(via CommandLineOptions and WireMockConfiguration;
  • Removed SafeFilename util class. Replaced with new FilenameMaker class which based on filename template;
  • Small code refactoring;

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

Is there a related GitHub issue? Would be nice to have it or some description in the pull request as https://github.com/wiremock/wiremock/blob/master/CONTRIBUTING.md#before-opening-a-pr recommends.

Bonus points for a documentation update too.

@tomakehurst
Copy link
Member

When I try running it standalone and creating a persistent stub I get an NPE thrown. I'll push a failing test for this + the name logic to your branch.

private static final String NAME_TEMPLATE = "{{{name}}}-";
private static final Pattern NON_ALPHANUMERIC = Pattern.compile("[^\\w-.]");
private static final String DEFAULT_EXTENSION = ".json";
private static final String POINT = ".";

Choose a reason for hiding this comment

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

I believe DOT is more commonly used in this context.

Tom Akehurst added 3 commits April 24, 2023 15:15
…an prefixed. Wrapped the stub mapping into a model used for filename templates in order to normalise the URL and simplify access to common attributes.
@tomakehurst tomakehurst merged commit d721662 into master Apr 24, 2023
7 checks passed
@tomakehurst tomakehurst deleted the support_filename_template branch April 24, 2023 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants