Content extends AbstractHibernateObject implements SharedEntity, Cloneable, ContentInfo { public Content() { this.modifiedProductIds = new HashSet<>(); } Content();  Content(String id);  Content(String id, String name, String type, String label, String vendor); protected  Content(Content source); Content merge(Content source); @Override Content clone(); ContentData toDTO(); String getUuid(); void setUuid(String uuid); @Override String getId(); void setId(String id); @Override String getType(); void setType(String type); @Override String getLabel(); void setLabel(String label); @Override String getName(); void setName(String name); @Override String getVendor(); void setVendor(String vendor); @Override String getContentUrl(); void setContentUrl(String contentUrl); @Override String getRequiredTags(); void setRequiredTags(String requiredTags); @Override String getReleaseVersion(); void setReleaseVersion(String releaseVer); @Override String getGpgUrl(); void setGpgUrl(String gpgUrl); @Override Long getMetadataExpiration(); void setMetadataExpiration(Long metadataExpire); Collection<String> getModifiedProductIds(); @Override Collection<String> getRequiredProductIds(); boolean addModifiedProductId(String productId); boolean removeModifiedProductId(String productId); Content setModifiedProductIds(Collection<String> requiredProductIds); void setArches(String arches); @Override String getArches(); @XmlTransient @JsonIgnore Content setLocked(boolean locked); @XmlTransient boolean isLocked(); @Override boolean equals(Object other); @Override int hashCode(); int getEntityVersion(); @Override String toString(); @PrePersist @PreUpdate void updateEntityVersion(); static final String DB_TABLE; }
@Test public void testContent() { Owner owner = new Owner("Example-Corporation"); ownerCurator.create(owner); Content content = TestUtil.createContent("test-content"); HashSet<String> modifiedProductIds = new HashSet<>(); modifiedProductIds.add("ProductA"); modifiedProductIds.add("ProductB"); content.setModifiedProductIds(modifiedProductIds); Long metadataExpire = new Long(60 * 60 * 24); content.setMetadataExpiration(metadataExpire); contentCurator.create(content); Content lookedUp = contentCurator.get(content.getUuid()); assertEquals(content.getContentUrl(), lookedUp.getContentUrl()); MatcherAssert.assertThat(lookedUp.getModifiedProductIds(), Matchers.hasItem("ProductB")); assertEquals(metadataExpire, lookedUp.getMetadataExpiration()); }