@Test public void shouldNoChangeFacilityVisitIfVisitedFlagIsNull() throws Exception { FacilityVisit facilityVisit = new FacilityVisit(); facilityVisit.setObservations("some observation"); facilityVisit.setVisited(null); facilityVisit.setReasonForNotVisiting(ReasonForNotVisiting.HEALTH_CENTER_NOT_IN_DLS); facilityVisit.setOtherReasonDescription("other reasons"); facilityVisit.setApplicableVisitInfo(); assertThat(facilityVisit.getOtherReasonDescription(), is("other reasons")); assertThat(facilityVisit.getReasonForNotVisiting(), is(ReasonForNotVisiting.HEALTH_CENTER_NOT_IN_DLS)); assertThat(facilityVisit.getObservations(), is("some observation")); }
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();  }