@Test void isBeforeShouldReturnTrueWhenBefore() { SchemaVersion currentVersion = minVersion; when(schemaVersionDAO.getCurrentSchemaVersion()) .thenReturn(Mono.just(Optional.of(currentVersion))); CassandraSchemaVersionManager testee = new CassandraSchemaVersionManager( schemaVersionDAO, minVersion, maxVersion); assertThat(testee.isBefore(maxVersion).block()).isTrue(); }
public Mono<Boolean> isBefore(SchemaVersion minimum) { if (initialSchemaVersion.isBefore(minimum)) { return computeVersion() .map(computedVersion -> computedVersion.isBefore(minimum)); } return Mono.just(false); }
CassandraSchemaVersionManager { public Mono<Boolean> isBefore(SchemaVersion minimum) { if (initialSchemaVersion.isBefore(minimum)) { return computeVersion() .map(computedVersion -> computedVersion.isBefore(minimum)); } return Mono.just(false); } }
CassandraSchemaVersionManager { public Mono<Boolean> isBefore(SchemaVersion minimum) { if (initialSchemaVersion.isBefore(minimum)) { return computeVersion() .map(computedVersion -> computedVersion.isBefore(minimum)); } return Mono.just(false); } @Inject  CassandraSchemaVersionManager(CassandraSchemaVersionDAO schemaVersionDAO); @VisibleForTesting  CassandraSchemaVersionManager(CassandraSchemaVersionDAO schemaVersionDAO, SchemaVersion minVersion, SchemaVersion maxVersion); }
CassandraSchemaVersionManager { public Mono<Boolean> isBefore(SchemaVersion minimum) { if (initialSchemaVersion.isBefore(minimum)) { return computeVersion() .map(computedVersion -> computedVersion.isBefore(minimum)); } return Mono.just(false); } @Inject  CassandraSchemaVersionManager(CassandraSchemaVersionDAO schemaVersionDAO); @VisibleForTesting  CassandraSchemaVersionManager(CassandraSchemaVersionDAO schemaVersionDAO, SchemaVersion minVersion, SchemaVersion maxVersion); Mono<Boolean> isBefore(SchemaVersion minimum); Mono<SchemaVersion> computeVersion(); SchemaVersion getMinimumSupportedVersion(); SchemaVersion getMaximumSupportedVersion(); SchemaState computeSchemaState(); }
CassandraSchemaVersionManager { public Mono<Boolean> isBefore(SchemaVersion minimum) { if (initialSchemaVersion.isBefore(minimum)) { return computeVersion() .map(computedVersion -> computedVersion.isBefore(minimum)); } return Mono.just(false); } @Inject  CassandraSchemaVersionManager(CassandraSchemaVersionDAO schemaVersionDAO); @VisibleForTesting  CassandraSchemaVersionManager(CassandraSchemaVersionDAO schemaVersionDAO, SchemaVersion minVersion, SchemaVersion maxVersion); Mono<Boolean> isBefore(SchemaVersion minimum); Mono<SchemaVersion> computeVersion(); SchemaVersion getMinimumSupportedVersion(); SchemaVersion getMaximumSupportedVersion(); SchemaState computeSchemaState(); static final SchemaVersion MIN_VERSION; static final SchemaVersion MAX_VERSION; static final SchemaVersion DEFAULT_VERSION; }