@Test
public void testConvertProtoToFileDeletionTask() throws Exception {

  DeletionService deletionService = mock(DeletionService.class);
  int id = 0;
  String user = "user";
  Path subdir = new Path("subdir");
  Path basedir = new Path("basedir");
  DeletionServiceDeleteTaskProto.Builder protoBuilder =
      DeletionServiceDeleteTaskProto.newBuilder();
  protoBuilder
      .setId(id)
      .setUser("user")
      .setSubdir(subdir.getName())
      .addBasedirs(basedir.getName());
  DeletionServiceDeleteTaskProto proto = protoBuilder.build();
  DeletionTask deletionTask =
      NMProtoUtils.convertProtoToFileDeletionTask(proto, deletionService, id);
  assertEquals(DeletionTaskType.FILE.name(),
      deletionTask.getDeletionTaskType().name());
  assertEquals(id, deletionTask.getTaskId());
  assertEquals(subdir, ((FileDeletionTask) deletionTask).getSubDir());
  assertEquals(basedir,
      ((FileDeletionTask) deletionTask).getBaseDirs().get(0));
}