forked from quarkus-qe/quarkus-test-suite
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test to verify correct application order of update recipes
This test ensures that during the Quarkus update process, the update recipes are applied in the correct order to prevent incorrect dependency transformations. It address the issue quarkusio/quarkus#44183
- Loading branch information
1 parent
6c55951
commit 9fc1ded
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
quarkus-cli/src/test/java/io/quarkus/ts/quarkus/cli/update/QuarkusCli35to315UpdateIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package io.quarkus.ts.quarkus.cli.update; | ||
|
||
import static io.quarkus.test.util.QuarkusCLIUtils.getDependencies; | ||
import static org.junit.jupiter.api.Assertions.assertFalse; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import java.io.IOException; | ||
import java.util.List; | ||
|
||
import org.apache.maven.artifact.versioning.DefaultArtifactVersion; | ||
import org.apache.maven.model.Dependency; | ||
import org.codehaus.plexus.util.xml.pull.XmlPullParserException; | ||
import org.junit.jupiter.api.Tag; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import io.quarkus.test.bootstrap.QuarkusCliRestService; | ||
|
||
public class QuarkusCli35to315UpdateIT extends AbstractQuarkusCliUpdateIT { | ||
private static final DefaultArtifactVersion oldVersion = new DefaultArtifactVersion("3.5"); | ||
private static final DefaultArtifactVersion newVersion = new DefaultArtifactVersion("3.15"); | ||
|
||
public QuarkusCli35to315UpdateIT() { | ||
super(oldVersion, newVersion); | ||
} | ||
|
||
/** | ||
* Test that updating from Quarkus 3.5 to 3.15 correctly transforms | ||
* the 'quarkus-rest-client-reactive-jackson' extension to 'quarkus-rest-client-jackson', | ||
* and does not incorrectly transform it to 'quarkus-resteasy-client-jackson'. | ||
* This test addresses a specific issue where the update recipes could apply in the wrong order, | ||
* causing incorrect dependency transformations. More info here:https://github.com/quarkusio/quarkus/issues/44183 | ||
* | ||
*/ | ||
@Tag("https://github.com/quarkusio/quarkus/issues/44183") | ||
@Test | ||
public void testCorrectRecipesOrder() throws XmlPullParserException, IOException { | ||
|
||
QuarkusCliRestService app = quarkusCLIAppManager | ||
.createApplicationWithExtensions("quarkus-rest-client-reactive-jackson"); | ||
|
||
quarkusCLIAppManager.updateApp(app); | ||
List<Dependency> dependencies = getDependencies(app); | ||
assertTrue( | ||
dependencies.stream().anyMatch(dependency -> dependency.getArtifactId().equals("quarkus-rest-client-jackson")), | ||
"'quarkus-rest-client-jackson' should be present after the update."); | ||
|
||
assertFalse( | ||
dependencies.stream() | ||
.anyMatch(dependency -> dependency.getArtifactId().equals("quarkus-rest-client-reactive-jackson")), | ||
"'quarkus-rest-client-reactive-jackson' should not be present after the update."); | ||
|
||
assertFalse( | ||
dependencies.stream() | ||
.anyMatch(dependency -> dependency.getArtifactId().equals("quarkus-resteasy-client-jackson")), | ||
"'quarkus-resteasy-client-jackson' should not be present after the update."); | ||
} | ||
|
||
} |