ArtifactIdFilter implements Filter { @Override public boolean filter(final Object datamodelObj) { if(datamodelObj instanceof DbArtifact){ return artifactId.equals( ((DbArtifact)datamodelObj).getArtifactId()); } return false; } ArtifactIdFilter(final String artifactId); @Override boolean filter(final Object datamodelObj); @Override Map<String, Object> moduleFilterFields(); @Override Map<String, Object> artifactFilterFields();  }
@Test public void approveNull(){ final ArtifactIdFilter filter = new ArtifactIdFilter("test"); assertFalse(filter.filter(null)); }
@Test public void approveArtifact(){ final DbArtifact artifact = new DbArtifact(); artifact.setArtifactId("artifactIdTest"); ArtifactIdFilter filter = new ArtifactIdFilter(artifact.getArtifactId()); assertTrue(filter.filter(artifact)); filter = new ArtifactIdFilter("test"); assertFalse(filter.filter(artifact)); }