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

Refactoring #2662

Conversation

Shivang-X
Copy link

For my current university course assignment, I need to improve the code by cleaning it up and making it easier to understand and modify (refactoring) whenever it's appropriate. And below mentioned are all refactoring.

Commit 1:

Performed "Replace condition with polymorphism" refactorng.

Commit 2:

Applied "Move method" refactoring.

Commit 3:

Performed "Extract Class" refactoring.

References

  • TODO

Submitter checklist

  • Recommended: Join WireMock Slack to get any help in #help-contributing or a project-specific channel like #wiremock-java
  • 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

shivang added 9 commits March 23, 2024 13:27
This commit extracts multiple conditions in the if statement
into separate variables for improved readability and maintainability.
This commit replaces the commented code with a call to the checkState()
method for better readability and consistency in the codebase.
This commit refactors the like() method by extracting the logic for creating
a ProxyResponseDefinitionBuilder into a separate method for better readability
and maintainability of the codebase.
@Shivang-X Shivang-X requested a review from a team as a code owner April 1, 2024 02:17
@@ -71,6 +71,9 @@ public static ResponseDefinitionBuilder like(ResponseDefinition responseDefiniti
builder.wasConfigured = responseDefinition.isFromConfiguredStub();

if (builder.proxyBaseUrl != null) {
<<<<<<< HEAD
return createProxyResponseDefinitionBuilder(builder, responseDefinition);
=======
Copy link
Contributor

Choose a reason for hiding this comment

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

This is breaking the code

@dieppa dieppa self-assigned this Apr 2, 2024
@leeturner
Copy link
Contributor

Hi @Shivang-X This PR looks like it has some of the same changes as your previous PR - #2647

It would be great if you could address the comments in the previous PR and then we can get that merged and closed off instead of adding the same changes to this PR

@dieppa dieppa assigned leeturner and unassigned dieppa Apr 9, 2024
@leeturner
Copy link
Contributor

Hi @Shivang-X I am just checking in on this PR to see if you are planning on moving it forwards to the point where we can merge it? No worries if not, I just wanted to check as we close PRs after a period of inactivity. Let me know your thoughts

@leeturner
Copy link
Contributor

Closing due to inactivity and duplication across a different PR.

@leeturner leeturner closed this May 3, 2024
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.

None yet

3 participants