use of org.apache.bookkeeper.stream.proto.storage.DeleteStreamResponse in project bookkeeper by apache.
the class TestRootRangeStoreImpl method testDeleteStreamNamespaceNotFound.
@Test
public void testDeleteStreamNamespaceNotFound() throws Exception {
String nsName = name.getMethodName();
String streamName = name.getMethodName();
CompletableFuture<DeleteStreamResponse> deleteFuture = rootRangeStore.deleteStream(createDeleteStreamRequest(nsName, streamName));
DeleteStreamResponse response = FutureUtils.result(deleteFuture);
assertEquals(StatusCode.NAMESPACE_NOT_FOUND, response.getCode());
}
use of org.apache.bookkeeper.stream.proto.storage.DeleteStreamResponse in project bookkeeper by apache.
the class TestRootRangeStoreImpl method testDeleteStreamSuccess.
@Test
public void testDeleteStreamSuccess() throws Exception {
String nsName = name.getMethodName();
String streamName = name.getMethodName();
CreateNamespaceResponse createResp = createNamespaceAndVerify(nsName, 0L);
createStreamAndVerify(nsName, streamName, MIN_DATA_STREAM_ID);
verifyStreamExists(createResp.getColProps().getNamespaceId(), streamName, MIN_DATA_STREAM_ID);
verifyStreamId(MIN_DATA_STREAM_ID);
CompletableFuture<DeleteStreamResponse> deleteFuture = rootRangeStore.deleteStream(createDeleteStreamRequest(nsName, streamName));
DeleteStreamResponse deleteResp = FutureUtils.result(deleteFuture);
assertEquals(StatusCode.SUCCESS, deleteResp.getCode());
verifyStreamNotExists(createResp.getColProps().getNamespaceId(), streamName, MIN_DATA_STREAM_ID);
verifyStreamId(MIN_DATA_STREAM_ID);
}
use of org.apache.bookkeeper.stream.proto.storage.DeleteStreamResponse in project bookkeeper by apache.
the class TestRootRangeStoreImpl method testDeleteStreamInvalidName.
@Test
public void testDeleteStreamInvalidName() throws Exception {
String nsName = name.getMethodName();
String streamName = "";
CompletableFuture<DeleteStreamResponse> deleteFuture = rootRangeStore.deleteStream(createDeleteStreamRequest(nsName, streamName));
DeleteStreamResponse response = FutureUtils.result(deleteFuture);
assertEquals(StatusCode.INVALID_STREAM_NAME, response.getCode());
}
Aggregations