HdfsEntity extends Entity { @Override public void validateEntity() { if ((Strings.isNullOrEmpty(this.getIdentity()) && Strings.isNullOrEmpty(this.getFileSystemPath())) || Strings.isNullOrEmpty(this.getSourceId())) { throw new IllegalArgumentException( "Either the Entity Id or file system path used" + " to generate the id must be present along with the source id"); } } HdfsEntity();  HdfsEntity(String fileSystemPath, EntityType type, String sourceId);  HdfsEntity(String id); @Override void validateEntity(); void setFileSystemPath(String fileSystemPath); String getFileSystemPath(); @Override Map<String, String> getIdAttrsMap();  }
@Test(expected = IllegalArgumentException.class) public void testInvalidHdfsEntity() { HdfsEntity hdfsEntity = new HdfsEntity(); hdfsEntity.validateEntity(); }
@Test(expected = IllegalArgumentException.class) public void testInvalidHdfsEntitySourceIdAbsent2() { HdfsEntity hdfsEntity2 = new HdfsEntity(); hdfsEntity2.setIdentity("HDFS"); hdfsEntity2.validateEntity(); }
@Test(expected = IllegalArgumentException.class) public void testInvalidHdfsEntityFileSystemPathMissing() { HdfsEntity hdfsEntity = new HdfsEntity(); hdfsEntity.setSourceId("1"); hdfsEntity.validateEntity(); }