Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ public class ChangeDependency extends ScanningRecipe<ChangeDependency.Accumulato
@Getter
final String description = "Change the group ID, artifact ID, and/or the version of a specified Gradle or Maven dependency.";

@Override
public String getInstanceNameSuffix() {
return String.format("`%s:%s`", oldGroupId, oldArtifactId);
}

@Override
public Validated<Object> validate(ExecutionContext ctx) {
return super.validate(ctx)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,4 +293,14 @@ void pinWhenOverrideManagedVersionGradle() {
)
);
}

@Test
void instanceName() {
// A composite recipe lists many ChangeDependency instances, and without the coordinates
// in the name they are indistinguishable from one another.
ChangeDependency cd = new ChangeDependency("org.springframework.boot", "spring-boot-starter-web",
null, "spring-boot-starter-webmvc", "4.0.x", null, null, null);
assertThat(cd.getInstanceName())
.isEqualTo("Change Gradle or Maven dependency `org.springframework.boot:spring-boot-starter-web`");
}
}
Loading