Search in sources :

Example 1 with InMemoryMetadataStore

use of org.apache.samza.metadatastore.InMemoryMetadataStore in project samza by apache.

the class TestLocalApplicationRunner method testCreateCoordinatorStreamWithoutCoordinatorFactory.

/**
 * Underlying coordinator stream should not be created if not using CoordinatorStreamMetadataStoreFactory
 */
@Test
public void testCreateCoordinatorStreamWithoutCoordinatorFactory() throws Exception {
    SystemAdmins systemAdmins = mock(SystemAdmins.class);
    PowerMockito.whenNew(SystemAdmins.class).withAnyArguments().thenReturn(systemAdmins);
    LocalApplicationRunner localApplicationRunner = spy(new LocalApplicationRunner(mockApp, config, new InMemoryMetadataStoreFactory()));
    doReturn(false).when(localApplicationRunner).createUnderlyingCoordinatorStream(eq(config));
    MetadataStore coordinatorStreamStore = localApplicationRunner.createCoordinatorStreamStore(config);
    assertTrue(coordinatorStreamStore instanceof InMemoryMetadataStore);
    // creating underlying coordinator stream should not be called for other coordinator stream metadata store types.
    verify(localApplicationRunner, never()).createUnderlyingCoordinatorStream(eq(config));
}
Also used : InMemoryMetadataStore(org.apache.samza.metadatastore.InMemoryMetadataStore) MetadataStore(org.apache.samza.metadatastore.MetadataStore) ZkMetadataStore(org.apache.samza.zk.ZkMetadataStore) InMemoryMetadataStore(org.apache.samza.metadatastore.InMemoryMetadataStore) InMemoryMetadataStoreFactory(org.apache.samza.metadatastore.InMemoryMetadataStoreFactory) SystemAdmins(org.apache.samza.system.SystemAdmins) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Aggregations

InMemoryMetadataStore (org.apache.samza.metadatastore.InMemoryMetadataStore)1 InMemoryMetadataStoreFactory (org.apache.samza.metadatastore.InMemoryMetadataStoreFactory)1 MetadataStore (org.apache.samza.metadatastore.MetadataStore)1 SystemAdmins (org.apache.samza.system.SystemAdmins)1 ZkMetadataStore (org.apache.samza.zk.ZkMetadataStore)1 Test (org.junit.Test)1 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)1