@Test
public void testUpdateMetadata() {

    database.setResolverStateRefreshTimeMillis(100);
    final byte[] oldMetadata = Tuple.from("old").pack();
    final byte[] newMetadata = Tuple.from("new").pack();
    final ResolverCreateHooks hooks = new ResolverCreateHooks(DEFAULT_CHECK, ignore -> oldMetadata);
    ResolverResult initialResult;
    try (FDBRecordContext context = database.openContext()) {
        initialResult = globalScope.resolveWithMetadata(context.getTimer(), "some-key", hooks).join();
        assertArrayEquals(initialResult.getMetadata(), oldMetadata);
    }
    globalScope.updateMetadataAndVersion("some-key", newMetadata).join();
    ResolverResult expected = new ResolverResult(initialResult.getValue(), newMetadata);
    eventually("we see the new metadata", () ->
                    globalScope.resolveWithMetadata("some-key", hooks).join(),
            is(expected), 120, 10);
}