@Test
  public void removeBlobStoreFailureTest() throws Exception {
    // first, create new partition but don't add to current node
    PartitionId newPartition = clusterMap.createNewPartition(clusterMap.getDataNodes());
    // test store removal failure because store doesn't exist
    sendAndVerifyStoreControlRequest(newPartition, BlobStoreControlAction.RemoveStore, (short) 0,
        ServerErrorCode.PartitionUnknown);
    // add store on current node for store removal testing
    sendAndVerifyStoreControlRequest(newPartition, BlobStoreControlAction.AddStore, (short) 0, ServerErrorCode.NoError);
    // mock exception in StorageManager
    storageManager.returnValueOfRemoveBlobStore = false;
    sendAndVerifyStoreControlRequest(newPartition, BlobStoreControlAction.RemoveStore, (short) 0,
        ServerErrorCode.UnknownError);
    storageManager.returnValueOfRemoveBlobStore = true;
    // mock exception when deleting files of removed store
    BlobStore mockStore = Mockito.mock(BlobStore.class);
    storageManager.overrideStoreToReturn = mockStore;
    doThrow(new IOException()).when(mockStore).deleteStoreFiles();
    sendAndVerifyStoreControlRequest(newPartition, BlobStoreControlAction.RemoveStore, (short) 0,
        ServerErrorCode.UnknownError);
    // test store removal success case
    doNothing().when(mockStore).deleteStoreFiles();
    Mockito.when(mockStore.getReplicaStatusDelegates()).thenReturn(Collections.singletonList(mockDelegate));
    sendAndVerifyStoreControlRequest(newPartition, BlobStoreControlAction.RemoveStore, (short) 0,
        ServerErrorCode.NoError);
    storageManager.overrideStoreToReturn = null;
  }
Tests for the response received on a {@link BlobStoreControlAdminRequest} for successful case
@throws InterruptedException
@throws IOException
ambry-server/src/test/java/com/github/ambry/server/AmbryServerRequestsTest.java