Search in sources :

Example 1 with EmploymentDTO

use of gov.ca.cwds.cals.service.dto.rfa.EmploymentDTO 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 2 with EmploymentDTO

use of gov.ca.cwds.cals.service.dto.rfa.EmploymentDTO 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 3 with EmploymentDTO

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

the class ApplicantUtilsTest method testIncomeTypeMonthly.

@Test
public void testIncomeTypeMonthly() {
    ApplicantDTO applicantDTO = new ApplicantDTO();
    EmploymentDTO employmentDTO = new EmploymentDTO();
    employmentDTO.setIncome(new BigDecimal(100));
    IncomeType annualIncomeType = new IncomeType();
    annualIncomeType.setValue("monthly");
    employmentDTO.setIncomeType(annualIncomeType);
    applicantDTO.setEmployment(employmentDTO);
    assertEquals(new BigDecimal(1200), Utils.Applicant.getAnnualIncome(applicantDTO));
}
Also used : ApplicantDTO(gov.ca.cwds.cals.service.dto.rfa.ApplicantDTO) IncomeType(gov.ca.cwds.cals.persistence.model.calsns.dictionaries.IncomeType) BigDecimal(java.math.BigDecimal) EmploymentDTO(gov.ca.cwds.cals.service.dto.rfa.EmploymentDTO) Test(org.junit.Test)

Example 4 with EmploymentDTO

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

the class ApplicantUtilsTest method testIncomeTypeYearly.

@Test
public void testIncomeTypeYearly() {
    ApplicantDTO applicantDTO = new ApplicantDTO();
    EmploymentDTO employmentDTO = new EmploymentDTO();
    employmentDTO.setIncome(new BigDecimal(100));
    IncomeType annualIncomeType = new IncomeType();
    annualIncomeType.setValue("yearly");
    employmentDTO.setIncomeType(annualIncomeType);
    applicantDTO.setEmployment(employmentDTO);
    assertEquals(new BigDecimal(100), Utils.Applicant.getAnnualIncome(applicantDTO));
}
Also used : ApplicantDTO(gov.ca.cwds.cals.service.dto.rfa.ApplicantDTO) IncomeType(gov.ca.cwds.cals.persistence.model.calsns.dictionaries.IncomeType) BigDecimal(java.math.BigDecimal) EmploymentDTO(gov.ca.cwds.cals.service.dto.rfa.EmploymentDTO) Test(org.junit.Test)

Aggregations

ApplicantDTO (gov.ca.cwds.cals.service.dto.rfa.ApplicantDTO)4 EmploymentDTO (gov.ca.cwds.cals.service.dto.rfa.EmploymentDTO)4 BigDecimal (java.math.BigDecimal)4 Test (org.junit.Test)4 IncomeType (gov.ca.cwds.cals.persistence.model.calsns.dictionaries.IncomeType)2