use of org.apache.bookkeeper.stream.proto.storage.GetNamespaceResponse in project bookkeeper by apache.
the class TestRootRangeStoreImpl method testGetNamespaceNotFound.
@Test
public void testGetNamespaceNotFound() throws Exception {
String nsName = name.getMethodName();
CompletableFuture<GetNamespaceResponse> getFuture = rootRangeStore.getNamespace(createGetNamespaceRequest(nsName));
// create first namespace
GetNamespaceResponse response = FutureUtils.result(getFuture);
assertEquals(StatusCode.NAMESPACE_NOT_FOUND, response.getCode());
verifyNamespaceNotExists(nsName, 0L);
verifyNamespaceId(-1L);
}
use of org.apache.bookkeeper.stream.proto.storage.GetNamespaceResponse in project bookkeeper by apache.
the class StorageContainerImplTest method testGetNamespace.
@Test
public void testGetNamespace() throws Exception {
mockStorageContainer(SCID);
GetNamespaceResponse expectedResp = GetNamespaceResponse.getDefaultInstance();
when(rrStore.getNamespace(any(GetNamespaceRequest.class))).thenReturn(FutureUtils.value(expectedResp));
GetNamespaceRequest expectedReq = GetNamespaceRequest.getDefaultInstance();
assertSame(expectedResp, FutureUtils.result(rrStore.getNamespace(expectedReq)));
verify(rrStore, times(1)).getNamespace(same(expectedReq));
}
Aggregations