use of gov.ca.cwds.rest.api.domain.ScreeningToReferral in project API by ca-cwds.
the class ParticipantValidatorTest method testNoVictimFail.
@Test
public void testNoVictimFail() throws Exception {
ScreeningToReferral toValidate = MAPPER.readValue(fixture("fixtures/domain/ScreeningToReferral/invalid/noVictim.json"), ScreeningToReferral.class);
assertThat(ParticipantValidator.hasValidParticipants(toValidate), equalTo(false));
}
use of gov.ca.cwds.rest.api.domain.ScreeningToReferral in project API by ca-cwds.
the class ParticipantValidatorTest method testHasMultipleReporterFail.
@Test
public void testHasMultipleReporterFail() throws Exception {
ScreeningToReferral toValidate = MAPPER.readValue(fixture("fixtures/domain/ScreeningToReferral/invalid/moreThanOneReporter.json"), ScreeningToReferral.class);
assertThat(ParticipantValidator.hasValidParticipants(toValidate), equalTo(false));
}
use of gov.ca.cwds.rest.api.domain.ScreeningToReferral in project API by ca-cwds.
the class ParticipantValidatorTest method testAllegationPerpetratorPersonIdIsParticipantPerpetratorSuccess.
@Test
public void testAllegationPerpetratorPersonIdIsParticipantPerpetratorSuccess() throws Exception {
ScreeningToReferral toValidate = MAPPER.readValue(fixture("fixtures/domain/ScreeningToReferral/valid/allegationPerpetratorIsParticipantPerpetrator.json"), ScreeningToReferral.class);
assertThat(ParticipantValidator.isPerpetratorParticipant(toValidate, 1234), equalTo(true));
}
use of gov.ca.cwds.rest.api.domain.ScreeningToReferral in project API by ca-cwds.
the class ParticipantValidatorTest method testAllegationVictimPersonIdNotParticipantVictimFail.
@Test
public void testAllegationVictimPersonIdNotParticipantVictimFail() throws Exception {
ScreeningToReferral toValidate = MAPPER.readValue(fixture("fixtures/domain/ScreeningToReferral/valid/valid.json"), ScreeningToReferral.class);
assertThat(ParticipantValidator.isVictimParticipant(toValidate, 9999), equalTo(false));
}
use of gov.ca.cwds.rest.api.domain.ScreeningToReferral in project API by ca-cwds.
the class ParticipantValidatorTest method testAllegationPerpetratorPersonIdNotParticipantPerpetratorFail.
@Test
public void testAllegationPerpetratorPersonIdNotParticipantPerpetratorFail() throws Exception {
ScreeningToReferral toValidate = MAPPER.readValue(fixture("fixtures/domain/ScreeningToReferral/valid/valid.json"), ScreeningToReferral.class);
assertThat(ParticipantValidator.isPerpetratorParticipant(toValidate, 9999), equalTo(false));
}
Aggregations