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

CAMEL-20545: Using replaceFromWith with camel-test and having route t… #13485

Merged
merged 1 commit into from Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -66,6 +66,22 @@ public FromDefinition(EndpointConsumerBuilder endpointConsumerBuilder) {
setEndpointConsumerBuilder(endpointConsumerBuilder);
}

FromDefinition copy() {
FromDefinition copy = new FromDefinition();
copy.parent = this.parent;
copy.endpoint = this.endpoint;
copy.endpointConsumerBuilder = this.endpointConsumerBuilder;
copy.uri = this.uri;
copy.variableReceive = this.variableReceive;
copy.setCamelContext(this.getCamelContext());
copy.setId(this.getId());
copy.setCustomId(this.getCustomId());
copy.setDescription(this.getDescription());
copy.setLineNumber(this.getLineNumber());
copy.setLocation(this.getLocation());
return copy;
}

@Override
public String toString() {
return "From[" + getLabel() + "]";
Expand Down
Expand Up @@ -410,7 +410,8 @@ public RouteDefinition asRouteDefinition() {
copy.setDelayer(route.getDelayer());
copy.setGroup(route.getGroup());
copy.setInheritErrorHandler(route.isInheritErrorHandler());
copy.setInput(route.getInput());
// make a defensive copy of the input as input can be adviced during testing or other changes
copy.setInput(route.getInput().copy());
copy.setInputType(route.getInputType());
copy.setLogMask(route.getLogMask());
copy.setMessageHistory(route.getMessageHistory());
Expand Down