Search in sources :

Example 1 with ApplicantDTO

use of gov.ca.cwds.cals.service.dto.rfa.ApplicantDTO in project cals-api by ca-cwds.

the class Rfa1aFormGenerationTest method getApplicant.

private ApplicantDTO getApplicant(Long id, int seed) throws Exception {
    ApplicantDTO applicant = mapper.readValue(APPLICANT_FIXTURE, ApplicantDTO.class);
    applicant.setId(id);
    applicant.setFirstName(applicant.getFirstName() + seed);
    applicant.setLastName(applicant.getLastName() + seed);
    return applicant;
}
Also used : ApplicantDTO(gov.ca.cwds.cals.service.dto.rfa.ApplicantDTO)

Example 2 with ApplicantDTO

use of gov.ca.cwds.cals.service.dto.rfa.ApplicantDTO in project cals-api by ca-cwds.

the class ApplicantUtilsTest method testEmploymentNull.

@Test
public void testEmploymentNull() {
    ApplicantDTO applicantDTO = new ApplicantDTO();
    applicantDTO.setEmployment(null);
    assertEquals(new BigDecimal(0), Utils.Applicant.getAnnualIncome(applicantDTO));
}
Also used : ApplicantDTO(gov.ca.cwds.cals.service.dto.rfa.ApplicantDTO) BigDecimal(java.math.BigDecimal) Test(org.junit.Test)

Example 3 with ApplicantDTO

use of gov.ca.cwds.cals.service.dto.rfa.ApplicantDTO in project cals-api by ca-cwds.

the class ApplicantUtilsTest method testIncomeNull.

@Test
public void testIncomeNull() {
    ApplicantDTO applicantDTO = new ApplicantDTO();
    EmploymentDTO employmentDTO = new EmploymentDTO();
    employmentDTO.setIncome(null);
    applicantDTO.setEmployment(employmentDTO);
    assertEquals(new BigDecimal(0), Utils.Applicant.getAnnualIncome(applicantDTO));
}
Also used : ApplicantDTO(gov.ca.cwds.cals.service.dto.rfa.ApplicantDTO) BigDecimal(java.math.BigDecimal) EmploymentDTO(gov.ca.cwds.cals.service.dto.rfa.EmploymentDTO) Test(org.junit.Test)

Example 4 with ApplicantDTO

use of gov.ca.cwds.cals.service.dto.rfa.ApplicantDTO in project cals-api by ca-cwds.

the class ApplicantUtilsTest method testIncomeTypeNull.

@Test
public void testIncomeTypeNull() {
    ApplicantDTO applicantDTO = new ApplicantDTO();
    EmploymentDTO employmentDTO = new EmploymentDTO();
    employmentDTO.setIncome(new BigDecimal(100));
    employmentDTO.setIncomeType(null);
    applicantDTO.setEmployment(employmentDTO);
    assertEquals(new BigDecimal(100), Utils.Applicant.getAnnualIncome(applicantDTO));
}
Also used : ApplicantDTO(gov.ca.cwds.cals.service.dto.rfa.ApplicantDTO) BigDecimal(java.math.BigDecimal) EmploymentDTO(gov.ca.cwds.cals.service.dto.rfa.EmploymentDTO) Test(org.junit.Test)

Example 5 with ApplicantDTO

use of gov.ca.cwds.cals.service.dto.rfa.ApplicantDTO in project cals-api by ca-cwds.

the class ApplicantNamesDuplicationConstraintPutConfiguration method getValidatedFact.

@Override
public RFA1aForm getValidatedFact(Object[] input) {
    BusinessValidationParameterObject<ApplicantDTO> parameterObject = getBusinessValidationParameterObject(input);
    RFA1aForm form = getFormDao().find(parameterObject.getFormId());
    return buildModifiedForm(form, parameterObject.getEntityDTO());
}
Also used : RFA1aForm(gov.ca.cwds.cals.persistence.model.calsns.rfa.RFA1aForm) ApplicantDTO(gov.ca.cwds.cals.service.dto.rfa.ApplicantDTO)

Aggregations

ApplicantDTO (gov.ca.cwds.cals.service.dto.rfa.ApplicantDTO)41 RFA1aFormDTO (gov.ca.cwds.cals.service.dto.rfa.RFA1aFormDTO)28 Test (org.junit.Test)27 IssueDetails (gov.ca.cwds.rest.exception.IssueDetails)12 HashMap (java.util.HashMap)11 BaseExceptionResponse (gov.ca.cwds.rest.exception.BaseExceptionResponse)10 Map (java.util.Map)10 Set (java.util.Set)10 ClientErrorException (javax.ws.rs.ClientErrorException)10 Response (javax.ws.rs.core.Response)8 MinorChildDTO (gov.ca.cwds.cals.service.dto.rfa.MinorChildDTO)6 RFA1bFormDTO (gov.ca.cwds.cals.service.dto.rfa.RFA1bFormDTO)6 BigDecimal (java.math.BigDecimal)6 WebTarget (javax.ws.rs.client.WebTarget)6 StateType (gov.ca.cwds.cals.persistence.model.calsns.dictionaries.StateType)5 ResidenceDTO (gov.ca.cwds.cals.service.dto.rfa.ResidenceDTO)5 EmploymentDTO (gov.ca.cwds.cals.service.dto.rfa.EmploymentDTO)4 AddressType (gov.ca.cwds.cals.persistence.model.calsns.dictionaries.AddressType)3 IncomeType (gov.ca.cwds.cals.persistence.model.calsns.dictionaries.IncomeType)3 PhoneNumberType (gov.ca.cwds.cals.persistence.model.calsns.dictionaries.PhoneNumberType)3