Skip to content

Commit

Permalink
Upgrade itf-extension to 0.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasHofman committed Nov 15, 2023
1 parent 6478a5e commit a673489
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.wildfly.channelplugin.it;

import java.io.File;
import java.net.MalformedURLException;
import java.nio.file.Path;
import java.util.Optional;
import java.util.logging.Logger;

Expand All @@ -23,7 +23,6 @@
import static com.soebes.itf.extension.assertj.MavenExecutionResultAssert.assertThat;
import static org.assertj.core.api.Assertions.assertThat;

@SuppressWarnings("OptionalGetWithoutIsPresent")
@MavenJupiterExtension
@MavenPredefinedRepository("maven-repo")
public class UpgradeComponentsMojoIT {
Expand Down Expand Up @@ -52,26 +51,26 @@ void basic_project_test_case(MavenExecutionResult result) {
// verify dependency versions are still set to properties
assertThat(dependencyModel.getDependency("io.undertow", "undertow-core", "jar", null))
.satisfies(o -> {
assertThat(o.isPresent());
assertThat(o).isPresent();
assertThat(o.get().getVersion()).isEqualTo("${undertow.version}");
});
assertThat(dependencyModel.getDependency("io.undertow", "undertow-servlet", "jar", null))
.satisfies(o -> {
assertThat(o.isPresent());
assertThat(o).isPresent();
assertThat(o.get().getVersion()).isEqualTo("${undertow.version}");
});

// verify dependency version has been overriden
assertThat(dependencyModel.getDependency("org.jboss.marshalling", "jboss-marshalling", "jar", null))
.satisfies(o -> {
assertThat(o.isPresent());
assertThat(o).isPresent();
assertThat(o.get().getVersion()).isEqualTo("2.0.9.Final-redhat-00001");
});

// verify version specified by recursive property reference
assertThat(dependencyModel.getDependency("commons-io", "commons-io", "jar", null))
.satisfies(o -> {
assertThat(o.isPresent());
assertThat(o).isPresent();
assertThat(o.get().getVersion()).isEqualTo("${commons.version}");
});
assertThat(model.getProperties().get("commons.version")).isEqualTo("${commons2.version}");
Expand All @@ -95,8 +94,8 @@ void basic_project_test_case(MavenExecutionResult result) {
void eap_bom_test_case(MavenExecutionResult result) throws MalformedURLException {
assertThat(result).isSuccessful();

File manifestFile = new File(result.getMavenProjectResult().getTargetProjectDirectory(), "manifest.yaml");
ChannelManifest channel = ChannelManifestMapper.from(manifestFile.toURI().toURL());
Path manifestFile = result.getMavenProjectResult().getTargetProjectDirectory().resolve("manifest.yaml");
ChannelManifest channel = ChannelManifestMapper.from(manifestFile.toUri().toURL());
Model model = result.getMavenProjectResult().getModel();

for (Dependency dependency : model.getDependencyManagement().getDependencies()) {
Expand Down Expand Up @@ -143,7 +142,7 @@ void override_property_test_case(MavenExecutionResult result) {
// dependency still referencing the property
assertThat(dependencyModel.getDependency("io.undertow", "undertow-core", "jar", null))
.satisfies(o -> {
assertThat(o.isPresent());
assertThat(o).isPresent();
assertThat(o.get().getVersion()).isEqualTo("${undertow.version}");
});
}
Expand All @@ -167,7 +166,7 @@ void override_dependency_test_case(MavenExecutionResult result) {
// verify dependency version element has been overridden
assertThat(dependencyModel.getDependency("io.undertow", "undertow-core", "jar", null))
.satisfies(o -> {
assertThat(o.isPresent());
assertThat(o).isPresent();
assertThat(o.get().getVersion()).isEqualTo("2.2.5.Final-Overridden");
});
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<channel.version>1.0.5.Final</channel.version>
<jupiter.version>5.7.2</jupiter.version>
<assertj.version>3.22.0</assertj.version>
<itf.version>0.11.0</itf.version>
<itf.version>0.12.0</itf.version>
</properties>

<dependencyManagement>
Expand Down

0 comments on commit a673489

Please sign in to comment.