@Test public void approveArtifact(){ final DbArtifact artifactWithLicense = new DbArtifact(); final DbLicense license = new DbLicense(); license.setName("licenseName"); artifactWithLicense.addLicense(license); final DbArtifact artifactWithoutLicense = new DbArtifact(); HasLicenseFilter filter = new HasLicenseFilter(true); assertTrue(filter.filter(artifactWithLicense)); assertFalse(filter.filter(artifactWithoutLicense)); filter = new HasLicenseFilter(false); assertFalse(filter.filter(artifactWithLicense)); assertTrue(filter.filter(artifactWithoutLicense)); }
@Override public boolean filter(final Object datamodelObj) { if(datamodelObj instanceof DbArtifact){ return hasLicense !=(((DbArtifact)datamodelObj).getLicenses().isEmpty()); } return false; }
HasLicenseFilter implements Filter { @Override public boolean filter(final Object datamodelObj) { if(datamodelObj instanceof DbArtifact){ return hasLicense !=(((DbArtifact)datamodelObj).getLicenses().isEmpty()); } return false; } }
HasLicenseFilter implements Filter { @Override public boolean filter(final Object datamodelObj) { if(datamodelObj instanceof DbArtifact){ return hasLicense !=(((DbArtifact)datamodelObj).getLicenses().isEmpty()); } return false; } HasLicenseFilter(final Boolean hasLicense); }
HasLicenseFilter implements Filter { @Override public boolean filter(final Object datamodelObj) { if(datamodelObj instanceof DbArtifact){ return hasLicense !=(((DbArtifact)datamodelObj).getLicenses().isEmpty()); } return false; } HasLicenseFilter(final Boolean hasLicense); @Override boolean filter(final Object datamodelObj); @Override Map<String, Object> moduleFilterFields(); @Override Map<String, Object> artifactFilterFields(); }
HasLicenseFilter implements Filter { @Override public boolean filter(final Object datamodelObj) { if(datamodelObj instanceof DbArtifact){ return hasLicense !=(((DbArtifact)datamodelObj).getLicenses().isEmpty()); } return false; } HasLicenseFilter(final Boolean hasLicense); @Override boolean filter(final Object datamodelObj); @Override Map<String, Object> moduleFilterFields(); @Override Map<String, Object> artifactFilterFields();  }