use of alluxio.hub.proto.AgentRemoveFileResponse in project alluxio by Alluxio.
the class ManagerProcessContextTest method testRemoveFile.
@Test
public void testRemoveFile() {
AgentRemoveFileResponse r = AgentRemoveFileResponse.newBuilder().setSuccess(true).build();
HubNodeAddress addr = HubTestUtils.generateNodeAddress();
Map<HubNodeAddress, AgentRemoveFileResponse> resp = new HashMap<>();
resp.put(addr, r);
RemoveFile req = RemoveFile.newBuilder().setLocation(AlluxioNodeType.WORKER).setProcessType(UploadProcessType.PRESTO).setName("uptime").build();
doReturn(resp).when(mContext).execOnHub(any(), any(), any());
boolean addFileResp = mContext.removeFile(Collections.singletonList(req));
assertTrue(addFileResp);
resp.put(HubTestUtils.generateNodeAddress(), r.toBuilder().setSuccess(false).build());
assertFalse(mContext.removeFile(Collections.singletonList(req)));
}
Aggregations