NamespaceAwareCoordinatorStreamStore implements MetadataStore { @Override public void delete(String key) { String coordinatorMessageKeyAsJson = getCoordinatorMessageKey(key); metadataStore.delete(coordinatorMessageKeyAsJson); } NamespaceAwareCoordinatorStreamStore(MetadataStore metadataStore, String namespace); @Override void init(); @Override byte[] get(String key); @Override void put(String key, byte[] value); @Override void putAll(Map<String, byte[]> entries); @Override void delete(String key); @Override Map<String, byte[]> all(); @Override void flush(); @Override void close();  }
@Test public void testDeleteShouldDelegateTheInvocationToUnderlyingStore() { String namespacedKey = CoordinatorStreamStore.serializeCoordinatorMessageKeyToJson(namespace, KEY1); namespaceAwareCoordinatorStreamStore.delete(KEY1); Mockito.verify(coordinatorStreamStore).delete(namespacedKey); }