### Question:
RootRangeStoreImpl implements RootRangeStore { @Override public CompletableFuture<GetStreamResponse> getStream(GetStreamRequest request) { if (IdCase.STREAM_ID == request.getIdCase()) { return streamPropertiesToResponse( getStreamProps(request.getStreamId())); } else if (IdCase.STREAM_NAME == request.getIdCase()) { return getStreamProps(request.getStreamName()); } else { return FutureUtils.value(GetStreamResponse.newBuilder() .setCode(StatusCode.ILLEGAL_OP) .build()); } } 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 testGetStreamInvalidName() throws Exception { String nsName = name.getMethodName(); String streamName = ""; CompletableFuture<GetStreamResponse> getFuture = rootRangeStore.getStream( createGetStreamRequest(nsName, streamName)); GetStreamResponse response = FutureUtils.result(getFuture); assertEquals(StatusCode.INVALID_STREAM_NAME, response.getCode()); }
@Test public void testGetStreamNamespaceNotFound() throws Exception { String nsName = name.getMethodName(); String streamName = name.getMethodName(); CompletableFuture<GetStreamResponse> getFuture = rootRangeStore.getStream( createGetStreamRequest(nsName, streamName)); GetStreamResponse response = FutureUtils.result(getFuture); assertEquals(StatusCode.NAMESPACE_NOT_FOUND, response.getCode()); }
@Test public void testGetStreamNotFound() throws Exception { String nsName = name.getMethodName(); String streamName = name.getMethodName(); createNamespaceAndVerify(nsName, 0L); verifyStreamId(-1); CompletableFuture<GetStreamResponse> getFuture = rootRangeStore.getStream( createGetStreamRequest(nsName, streamName)); GetStreamResponse response = FutureUtils.result(getFuture); assertEquals(StatusCode.STREAM_NOT_FOUND, response.getCode()); }
@Test public void testGetStreamByIdNotFound() throws Exception { String nsName = name.getMethodName(); createNamespaceAndVerify(nsName, 0L); verifyStreamId(-1); CompletableFuture<GetStreamResponse> getFuture = rootRangeStore.getStream( createGetStreamRequest(MIN_DATA_STREAM_ID)); GetStreamResponse response = FutureUtils.result(getFuture); assertEquals(StatusCode.STREAM_NOT_FOUND, response.getCode()); }