-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed platform stream selection when platform key is null
- Loading branch information
1 parent
23388b9
commit 4514310
Showing
2 changed files
with
80 additions
and
2 deletions.
There are no files selected for viewing
76 changes: 76 additions & 0 deletions
76
.../java/io/quarkus/devtools/project/create/UpstreamStreamCoordsWithNullPlatformKeyTest.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,76 @@ | ||
package io.quarkus.devtools.project.create; | ||
|
||
import io.quarkus.devtools.testing.registry.client.TestRegistryClientBuilder; | ||
import io.quarkus.maven.ArtifactCoords; | ||
import io.quarkus.registry.catalog.PlatformStreamCoords; | ||
import java.nio.file.Path; | ||
import java.util.List; | ||
import org.junit.jupiter.api.BeforeAll; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class UpstreamStreamCoordsWithNullPlatformKeyTest extends MultiplePlatformBomsTestBase { | ||
|
||
private static final String DOWNSTREAM_PLATFORM_KEY = "io.downstream.platform"; | ||
private static final String UPSTREAM_PLATFORM_KEY = "io.upstream.platform"; | ||
|
||
@BeforeAll | ||
public static void setup() throws Exception { | ||
TestRegistryClientBuilder.newInstance() | ||
//.debug() | ||
.baseDir(configDir()) | ||
// registry | ||
.newRegistry("downstream.registry.test") | ||
.recognizedQuarkusVersions("*-downstream") | ||
// platform key | ||
.newPlatform(DOWNSTREAM_PLATFORM_KEY) | ||
.newStream("1.0") | ||
// 1.0.4 release | ||
.newRelease("1.1.1-downstream") | ||
.quarkusVersion("1.1.1-downstream") | ||
.upstreamQuarkusVersion("1.1.1") | ||
// default bom including quarkus-core + essential metadata | ||
.addCoreMember() | ||
// foo platform member | ||
.newMember("acme-a-bom").addExtension("io.acme", "ext-a", "1.1.1-downstream").release() | ||
.stream().platform().registry() | ||
.clientBuilder() | ||
.newRegistry("upstream.registry.test") | ||
// platform key | ||
.newPlatform(UPSTREAM_PLATFORM_KEY) | ||
// 2.0 STREAM | ||
.newStream("2.0") | ||
// 2.0.5 release | ||
.newRelease("2.0.5") | ||
.quarkusVersion("2.0.5") | ||
// default bom including quarkus-core + essential metadata | ||
.addCoreMember() | ||
.newMember("acme-a-bom").addExtension("io.acme", "ext-a", "2.0.5").release().stream().platform() | ||
// 1.0 STREAM | ||
.newStream("1.0") | ||
.newRelease("1.1.1") | ||
.quarkusVersion("1.1.1") | ||
// default bom including quarkus-core + essential metadata | ||
.addCoreMember() | ||
.newMember("acme-a-bom").addExtension("io.acme", "ext-a", "1.1.1") | ||
.registry() | ||
.clientBuilder() | ||
.build(); | ||
|
||
enableRegistryClient(); | ||
} | ||
|
||
protected String getMainPlatformKey() { | ||
return UPSTREAM_PLATFORM_KEY; | ||
} | ||
|
||
@Test | ||
public void createUsingStream2_0() throws Exception { | ||
final Path projectDir = newProjectDir("created-using-upstream-2.0"); | ||
createProject(projectDir, new PlatformStreamCoords(null, "2.0"), List.of("ext-a")); | ||
|
||
assertModel(projectDir, | ||
List.of(mainPlatformBom(), platformMemberBomCoords("acme-a-bom")), | ||
List.of(new ArtifactCoords("io.acme", "ext-a", null)), | ||
"2.0.5"); | ||
} | ||
} |
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