use of org.apache.bookkeeper.stream.proto.storage.StorageContainerResponse in project bookkeeper by apache.
the class StorageContainerImplTest method testPutWhenTableStoreNotCached.
@Test
public void testPutWhenTableStoreNotCached() throws Exception {
mockStorageContainer(SCID);
StorageContainerResponse expectedResp = StorageContainerResponse.getDefaultInstance();
when(trStore.put(any(StorageContainerRequest.class))).thenReturn(FutureUtils.value(expectedResp));
StorageContainerRequest request = newStorageContainerRequest(KV_PUT_REQ);
StorageContainerResponse response = FutureUtils.result(container.put(request));
assertSame(expectedResp, response);
assertSame(trStore, container.getTableStoreCache().getTableStore(RID));
}
use of org.apache.bookkeeper.stream.proto.storage.StorageContainerResponse in project bookkeeper by apache.
the class StorageContainerImplTest method testDeleteWhenTableStoreCached.
@Test
public void testDeleteWhenTableStoreCached() throws Exception {
mockStorageContainer(SCID);
StorageContainerResponse expectedResp = StorageContainerResponse.getDefaultInstance();
when(trStore.delete(any(StorageContainerRequest.class))).thenReturn(FutureUtils.value(expectedResp));
container.getTableStoreCache().getTableStores().put(RID, trStore);
StorageContainerRequest request = newStorageContainerRequest(KV_DELETE_REQ);
StorageContainerResponse response = FutureUtils.result(container.delete(request));
assertSame(expectedResp, response);
}
Aggregations