Consumer extends AbstractHibernateObject implements Linkable, Owned, Named, ConsumerProperty,
    Eventful, ConsumerInfo { public boolean checkForCloudProfileFacts(Map<String, String> incomingFacts) { if (incomingFacts == null) { return false; } if (this.facts != null && this.facts.equals(incomingFacts)) { return false; } for (CloudProfileFacts profileFact : CloudProfileFacts.values()) { if (incomingFacts.containsKey(profileFact.getFact())) { if (this.facts == null || !this.facts.containsKey(profileFact.getFact()) || !this.facts.get(profileFact.getFact()).equals(incomingFacts.get(profileFact.getFact()))) { return true; } } } return false; } Consumer(String name, String userName, Owner owner, ConsumerType type);  Consumer(); @HateoasInclude String getUuid(); @PrePersist void ensureUUID(); Consumer setUuid(String uuid); @Override @HateoasInclude String getId(); void setId(String id); @HateoasArrayExclude IdentityCertificate getIdCert(); void setIdCert(IdentityCertificate idCert); @HateoasArrayExclude @XmlTransient ContentAccessCertificate getContentAccessCert(); void setContentAccessCert(ContentAccessCertificate contentAccessCert); @HateoasInclude String getName(); void setName(String name); String getUsername(); void setUsername(String userName); String getTypeId(); void setTypeId(String typeId); void setType(ConsumerType type); @Override String getOwnerId(); @Override @JsonIgnore Owner getOwner(); @JsonIgnore Consumer setOwner(Owner owner); @Override String toString(); @HateoasArrayExclude Map<String, String> getFacts(); boolean hasFact(String fact); String getFact(String factKey); void setFacts(Map<String, String> factsIn); boolean factsAreEqual(Map<String, String> otherFacts); void setFact(String name, String value); long getEntitlementCount(); void setEntitlementCount(long count); @XmlTransient Set<Entitlement> getEntitlements(); void setEntitlements(Set<Entitlement> entitlementsIn); void addEntitlement(Entitlement entitlementIn); void removeEntitlement(Entitlement entitlement); void setLastCheckin(Date lastCheckin); @XmlTransient KeyPair getKeyPair(); void setKeyPair(KeyPair keyPair); @Override boolean equals(Object anObject); @Override int hashCode(); @Override @HateoasInclude String getHref(); void setHref(String href); Date getLastCheckin(); boolean isCanActivate(); void setCanActivate(boolean canActivate); Set<ConsumerInstalledProduct> getInstalledProducts(); void setInstalledProducts(Set<ConsumerInstalledProduct> installedProducts); void addInstalledProduct(ConsumerInstalledProduct installed); Boolean isAutoheal(); void setAutoheal(Boolean autoheal); @JsonProperty void setGuestIds(List<GuestId> guests); @JsonIgnore List<GuestId> getGuestIds(); void addGuestId(GuestId guestId); String getEntitlementStatus(); void setEntitlementStatus(String status); String getServiceLevel(); void setServiceLevel(String level); String getRole(); void setRole(String role); String getUsage(); void setUsage(String usage); String getSystemPurposeStatus(); void setSystemPurposeStatus(String systemPurposeStatus); @XmlTransient String getSystemPurposeStatusHash(); void setSystemPurposeStatusHash(String systemPurposeStatusHash); String getEnvironmentId(); Consumer setEnvironmentId(String environmentId); Consumer setEnvironment(Environment environment); void setReleaseVer(Release releaseVer); Release getReleaseVer(); Set<ConsumerCapability> getCapabilities(); void setCapabilities(Set<ConsumerCapability> capabilities); HypervisorId getHypervisorId(); void setHypervisorId(HypervisorId hypervisorId); @XmlTransient String getComplianceStatusHash(); void setComplianceStatusHash(String complianceStatusHash); Set<String> getContentTags(); void setContentTags(Set<String> contentTags); @Override @XmlTransient Consumer getConsumer(); String getAnnotations(); void setAnnotations(String annotations); boolean isDev(); @JsonIgnore boolean isGuest(); String getContentAccessMode(); void setContentAccessMode(String contentAccessMode); Set<String> getAddOns(); void setAddOns(Set<String> addOns); void addAddOn(String addOn); void removeAddOn(String addOn); Date getRHCloudProfileModified(); void setRHCloudProfileModified(Date rhCloudProfileModified); void updateRHCloudProfileModified(); boolean checkForCloudProfileFacts(Map<String, String> incomingFacts); static final String DB_TABLE; static final int MAX_LENGTH_OF_CONSUMER_NAME; }
@Test public void testCloudProfileFactOnEmptyExistingFacts() { Consumer consumer = new Consumer(); Map<String, String> newFacts = new HashMap<>(); newFacts.put("dmi.bios.vendor", "vendorA"); assertTrue(consumer.checkForCloudProfileFacts(newFacts)); }