### Question:
RootRangeStoreImpl implements RootRangeStore { @Override public CompletableFuture<DeleteStreamResponse> deleteStream(DeleteStreamRequest request) { String streamName = request.getName(); String nsName = request.getNsName(); StatusCode code = verifyStreamRequest(nsName, streamName); if (StatusCode.SUCCESS != code) { return FutureUtils.value(DeleteStreamResponse.newBuilder().setCode(code).build()); } return deleteStream(nsName, streamName); } RootRangeStoreImpl(MVCCAsyncStore<byte[], byte[]> store,
                              StorageContainerPlacementPolicy placementPolicy,
                              ScheduledExecutorService executor); @Override CompletableFuture<CreateNamespaceResponse> createNamespace(CreateNamespaceRequest request); @Override CompletableFuture<DeleteNamespaceResponse> deleteNamespace(DeleteNamespaceRequest request); @Override CompletableFuture<GetNamespaceResponse> getNamespace(GetNamespaceRequest request); @Override CompletableFuture<CreateStreamResponse> createStream(CreateStreamRequest request); @Override CompletableFuture<DeleteStreamResponse> deleteStream(DeleteStreamRequest request); @Override CompletableFuture<GetStreamResponse> getStream(GetStreamRequest request);  }### Answer:
@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()); }
@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()); }
@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.getNsProps().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.getNsProps().getNamespaceId(), streamName, MIN_DATA_STREAM_ID); verifyStreamId(MIN_DATA_STREAM_ID); }
@Test public void testDeleteStreamNotFound() throws Exception { String nsName = name.getMethodName(); String streamName = name.getMethodName(); createNamespaceAndVerify(nsName, 0L); CompletableFuture<DeleteStreamResponse> deleteFuture = rootRangeStore.deleteStream( createDeleteStreamRequest(nsName, streamName)); DeleteStreamResponse response = FutureUtils.result(deleteFuture); assertEquals(StatusCode.STREAM_NOT_FOUND, response.getCode()); verifyStreamId(-1L); }