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 @@ -93,6 +93,10 @@ public Integer doCall() throws Exception {
String ext = FileUtil.onlyExt(name, true);
if ("pom.xml".equals(name) || "java".equals(ext)) {
updateTargets.add(file);
} else {
// route definition files (YAML, XML) are used as source files
// for the export pipeline dependency resolution
this.files.add(file.toString());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,43 @@ private void prepareMavenProject(RuntimeType rt) throws Exception {
Assertions.assertEquals(0, exportCommand.doCall(), exportCommandPrinter.getLines().toString());
}

// ==================== explicit route file as positional argument ====================

@ParameterizedTest
@MethodSource("runtimeProvider")
void shouldDependencyUpdateWithExplicitRouteFile(RuntimeType rt) throws Exception {
prepareFixtureProject(rt);

// add arangodb to the route
addArangodbToCamelFile();

// pass BOTH pom.xml AND route file as positional arguments
// (this is the calling convention used by IDE tooling)
StringPrinter updatePrinter = new StringPrinter();
DependencyUpdate command = new DependencyUpdate(new CamelJBangMain().withPrinter(updatePrinter));
CommandLine.populateCommand(command,
"--camel-version=4.13.0",
"--dir=" + workingDir,
CamelCommandBaseTestSupport.quarkusExtRegistry(),
new File(workingDir, "pom.xml").getAbsolutePath(),
new File(workingDir, "src/main/resources/camel/my.camel.yaml").getAbsolutePath());
int exit = command.doCall();
Assertions.assertEquals(0, exit, updatePrinter.getLines().toString());

String pomContent = Files.readString(new File(workingDir, "pom.xml").toPath());
switch (rt) {
case quarkus:
assertThat(pomContent).contains("camel-quarkus-arangodb");
break;
case springBoot:
assertThat(pomContent).contains("camel-arangodb-starter");
break;
case main:
assertThat(pomContent).contains("camel-arangodb<");
break;
}
}

// ==================== scan-routes with Maven (fixture-based tests) ====================

@ParameterizedTest
Expand Down