MetadataField implements ReloadableEntity<Integer> { @Override public boolean equals(Object obj) { if (obj == null) { return false; } Class<?> objClass = HibernateProxyHelper.getClassWithoutInitializingProxy(obj); if (getClass() != objClass) { return false; } final MetadataField other = (MetadataField) obj; if (this.getID() != other.getID()) { return false; } if (!getMetadataSchema().equals(other.getMetadataSchema())) { return false; } return true; } protected  MetadataField(); Integer getID(); String getElement(); void setElement(String element); String getQualifier(); void setQualifier(String qualifier); String getScopeNote(); void setScopeNote(String scopeNote); MetadataSchema getMetadataSchema(); void setMetadataSchema(MetadataSchema metadataSchema); @Override boolean equals(Object obj); @Override int hashCode(); String toString(char separator); @Override String toString();  }
@Test public void testFindAll() throws Exception { List<MetadataField> found = metadataFieldService.findAll(context); assertThat("testFindAll 0",found, notNullValue()); assertTrue("testFindAll 1",found.size() >= 1); boolean added = false; for(MetadataField mdf: found) { if(mdf.equals(mf)) { added = true; } } assertTrue("testFindAll 2",added); }
@Test public void testFindAllInSchema() throws Exception { List<MetadataField> found = metadataFieldService.findAllInSchema(context, metadataSchemaService.find(context, MetadataSchema.DC_SCHEMA)); assertThat("testFindAllInSchema 0",found, notNullValue()); assertTrue("testFindAllInSchema 1",found.size() >= 1); assertTrue("testFindAllInSchema 2",found.size() <= metadataFieldService.findAll(context).size()); boolean added = false; for(MetadataField mdf: found) { if(mdf.equals(mf)) { added = true; } } assertTrue("testFindAllInSchema 3",added); }