use of org.apache.kafka.test.StateStoreProviderStub in project kafka by apache.
the class CompositeReadOnlySessionStoreTest method shouldThrowInvalidStateStoreExceptionOnRebalance.
@Test
public void shouldThrowInvalidStateStoreExceptionOnRebalance() {
final QueryableStoreType<ReadOnlySessionStore<Object, Object>> queryableStoreType = QueryableStoreTypes.sessionStore();
final CompositeReadOnlySessionStore<String, String> store = new CompositeReadOnlySessionStore<>(new WrappingStoreProvider(singletonList(new StateStoreProviderStub(true)), StoreQueryParameters.fromNameAndType("whateva", queryableStoreType)), QueryableStoreTypes.sessionStore(), "whateva");
assertThrows(InvalidStateStoreException.class, () -> store.fetch("a"));
}
use of org.apache.kafka.test.StateStoreProviderStub in project kafka by apache.
the class QueryableStoreProviderTest method before.
@Before
public void before() {
final StateStoreProviderStub theStoreProvider = new StateStoreProviderStub(false);
for (int partition = 0; partition < numStateStorePartitions; partition++) {
theStoreProvider.addStore(keyValueStore, partition, new NoOpReadOnlyStore<>());
theStoreProvider.addStore(windowStore, partition, new NoOpWindowStore());
}
globalStateStores = new HashMap<>();
storeProvider = new QueryableStoreProvider(new GlobalStateStoreProvider(globalStateStores));
storeProvider.addStoreProviderForThread("thread1", theStoreProvider);
}
Aggregations