@Test public void shouldValidateOnlyFacilityAndThrowErrorBasedOnThatIfParentNull() throws Exception { Facility facility = make(a(defaultFacility, with(active, false))); assertFalse(facility.isValid(null)); }
public boolean isValid(Facility parentFacility) { if (parentFacility == null) return active && enabled; return active && enabled && parentFacility.active && parentFacility.enabled; }
Facility extends BaseModel implements Importable { public boolean isValid(Facility parentFacility) { if (parentFacility == null) return active && enabled; return active && enabled && parentFacility.active && parentFacility.enabled; } }
Facility extends BaseModel implements Importable { public boolean isValid(Facility parentFacility) { if (parentFacility == null) return active && enabled; return active && enabled && parentFacility.active && parentFacility.enabled; } 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 { public boolean isValid(Facility parentFacility) { if (parentFacility == null) return active && enabled; return active && enabled && parentFacility.active && parentFacility.enabled; } 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 { public boolean isValid(Facility parentFacility) { if (parentFacility == null) return active && enabled; return active && enabled && parentFacility.active && parentFacility.enabled; } 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);  }