ModuleNameFilter implements Filter { @Override public boolean filter(final Object datamodelObj) { if(datamodelObj instanceof DbModule){ return moduleName.equals( ((DbModule)datamodelObj).getName()); } return false; } ModuleNameFilter(final String moduleName); @Override boolean filter(final Object datamodelObj); @Override Map<String, Object> moduleFilterFields(); @Override Map<String, Object> artifactFilterFields();  }
@Test public void approveNull(){ ModuleNameFilter filter = new ModuleNameFilter("test"); assertFalse(filter.filter(null)); }
@Test public void approveModule(){ final DbModule module = new DbModule(); module.setName("nameTest"); ModuleNameFilter filter = new ModuleNameFilter(module.getName()); assertTrue(filter.filter(module)); filter = new ModuleNameFilter("test"); assertFalse(filter.filter(module)); }