public class DatabaseCheckerTest {
@Test
public void require_oracle_11_2() throws Exception {
Database db = mockDb(new Oracle(), "11.2.0.0.1");
new DatabaseChecker(db).start();
// no error
db = mockDb(new Oracle(), "11.3.1");
new DatabaseChecker(db).start();
// no error
db = mockDb(new Oracle(), "12.0.2");
new DatabaseChecker(db).start();
// no error
db = mockDb(new Oracle(), "11.1.0.2");
try {
new DatabaseChecker(db).start();
fail();
} catch (IllegalStateException e) {
assertThat(e).hasMessage("Unsupported Oracle JDBC driver version: 11.1.0.2. Minimal required version is 11.2.");