Skip to content

Commit

Permalink
Merge pull request #15146 from ia3andy/fix-version-snapshots
Browse files Browse the repository at this point in the history
Make sure versions are mocked in snapshots tests
  • Loading branch information
gsmet authored Feb 18, 2021
2 parents 720cf4a + f5758fc commit 35ef135
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import io.quarkus.devtools.PlatformAwareTestBase;
import io.quarkus.devtools.testing.SnapshotTesting;
import io.quarkus.platform.descriptor.QuarkusPlatformDescriptor;

class QuarkusJBangCodestartGenerationTest extends PlatformAwareTestBase {

Expand All @@ -29,25 +28,24 @@ static void setUp() throws IOException {

@Test
void generateDefaultProject(TestInfo testInfo) throws Throwable {
final QuarkusPlatformDescriptor platformDescriptor = getPlatformDescriptor();
final QuarkusJBangCodestartProjectInput input = QuarkusJBangCodestartProjectInput.builder()
.putData(QUARKUS_BOM_GROUP_ID, platformDescriptor.getBomGroupId())
.putData(QUARKUS_BOM_ARTIFACT_ID, platformDescriptor.getBomArtifactId())
.putData(QUARKUS_BOM_VERSION, platformDescriptor.getBomVersion())
.putData(QUARKUS_BOM_GROUP_ID, "io.quarkus")
.putData(QUARKUS_BOM_ARTIFACT_ID, "quarkus-bom")
.putData(QUARKUS_BOM_VERSION, "999-SNAPSHOT")
.build();
final Path projectDir = testDirPath.resolve("default");
getCatalog().createProject(input).generate(projectDir);
assertThatDirectoryTreeMatchSnapshots(testInfo, projectDir);
assertThatMatchSnapshot(testInfo, projectDir, "src/GreetingResource.java");
}

@Test
void generatePicocliProject(TestInfo testInfo) throws Throwable {
final QuarkusPlatformDescriptor platformDescriptor = getPlatformDescriptor();
final QuarkusJBangCodestartProjectInput input = QuarkusJBangCodestartProjectInput.builder()
.addCodestart("jbang-picocli-code")
.putData(QUARKUS_BOM_GROUP_ID, platformDescriptor.getBomGroupId())
.putData(QUARKUS_BOM_ARTIFACT_ID, platformDescriptor.getBomArtifactId())
.putData(QUARKUS_BOM_VERSION, platformDescriptor.getBomVersion())
.putData(QUARKUS_BOM_GROUP_ID, "io.quarkus")
.putData(QUARKUS_BOM_ARTIFACT_ID, "quarkus-bom")
.putData(QUARKUS_BOM_VERSION, "999-SNAPSHOT")
.build();
final Path projectDir = testDirPath.resolve("picocli");
getCatalog().createProject(input).generate(projectDir);
Expand Down
Loading

0 comments on commit 35ef135

Please sign in to comment.