use of org.apache.kafka.test.StateStoreProviderStub in project kafka by apache.
the class CompositeReadOnlyWindowStoreTest method emptyIteratorAlwaysReturnsFalse.
@Test
public void emptyIteratorAlwaysReturnsFalse() throws Exception {
final CompositeReadOnlyWindowStore<Object, Object> store = new CompositeReadOnlyWindowStore<>(new StateStoreProviderStub(false), QueryableStoreTypes.windowStore(), "foo");
final WindowStoreIterator<Object> windowStoreIterator = store.fetch("key", 1, 10);
Assert.assertFalse(windowStoreIterator.hasNext());
}
use of org.apache.kafka.test.StateStoreProviderStub in project kafka by apache.
the class CompositeReadOnlyWindowStoreTest method emptyIteratorPeekNextKeyShouldThrowNoSuchElementException.
@Test
public void emptyIteratorPeekNextKeyShouldThrowNoSuchElementException() throws Exception {
final CompositeReadOnlyWindowStore<Object, Object> store = new CompositeReadOnlyWindowStore<>(new StateStoreProviderStub(false), QueryableStoreTypes.windowStore(), "foo");
final WindowStoreIterator<Object> windowStoreIterator = store.fetch("key", 1, 10);
windowStoreIteratorException.expect(NoSuchElementException.class);
windowStoreIterator.peekNextKey();
}
use of org.apache.kafka.test.StateStoreProviderStub in project apache-kafka-on-k8s by banzaicloud.
the class WrappingStoreProviderTest method before.
@Before
public void before() {
final StateStoreProviderStub stubProviderOne = new StateStoreProviderStub(false);
final StateStoreProviderStub stubProviderTwo = new StateStoreProviderStub(false);
stubProviderOne.addStore("kv", StateStoreTestUtils.newKeyValueStore("kv", "app-id", String.class, String.class));
stubProviderOne.addStore("window", new NoOpWindowStore());
stubProviderTwo.addStore("kv", StateStoreTestUtils.newKeyValueStore("kv", "app-id", String.class, String.class));
stubProviderTwo.addStore("window", new NoOpWindowStore());
wrappingStoreProvider = new WrappingStoreProvider(Arrays.<StateStoreProvider>asList(stubProviderOne, stubProviderTwo));
}
use of org.apache.kafka.test.StateStoreProviderStub in project apache-kafka-on-k8s by banzaicloud.
the class CompositeReadOnlyKeyValueStoreTest method before.
@Before
public void before() {
final StateStoreProviderStub stubProviderOne = new StateStoreProviderStub(false);
stubProviderTwo = new StateStoreProviderStub(false);
stubOneUnderlying = newStoreInstance();
stubProviderOne.addStore(storeName, stubOneUnderlying);
otherUnderlyingStore = newStoreInstance();
stubProviderOne.addStore("other-store", otherUnderlyingStore);
theStore = new CompositeReadOnlyKeyValueStore<>(new WrappingStoreProvider(Arrays.<StateStoreProvider>asList(stubProviderOne, stubProviderTwo)), QueryableStoreTypes.<String, String>keyValueStore(), storeName);
}
use of org.apache.kafka.test.StateStoreProviderStub in project apache-kafka-on-k8s by banzaicloud.
the class CompositeReadOnlySessionStoreTest method shouldThrowInvalidStateStoreExceptionOnRebalance.
@Test(expected = InvalidStateStoreException.class)
public void shouldThrowInvalidStateStoreExceptionOnRebalance() {
final CompositeReadOnlySessionStore<String, String> store = new CompositeReadOnlySessionStore<>(new StateStoreProviderStub(true), QueryableStoreTypes.<String, String>sessionStore(), "whateva");
store.fetch("a");
}
Aggregations