OrganizationFilter implements Filter { @Override public Map<String, Object> moduleFilterFields() { final Map<String, Object> fields = new HashMap<String, Object>(); fields.put(DbModule.ORGANIZATION_DB_FIELD, organization); return fields; } OrganizationFilter(final String organization); @Override boolean filter(final Object datamodelObj); @Override Map<String, Object> moduleFilterFields(); @Override Map<String, Object> artifactFilterFields();  }
@Test public void checkMongoRegExpGenerationForModules(){ final OrganizationFilter filter = new OrganizationFilter("organization1"); Map<String, Object> params = filter.moduleFilterFields(); assertNotNull(params); assertEquals(1, params.size()); assertEquals(DbModule.ORGANIZATION_DB_FIELD, params.keySet().iterator().next()); assertEquals("organization1", params.values().iterator().next()); }