Skip to content

Commit

Permalink
test: relax version checks (#489)
Browse files Browse the repository at this point in the history
  • Loading branch information
ptiurin authored Dec 23, 2024
1 parent b75c7df commit 1a43081
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/test/java/com/firebolt/FireboltDriverTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.util.stream.Collector;
import java.util.stream.Collectors;

import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
Expand Down Expand Up @@ -93,7 +94,9 @@ void jdbcCompliant() {
void version() {
FireboltDriver fireboltDriver = new FireboltDriver();
assertEquals(3, fireboltDriver.getMajorVersion());
assertEquals(5, fireboltDriver.getMinorVersion());
int minorVersion = fireboltDriver.getMinorVersion();
// Sanity check for minor version
assertTrue(minorVersion >= 0 && minorVersion < 100);
}

@ParameterizedTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,12 +356,13 @@ void shouldGetDriverMajorVersion() {

@Test
void shouldGetDriverMinorVersion() {
assertEquals(5, fireboltDatabaseMetadata.getDriverMinorVersion());
int minorVersion = fireboltDatabaseMetadata.getDriverMinorVersion();
assertTrue(minorVersion >= 0 && minorVersion < 100);
}

@Test
void shouldGetDriverVersion() throws SQLException {
assertEquals("3.5.0", fireboltDatabaseMetadata.getDriverVersion());
assertTrue(fireboltDatabaseMetadata.getDriverVersion().matches("3\\.\\d+\\.\\d+"));
}

@Test
Expand Down
6 changes: 4 additions & 2 deletions src/test/java/com/firebolt/jdbc/util/VersionUtilTest.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.firebolt.jdbc.util;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

import org.junit.jupiter.api.Test;

Expand All @@ -13,12 +14,13 @@ void shouldGetDriverMajorVersion() {

@Test
void shouldGetDriverMinorVersion() {
assertEquals(5, VersionUtil.getDriverMinorVersion());
int minorVersion = VersionUtil.getDriverMinorVersion();
assertTrue(minorVersion >= 0 && minorVersion < 100);
}

@Test
void shouldGetProjectVersion() {
assertEquals("3.5.0", VersionUtil.getDriverVersion());
assertTrue(VersionUtil.getDriverVersion().matches("3\\.\\d+\\.\\d+"));
}

@Test
Expand Down

0 comments on commit 1a43081

Please sign in to comment.