Incorrect version comparison in ModelVersion
Closes #30935 Signed-off-by: Dmitry Telegin <demetrio@carretti.pro>
This commit is contained in:
parent
53fa901a11
commit
5ff3488c80
2 changed files with 7 additions and 2 deletions
|
@ -94,7 +94,7 @@ public class ModelVersion {
|
||||||
|
|
||||||
if (micro < version.micro) {
|
if (micro < version.micro) {
|
||||||
return true;
|
return true;
|
||||||
} else if (minor > version.minor) {
|
} else if (micro > version.micro) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ import org.keycloak.migration.ModelVersion;
|
||||||
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
||||||
* @version $Revision: 1 $
|
* @version $Revision: 1 $
|
||||||
*/
|
*/
|
||||||
public class MigrationVersionTest {
|
public class ModelVersionTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testVersion() {
|
public void testVersion() {
|
||||||
|
@ -93,6 +93,11 @@ public class MigrationVersionTest {
|
||||||
Assert.assertEquals(0, versionProduct.getMinor());
|
Assert.assertEquals(0, versionProduct.getMinor());
|
||||||
Assert.assertEquals(0, versionProduct.getMicro());
|
Assert.assertEquals(0, versionProduct.getMicro());
|
||||||
Assert.assertNull(versionProduct.getQualifier());
|
Assert.assertNull(versionProduct.getQualifier());
|
||||||
|
|
||||||
|
ModelVersion version_24_0_0 = new ModelVersion("24.0.0");
|
||||||
|
ModelVersion version_24_0_4_0_SNAPSHOT = new ModelVersion("24.0.4.0-SNAPSHOT");
|
||||||
|
Assert.assertTrue(version_24_0_0.lessThan(version_24_0_4_0_SNAPSHOT));
|
||||||
|
Assert.assertFalse(version_24_0_4_0_SNAPSHOT.lessThan(version_24_0_0));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue