@Test public void shouldReturnFalseIfTwoFacilityAreUnequalIgnoringProgramsSupported() { Facility facilityWithPrograms = make(a(FacilityBuilder.defaultFacility)); List<ProgramSupported> programsForFacility = new ArrayList<ProgramSupported>() {{ add(make(a(defaultProgramSupported))); add(make(a(defaultProgramSupported, with(supportedProgram, new Program(2L))))); }}; facilityWithPrograms.setSupportedPrograms(programsForFacility); Facility facilityWithoutPrograms = make(a(FacilityBuilder.defaultFacility, with(code, "F111"))); assertFalse(facilityWithPrograms.equals(facilityWithoutPrograms)); }
@Override public boolean equals(Object o) { return reflectionEquals(this, o, false, Facility.class, "supportedPrograms", "geographicZone") && reflectionEquals(this.geographicZone, ((Facility) o).geographicZone, false, GeographicZone.class, "parent", "level"); }
Facility extends BaseModel implements Importable { @Override public boolean equals(Object o) { return reflectionEquals(this, o, false, Facility.class, "supportedPrograms", "geographicZone") && reflectionEquals(this.geographicZone, ((Facility) o).geographicZone, false, GeographicZone.class, "parent", "level"); } }
Facility extends BaseModel implements Importable { @Override public boolean equals(Object o) { return reflectionEquals(this, o, false, Facility.class, "supportedPrograms", "geographicZone") && reflectionEquals(this.geographicZone, ((Facility) o).geographicZone, false, GeographicZone.class, "parent", "level"); } Facility(Long id);  Facility(Long id, String code, String name, FacilityOperator operatedBy, GeographicZone geographicZone, FacilityType facilityType, boolean virtualFacility);  Facility(Long id, boolean enabled, boolean active, Long modifiedBy); }
Facility extends BaseModel implements Importable { @Override public boolean equals(Object o) { return reflectionEquals(this, o, false, Facility.class, "supportedPrograms", "geographicZone") && reflectionEquals(this.geographicZone, ((Facility) o).geographicZone, false, GeographicZone.class, "parent", "level"); } Facility(Long id);  Facility(Long id, String code, String name, FacilityOperator operatedBy, GeographicZone geographicZone, FacilityType facilityType, boolean virtualFacility);  Facility(Long id, boolean enabled, boolean active, Long modifiedBy); @Override boolean equals(Object o); @Override int hashCode(); Facility basicInformation(); static Facility createFacilityToBeDeleted(Long facilityId, Long modifiedBy); static Facility createFacilityToBeRestored(Long facilityId, Long modifiedBy); void validate(); boolean isValid(Facility parentFacility); @SuppressWarnings("unused") String getStringGoLiveDate(); @SuppressWarnings("unused") String getStringGoDownDate(); @JsonIgnore Double getWhoRatioFor(String productCode); static List<Facility> filterForActiveProducts(List<Facility> facilities); @JsonIgnore Integer getPackSizeFor(String productCode); }
Facility extends BaseModel implements Importable { @Override public boolean equals(Object o) { return reflectionEquals(this, o, false, Facility.class, "supportedPrograms", "geographicZone") && reflectionEquals(this.geographicZone, ((Facility) o).geographicZone, false, GeographicZone.class, "parent", "level"); } Facility(Long id);  Facility(Long id, String code, String name, FacilityOperator operatedBy, GeographicZone geographicZone, FacilityType facilityType, boolean virtualFacility);  Facility(Long id, boolean enabled, boolean active, Long modifiedBy); @Override boolean equals(Object o); @Override int hashCode(); Facility basicInformation(); static Facility createFacilityToBeDeleted(Long facilityId, Long modifiedBy); static Facility createFacilityToBeRestored(Long facilityId, Long modifiedBy); void validate(); boolean isValid(Facility parentFacility); @SuppressWarnings("unused") String getStringGoLiveDate(); @SuppressWarnings("unused") String getStringGoDownDate(); @JsonIgnore Double getWhoRatioFor(String productCode); static List<Facility> filterForActiveProducts(List<Facility> facilities); @JsonIgnore Integer getPackSizeFor(String productCode);  }