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

chore: minor internal refactors #2491

Merged
merged 8 commits into from
Dec 8, 2023

Conversation

Marvin9
Copy link
Contributor

@Marvin9 Marvin9 commented Nov 16, 2023

As part of university course assignment, I have to perform refactor where possible.

Here is the list of commits and what kind of refactor was followed.

  1. 926936b Extract Variable
    extracted non trivial boolean operations in condition block and put it in self explanatory named variable.

  2. c6f0261 Decompose Conditional
    moved scenario checking condition in BasicMappingBuilder.build. Also used checkState

  3. 58b6723 Extract Method
    moved header injection and verifying response status in its own methods from HttpAdminClient.safelyExecuteRequest

4. 2c05908 Extract Class
I noticed JsonSchemaVersion should not be in WireMock class and saw that this was mentioned in the PR. Feel free to enlighten me about the side-effects this change could result or any other suggestion.

References

I haven't created an issue but would be happy to create one as I want to implement some more refactors.

Submitter checklist

  • Recommended: Join WireMock Slack to get any help in #help-contributing or a project-specific channel like #wiremock-java
  • Recommended: If you participate in Hacktoberfest 2023, make sure you're signed up there and in the WireMock form
  • The PR request is well described and justified, including the body and the references
  • The PR title represents the desired changelog entry
  • The repository's code style is followed (see the contributing guide)
  • Test coverage that demonstrates that the change works as expected
  • For new features, there's necessary documentation in this pull request or in a subsequent PR to wiremock.org

@Marvin9 Marvin9 requested a review from a team as a code owner November 16, 2023 04:16
@oleg-nenashev oleg-nenashev added the chore Maintenance label Nov 20, 2023
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.

Hi. Thanks for the pull request. JsonSchemaVersion relocation, while reasonable semantically, will break binary compatibility of items depending on the WireMock Core API. I do not think it worth the effort to migrate, at least until there is a major breaking re-architecture towards WireMock 4

@Marvin9
Copy link
Contributor Author

Marvin9 commented Nov 23, 2023

@oleg-nenashev Would you mind re-review it?

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.

Thanks, these refactorings are fine. They do not reduce the code side or remove duplication, but arguably they improve code readability and might be helpful in the future

@Marvin9
Copy link
Contributor Author

Marvin9 commented Dec 1, 2023

@oleg-nenashev can you please take a look again?

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.

Will try to merge it over the weekend

@oleg-nenashev oleg-nenashev merged commit df096d2 into wiremock:master Dec 8, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants