@Test public void shouldCreateValueObjectFromFormInstance() { String staffId = "staff id"; String facilityId = "facility id"; MobileMidwifeForm mobileMidwifeForm = setupFormData(staffId, facilityId); assertFormWithEnrollment(mobileMidwifeForm, mobileMidwifeForm.createMobileMidwifeEnrollment()); }
public MobileMidwifeForm buildMobileMidwifeForm() { MobileMidwifeForm mobileMidwifeForm = new MobileMidwifeForm(); mobileMidwifeForm.setStaffId(staffId); mobileMidwifeForm.setFacilityId(facilityId); mobileMidwifeForm.setMotechId(patientId); mobileMidwifeForm.setAction(registerAction); mobileMidwifeForm.setConsent(consent); fillAbstractFormFields(mobileMidwifeForm); return mobileMidwifeForm; }
public static void assertFormWithEnrollment( MobileMidwifeForm exptectedForm, MobileMidwifeEnrollment actual) { assertThat(actual.getStaffId(), is(exptectedForm.getStaffId())); assertThat(actual.getFacilityId(), is(exptectedForm.getFacilityId())); assertThat(actual.getPatientId(), is(exptectedForm.getMotechId())); assertThat(actual.getServiceType(), is(exptectedForm.getServiceType())); assertThat(actual.getReasonToJoin(), is(exptectedForm.getReasonToJoin())); assertThat(actual.getMedium(), is(exptectedForm.getMediumStripingOwnership())); assertThat(actual.getDayOfWeek(), is(exptectedForm.getDayOfWeek())); assertThat(actual.getTimeOfDay(), is(exptectedForm.getTimeOfDay())); assertThat(actual.getLanguage(), is(exptectedForm.getLanguage())); assertThat(actual.getLearnedFrom(), is(exptectedForm.getLearnedFrom())); assertThat(actual.getPhoneNumber(), is(exptectedForm.getMmRegPhone())); assertThat(actual.getPhoneOwnership(), is(exptectedForm.getPhoneOwnership())); assertThat(actual.getConsent(), is(exptectedForm.getConsent())); assertThat(actual.getEnrollmentDateTime().toLocalDate(), is(new LocalDate())); }