-
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.
Introduce version check in base codestarts and use them
- Loading branch information
Showing
3 changed files
with
57 additions
and
12 deletions.
There are no files selected for viewing
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
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
24 changes: 24 additions & 0 deletions
24
...src/test/java/io/quarkus/devtools/codestarts/core/reader/QuteCodestartFileReaderTest.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,24 @@ | ||
package io.quarkus.devtools.codestarts.core.reader; | ||
|
||
import static io.quarkus.devtools.codestarts.core.reader.QuteCodestartFileReader.compareVersionTo; | ||
import static io.quarkus.devtools.codestarts.core.reader.QuteCodestartFileReader.extractMajorMinor; | ||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
class QuteCodestartFileReaderTest { | ||
|
||
@Test | ||
void testExtractVersion() { | ||
assertThat(extractMajorMinor("3.12.0.Final")).isEqualTo("3.12"); | ||
assertThat(extractMajorMinor("3.12")).isEqualTo("3.12"); | ||
} | ||
|
||
@Test | ||
void testCompareVersion() { | ||
assertThat(compareVersionTo("3.12.0.Final", "3.12")).isEqualTo(0); | ||
assertThat(compareVersionTo("3.13.0", "3.12")).isGreaterThan(0); | ||
assertThat(compareVersionTo("3.2.1", "3.12")).isLessThan(0); | ||
assertThat(compareVersionTo("999-SNAPSHOT", "3.12")).isGreaterThan(0); | ||
} | ||
} |