@Test public void shouldGetVisitDetailsIfFacilityVisited() throws Exception { Date visitedDate = new Date(); FacilityVisit facilityVisit = new FacilityVisit(); facilityVisit.setObservations("some"); facilityVisit.setVisited(true); facilityVisit.setConfirmedBy(new Facilitator()); facilityVisit.setVerifiedBy(new Facilitator()); facilityVisit.setVehicleId("123"); facilityVisit.setVisitDate(visitedDate); facilityVisit.setReasonForNotVisiting(ReasonForNotVisiting.HEALTH_CENTER_NOT_IN_DLS); facilityVisit.setApplicableVisitInfo(); FacilityVisit expectedFacilityVisit = new FacilityVisit(); expectedFacilityVisit.setObservations("some"); expectedFacilityVisit.setVisited(true); expectedFacilityVisit.setConfirmedBy(new Facilitator()); expectedFacilityVisit.setVerifiedBy(new Facilitator()); expectedFacilityVisit.setVehicleId("123"); expectedFacilityVisit.setVisitDate(visitedDate); assertThat(facilityVisit, is(expectedFacilityVisit)); }
public void setApplicableVisitInfo() { if (this.visited == null) { return; } if (this.visited) { this.reasonForNotVisiting = null; this.otherReasonDescription = null; return; } this.observations = null; this.confirmedBy = null; this.verifiedBy = null; this.vehicleId = null; this.visitDate = null; }
FacilityVisit extends BaseModel { public void setApplicableVisitInfo() { if (this.visited == null) { return; } if (this.visited) { this.reasonForNotVisiting = null; this.otherReasonDescription = null; return; } this.observations = null; this.confirmedBy = null; this.verifiedBy = null; this.vehicleId = null; this.visitDate = null; } }
FacilityVisit extends BaseModel { public void setApplicableVisitInfo() { if (this.visited == null) { return; } if (this.visited) { this.reasonForNotVisiting = null; this.otherReasonDescription = null; return; } this.observations = null; this.confirmedBy = null; this.verifiedBy = null; this.vehicleId = null; this.visitDate = null; } FacilityVisit(Facility facility, Distribution distribution); }
FacilityVisit extends BaseModel { public void setApplicableVisitInfo() { if (this.visited == null) { return; } if (this.visited) { this.reasonForNotVisiting = null; this.otherReasonDescription = null; return; } this.observations = null; this.confirmedBy = null; this.verifiedBy = null; this.vehicleId = null; this.visitDate = null; } FacilityVisit(Facility facility, Distribution distribution); void setApplicableVisitInfo(); }
FacilityVisit extends BaseModel { public void setApplicableVisitInfo() { if (this.visited == null) { return; } if (this.visited) { this.reasonForNotVisiting = null; this.otherReasonDescription = null; return; } this.observations = null; this.confirmedBy = null; this.verifiedBy = null; this.vehicleId = null; this.visitDate = null; } FacilityVisit(Facility facility, Distribution distribution); void setApplicableVisitInfo();  }