@Test
public void testGetStore() throws IOException {

    File baseDir = Files.createTempDirectory(stateDir).toFile();
    try {
        MockRestoreConsumer restoreConsumer = new MockRestoreConsumer();
        restoreConsumer.updatePartitions(nonPersistentStoreTopicName, Utils.mkList(
                new PartitionInfo(nonPersistentStoreTopicName, 1, Node.noNode(), new Node[0], new Node[0])
        ));
        MockStateStoreSupplier.MockStateStore mockStateStore = new MockStateStoreSupplier.MockStateStore(nonPersistentStoreName, false);
        ProcessorStateManager stateMgr = new ProcessorStateManager(applicationId, 1, noPartitions, baseDir, restoreConsumer, false);
        try {
            stateMgr.register(mockStateStore, true, mockStateStore.stateRestoreCallback);
            assertNull(stateMgr.getStore("noSuchStore"));
            assertEquals(mockStateStore, stateMgr.getStore(nonPersistentStoreName));
        } finally {
            stateMgr.close(Collections.<TopicPartition, Long>emptyMap());
        }
    } finally {
        Utils.delete(baseDir);
    }
}