use of org.apache.kafka.test.StateStoreProviderStub in project apache-kafka-on-k8s by banzaicloud.
the class QueryableStoreProviderTest method before.
@Before
public void before() {
final StateStoreProviderStub theStoreProvider = new StateStoreProviderStub(false);
theStoreProvider.addStore(keyValueStore, new NoOpReadOnlyStore<>());
theStoreProvider.addStore(windowStore, new NoOpWindowStore());
globalStateStores = new HashMap<>();
storeProvider = new QueryableStoreProvider(Collections.<StateStoreProvider>singletonList(theStoreProvider), new GlobalStateStoreProvider(globalStateStores));
}
use of org.apache.kafka.test.StateStoreProviderStub in project apache-kafka-on-k8s by banzaicloud.
the class CompositeReadOnlyWindowStoreTest method before.
@Before
public void before() {
stubProviderOne = new StateStoreProviderStub(false);
stubProviderTwo = new StateStoreProviderStub(false);
underlyingWindowStore = new ReadOnlyWindowStoreStub<>(WINDOW_SIZE);
stubProviderOne.addStore(storeName, underlyingWindowStore);
otherUnderlyingStore = new ReadOnlyWindowStoreStub<>(WINDOW_SIZE);
stubProviderOne.addStore("other-window-store", otherUnderlyingStore);
windowStore = new CompositeReadOnlyWindowStore<>(new WrappingStoreProvider(Arrays.<StateStoreProvider>asList(stubProviderOne, stubProviderTwo)), QueryableStoreTypes.<String, String>windowStore(), storeName);
}
use of org.apache.kafka.test.StateStoreProviderStub in project apache-kafka-on-k8s by banzaicloud.
the class CompositeReadOnlyWindowStoreTest method emptyIteratorPeekNextKeyShouldThrowNoSuchElementException.
@Test
public void emptyIteratorPeekNextKeyShouldThrowNoSuchElementException() {
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 CompositeReadOnlyWindowStoreTest method shouldThrowInvalidStateStoreExceptionOnRebalance.
@Test(expected = InvalidStateStoreException.class)
public void shouldThrowInvalidStateStoreExceptionOnRebalance() {
final CompositeReadOnlyWindowStore<Object, Object> store = new CompositeReadOnlyWindowStore<>(new StateStoreProviderStub(true), QueryableStoreTypes.windowStore(), "foo");
store.fetch("key", 1, 10);
}
use of org.apache.kafka.test.StateStoreProviderStub in project apache-kafka-on-k8s by banzaicloud.
the class CompositeReadOnlyWindowStoreTest method emptyIteratorNextShouldThrowNoSuchElementException.
@Test
public void emptyIteratorNextShouldThrowNoSuchElementException() {
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.next();
}
Aggregations