### Question:
RootRangeStoreImpl implements RootRangeStore { @Override public CompletableFuture<GetNamespaceResponse> getNamespace(GetNamespaceRequest request) { String nsName = request.getName(); if (!validateNamespaceName(nsName)) { log.error("Failed to get namespace due to invalid namespace name {}", nsName); return FutureUtils.value( GetNamespaceResponse.newBuilder() .setCode(StatusCode.INVALID_NAMESPACE_NAME) .build()); } else { return getNamespace(request.getName()).thenApply(nsMetadata -> { GetNamespaceResponse.Builder nsRespBuilder = GetNamespaceResponse.newBuilder(); if (null == nsMetadata) { nsRespBuilder.setCode(StatusCode.NAMESPACE_NOT_FOUND); } else { nsRespBuilder.setCode(StatusCode.SUCCESS); nsRespBuilder.setNsProps(nsMetadata.getProps()); } return nsRespBuilder.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 testGetNamespaceInvalidName() throws Exception { String nsName = ""; CompletableFuture<GetNamespaceResponse> getFuture = rootRangeStore.getNamespace( createGetNamespaceRequest(nsName)); GetNamespaceResponse response = FutureUtils.result(getFuture); assertEquals(StatusCode.INVALID_NAMESPACE_NAME, response.getCode()); }
@Test public void testGetNamespaceNotFound() throws Exception { String nsName = name.getMethodName(); CompletableFuture<GetNamespaceResponse> getFuture = rootRangeStore.getNamespace( createGetNamespaceRequest(nsName)); GetNamespaceResponse response = FutureUtils.result(getFuture); assertEquals(StatusCode.NAMESPACE_NOT_FOUND, response.getCode()); verifyNamespaceNotExists(nsName, 0L); verifyNamespaceId(-1L); }