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

Fix like creating complete response definition #1830

Closed

Conversation

Delfic
Copy link

@Delfic Delfic commented Mar 4, 2022

Fixes #1783.

Changed the test of like to use the main object instead of the builder so that it's more resilient. Added changes to fix the missing recently added properties.
Should fix the aforementioned issue and an issue I was having while trying to use like.

@@ -66,7 +67,13 @@ public static ResponseDefinitionBuilder like(ResponseDefinition responseDefiniti
? Parameters.from(responseDefinition.getTransformerParameters())
: Parameters.empty();
builder.wasConfigured = responseDefinition.isFromConfiguredStub();
return builder;

ProxyResponseDefinitionBuilder proxyResponseDefinitionBuilder = new ProxyResponseDefinitionBuilder(builder);
Copy link
Member

Choose a reason for hiding this comment

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

I think we should do this conditionally, in order to maintain the same behaviour when building from scratch, so e.g.

if (builder.proxyBaseUrl != null) {
  // Construct the ProxyResponseDefinitionBuilder
}

// Otherwise keep the builder as-is and return it.

@tomakehurst
Copy link
Member

Fixed in 9aad878

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.

When using Proxying with the ResponseTemplateTransformer the setting proxyUrlPrefixToRemove is ignored
2 participants