Search in sources :

Example 1 with ExternalStoreId

use of org.neo4j.storageengine.api.ExternalStoreId in project neo4j by neo4j.

the class MetaDataStoreTest method setExternalStoreIdShouldSetAllRelatedFields.

@Test
void setExternalStoreIdShouldSetAllRelatedFields() throws IOException {
    // given
    UUID externalStoreId = UUID.randomUUID();
    // when
    try (MetaDataStore store = newMetaDataStore()) {
        MetaDataStore.setExternalStoreUUID(pageCache, store.getStorageFile(), externalStoreId, databaseLayout.getDatabaseName(), NULL);
    }
    // then
    try (MetaDataStore store = newMetaDataStore()) {
        Optional<ExternalStoreId> retrievedExternalStoreIdOptional = store.getExternalStoreId();
        assertTrue(retrievedExternalStoreIdOptional.isPresent());
        ExternalStoreId retrievedExternalStoreId = retrievedExternalStoreIdOptional.get();
        assertEquals(externalStoreId, retrievedExternalStoreId.getId());
    }
}
Also used : ExternalStoreId(org.neo4j.storageengine.api.ExternalStoreId) UUID(java.util.UUID) Test(org.junit.jupiter.api.Test)

Aggregations

UUID (java.util.UUID)1 Test (org.junit.jupiter.api.Test)1 ExternalStoreId (org.neo4j.storageengine.api.ExternalStoreId)1