@Test
public void testGetVersion() {

    // version is cached for 30 seconds by default
    database.setResolverStateRefreshTimeMillis(100);
    consistently("uninitialized version is 0", () -> {
        try (FDBRecordContext context = database.openContext()) {
            return globalScope.getVersion(context.getTimer()).join();
        }
    }, is(0), 200, 10);
    globalScope.incrementVersion().join();
    eventually("version changes to 1", () -> {
        try (FDBRecordContext context = database.openContext()) {
            return globalScope.getVersion(context.getTimer()).join();
        }
    }, is(1), 120, 10);
    globalScope.incrementVersion().join();
    eventually("version changes to 2", () -> {
        try (FDBRecordContext context = database.openContext()) {
            return globalScope.getVersion(context.getTimer()).join();
        }
    }, is(2), 120, 10);
}