@Test public void shouldReturnPackSizeForFirstAndOnlySupportedProgram() throws Exception { ProgramSupported programSupported = mock(ProgramSupported.class); Integer packSize = 10; when(programSupported.getPackSizeFor("BCG")).thenReturn(packSize); Facility facility = make(a(defaultFacility, with(programSupportedList, asList(programSupported)))); assertThat(facility.getPackSizeFor("BCG"), is(packSize)); }
@JsonIgnore public Integer getPackSizeFor(String productCode) { return this.getSupportedPrograms().get(0).getPackSizeFor(productCode); }
Facility extends BaseModel implements Importable { @JsonIgnore public Integer getPackSizeFor(String productCode) { return this.getSupportedPrograms().get(0).getPackSizeFor(productCode); } }
Facility extends BaseModel implements Importable { @JsonIgnore public Integer getPackSizeFor(String productCode) { return this.getSupportedPrograms().get(0).getPackSizeFor(productCode); } 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 { @JsonIgnore public Integer getPackSizeFor(String productCode) { return this.getSupportedPrograms().get(0).getPackSizeFor(productCode); } 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 { @JsonIgnore public Integer getPackSizeFor(String productCode) { return this.getSupportedPrograms().get(0).getPackSizeFor(productCode); } 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);  }