Skip to content

Commit

Permalink
šŸµšŸ¶šŸ»
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsuter committed Jul 22, 2024
1 parent 8896dd9 commit e69e7af
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public abstract class AbstractDeployMojo extends AbstractIntegrationTestMojo {
* Guide</a>
*/
@Parameter(property = "ivy.deploy.options.file", required = false)
protected File deployOptionsFile;
protected Path deployOptionsFile;

@Component
private MavenFileFilter fileFilter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ public DeploymentOptionsFileFactory(Path deployableArtifact) {
this.deployableArtifact = deployableArtifact;
}

public Path createFromTemplate(File optionsFile, MavenProject project, MavenSession session,
public Path createFromTemplate(Path optionsFile, MavenProject project, MavenSession session,
MavenFileFilter fileFilter) throws MojoExecutionException {
if (!isOptionsFile(optionsFile)) {
if (!isOptionsFile(optionsFile.toFile())) {
return null;
}

String fileFormat = FilenameUtils.getExtension(optionsFile.getName());
String fileFormat = FilenameUtils.getExtension(optionsFile.getFileName().toString());
var targetFile = getTargetFile(fileFormat);
try {
fileFilter.copyFile(optionsFile, targetFile.toFile(), true, project, Collections.emptyList(), false,
fileFilter.copyFile(optionsFile.toFile(), targetFile.toFile(), true, project, Collections.emptyList(), false,
StandardCharsets.UTF_8.name(), session);
} catch (MavenFilteringException ex) {
throw new MojoExecutionException("Failed to resolve templates in options file", ex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void deployWithExistingOptionsFile() throws Throwable {
rule.project.getProperties().setProperty("doDeploy.test.user", "true");
DeployToEngineMojo mojo = rule.getMojo();

mojo.deployOptionsFile = new File("src/test/resources/options.yaml");
mojo.deployOptionsFile = Path.of("src/test/resources/options.yaml");
var deployedIar = getTarget(mojo.deployFile, mojo);
var deploymentOptionsFile = deployedIar.resolveSibling(deployedIar.getFileName() + ".options.yaml");

Expand Down Expand Up @@ -137,6 +137,7 @@ public void failOnEngineDeployError() throws Throwable {

DelayedOperation mockEngineDeployThread = new DelayedOperation(500, TimeUnit.MILLISECONDS);
Callable<Void> engineOperation = () -> {
Files.createDirectories(markers.errorLog().getParent());
Files.writeString(markers.errorLog(), "validation errors");
assertThat(deployedIar).exists();
Files.delete(deployedIar);
Expand Down

0 comments on commit e69e7af

Please sign in to comment.