GavcFilter implements Filter { @Override public boolean filter(final Object datamodelObj) { if(datamodelObj instanceof DbArtifact){ return gavc.equals( ((DbArtifact)datamodelObj).getGavc()); } return false; } GavcFilter(final String gavc); @Override boolean filter(final Object datamodelObj); @Override Map<String, Object> moduleFilterFields(); @Override Map<String, Object> artifactFilterFields();  }
@Test public void approveNull(){ GavcFilter filter = new GavcFilter("test"); assertFalse(filter.filter(null)); filter = new GavcFilter("test"); assertFalse(filter.filter(null)); }
@Test public void approveArtifact(){ final DbArtifact artifact = new DbArtifact(); artifact.setGroupId("test.test.test"); artifact.setArtifactId("test"); artifact.setVersion("1.0.0-8"); GavcFilter filter = new GavcFilter(artifact.getGavc()); assertTrue(filter.filter(artifact)); filter = new GavcFilter("test"); assertFalse(filter.filter(artifact)); }