use of org.apache.rya.indexing.external.accumulo.AccumuloPcjStorageSupplier in project incubator-rya by apache.
the class PrecomputedJoinStorageSupplierTest method configuredForAccumulo.
@Test
public void configuredForAccumulo() {
// Create a supplier that does not return any configuration.
final Supplier<Configuration> configSupplier = mock(Supplier.class);
final Configuration config = new Configuration();
config.set(PrecomputedJoinIndexerConfig.PCJ_STORAGE_TYPE, PrecomputedJoinStorageType.ACCUMULO.toString());
when(configSupplier.get()).thenReturn(config);
final AccumuloPcjStorageSupplier accumuloSupplier = mock(AccumuloPcjStorageSupplier.class);
final AccumuloPcjStorage mockAccumuloStorage = mock(AccumuloPcjStorage.class);
when(accumuloSupplier.get()).thenReturn(mockAccumuloStorage);
final PrecomputedJoinStorageSupplier storageSupplier = new PrecomputedJoinStorageSupplier(configSupplier, accumuloSupplier);
// Ensure the mock AccumuloPcjStorage is what was returned.
final PrecomputedJoinStorage storage = storageSupplier.get();
assertEquals(mockAccumuloStorage, storage);
}
Aggregations