Search in sources :

Example 6 with CreateNamespaceRequest

use of org.apache.bookkeeper.stream.proto.storage.CreateNamespaceRequest in project bookkeeper by apache.

the class StorageContainerImplTest method testCreateNamespace.

// 
// Root Range Methods
// 
@Test
public void testCreateNamespace() throws Exception {
    mockStorageContainer(SCID);
    CreateNamespaceResponse expectedResp = CreateNamespaceResponse.getDefaultInstance();
    when(rrStore.createNamespace(any(CreateNamespaceRequest.class))).thenReturn(FutureUtils.value(expectedResp));
    CreateNamespaceRequest expectedReq = CreateNamespaceRequest.getDefaultInstance();
    assertSame(expectedResp, FutureUtils.result(rrStore.createNamespace(expectedReq)));
    verify(rrStore, times(1)).createNamespace(same(expectedReq));
}
Also used : CreateNamespaceResponse(org.apache.bookkeeper.stream.proto.storage.CreateNamespaceResponse) CreateNamespaceRequest(org.apache.bookkeeper.stream.proto.storage.CreateNamespaceRequest) Test(org.junit.Test)

Aggregations

CreateNamespaceRequest (org.apache.bookkeeper.stream.proto.storage.CreateNamespaceRequest)6 CreateNamespaceResponse (org.apache.bookkeeper.stream.proto.storage.CreateNamespaceResponse)5 Test (org.junit.Test)5 ProtoUtils.createCreateNamespaceRequest (org.apache.bookkeeper.stream.protocol.util.ProtoUtils.createCreateNamespaceRequest)4 StreamObserver (io.grpc.stub.StreamObserver)2 CountDownLatch (java.util.concurrent.CountDownLatch)2 AtomicReference (java.util.concurrent.atomic.AtomicReference)2 UTF_8 (com.google.common.base.Charsets.UTF_8)1 ByteString (com.google.protobuf.ByteString)1 InvalidProtocolBufferException (com.google.protobuf.InvalidProtocolBufferException)1 URI (java.net.URI)1 CompletableFuture (java.util.concurrent.CompletableFuture)1 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)1 Slf4j (lombok.extern.slf4j.Slf4j)1 CompareResult (org.apache.bookkeeper.api.kv.op.CompareResult)1 RangeOp (org.apache.bookkeeper.api.kv.op.RangeOp)1 TxnOp (org.apache.bookkeeper.api.kv.op.TxnOp)1 Options (org.apache.bookkeeper.api.kv.options.Options)1 KeyValue (org.apache.bookkeeper.api.kv.result.KeyValue)1 FutureUtils (org.apache.bookkeeper.common.concurrent.FutureUtils)1