use of gov.ca.cwds.data.legacy.cms.entity.SafetyAlert in project api-core by ca-cwds.
the class ClientTestUtil method safetyAlert.
public static SafetyAlert safetyAlert(String thirdId, LocalDate activationDate) {
SafetyAlert safetyAlert = new SafetyAlert();
safetyAlert.setThirdId(thirdId);
safetyAlert.setActivationDate(activationDate);
return safetyAlert;
}
use of gov.ca.cwds.data.legacy.cms.entity.SafetyAlert in project api-core by ca-cwds.
the class R09729Test method rule09729_violated_whenSingleAlertBeforeDOB.
@Test
public void rule09729_violated_whenSingleAlertBeforeDOB() throws DroolsException {
// given
final Client client = client(SOME_DATE);
final SafetyAlert safetyAlert = safetyAlert(THIRD_ID, SOME_DATE.minusDays(1));
final ChildClientEntityAwareDTO input = dto(client, safetyAlert);
// when + then
checkRuleViolatedOnce(input, RULE_NAME);
}
use of gov.ca.cwds.data.legacy.cms.entity.SafetyAlert in project api-core by ca-cwds.
the class R09729Test method rule09729_violated_whenOneOfTwoAlertsIsBeforeDOB.
@Test
public void rule09729_violated_whenOneOfTwoAlertsIsBeforeDOB() throws DroolsException {
// given
final Client client = client(SOME_DATE);
final SafetyAlert safetyAlert0 = safetyAlert(THIRD_ID, SOME_DATE.plusDays(100));
final SafetyAlert safetyAlert1 = safetyAlert(THIRD_ID_2, SOME_DATE.minusDays(100));
final ChildClientEntityAwareDTO input = dto(client, safetyAlert0, safetyAlert1);
// when + then
checkRuleViolatedOnce(input, RULE_NAME);
}
use of gov.ca.cwds.data.legacy.cms.entity.SafetyAlert in project api-core by ca-cwds.
the class R09729Test method rule09729_violatedTwice_whenTwoAlertsBeforeDOB.
@Test
public void rule09729_violatedTwice_whenTwoAlertsBeforeDOB() throws DroolsException {
// given
final Client client = client(SOME_DATE);
final SafetyAlert safetyAlert0 = safetyAlert(THIRD_ID, SOME_DATE.minusDays(1));
final SafetyAlert safetyAlert1 = safetyAlert(THIRD_ID_2, SOME_DATE.minusDays(100));
final ChildClientEntityAwareDTO input = dto(client, safetyAlert0, safetyAlert1);
// when + then
checkRuleViolated(input, RULE_NAME, 2);
}
use of gov.ca.cwds.data.legacy.cms.entity.SafetyAlert in project api-core by ca-cwds.
the class SafetyAlertDaoTest method findByClientId_success_whenSingleRecord.
@Test
public void findByClientId_success_whenSingleRecord() {
executeInTransaction(sessionFactory, (sessionFactory) -> {
// when
final Collection<SafetyAlert> actualResults = testSubject.findByClientId("9HNHgeH00E");
// then
assertThat(actualResults.size(), is(1));
final SafetyAlert safetyAlert = actualResults.iterator().next();
assertThat(safetyAlert.getFkClientId(), is("9HNHgeH00E"));
assertThat(safetyAlert.getActivationGovernmentEntityType().getPrimaryKey(), is((short) 1126));
assertThat(safetyAlert.getActivationDate(), is(LocalDate.of(2013, 1, 28)));
assertThat(safetyAlert.getActivationExplanationText().getIdentifier(), is("7xvG9WT00E"));
assertThat(safetyAlert.getActivationReasonType().getSystemId(), is((short) 6402));
assertThat(safetyAlert.getDeactivationGovernmentEntityType(), is(nullValue()));
assertThat(safetyAlert.getDeactivationDate(), is(nullValue()));
assertThat(safetyAlert.getDeactivationExplanationText(), is(nullValue()));
});
}
Aggregations