Search in sources :

Example 26 with ScreeningToReferral

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));
}
Also used : ScreeningToReferral(gov.ca.cwds.rest.api.domain.ScreeningToReferral) Test(org.junit.Test)

Example 27 with ScreeningToReferral

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));
}
Also used : ScreeningToReferral(gov.ca.cwds.rest.api.domain.ScreeningToReferral) Test(org.junit.Test)

Example 28 with ScreeningToReferral

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));
}
Also used : ScreeningToReferral(gov.ca.cwds.rest.api.domain.ScreeningToReferral) Test(org.junit.Test)

Example 29 with ScreeningToReferral

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));
}
Also used : ScreeningToReferral(gov.ca.cwds.rest.api.domain.ScreeningToReferral) Test(org.junit.Test)

Example 30 with ScreeningToReferral

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));
}
Also used : ScreeningToReferral(gov.ca.cwds.rest.api.domain.ScreeningToReferral) Test(org.junit.Test)

Aggregations

ScreeningToReferral (gov.ca.cwds.rest.api.domain.ScreeningToReferral)54 Test (org.junit.Test)51 PostedScreeningToReferral (gov.ca.cwds.rest.api.domain.PostedScreeningToReferral)44 Referral (gov.ca.cwds.rest.api.domain.cms.Referral)43 Response (gov.ca.cwds.rest.api.Response)42 Address (gov.ca.cwds.rest.api.domain.cms.Address)42 Allegation (gov.ca.cwds.rest.api.domain.cms.Allegation)42 ChildClient (gov.ca.cwds.rest.api.domain.cms.ChildClient)42 Client (gov.ca.cwds.rest.api.domain.cms.Client)42 ClientAddress (gov.ca.cwds.rest.api.domain.cms.ClientAddress)42 CmsReferral (gov.ca.cwds.rest.api.domain.cms.CmsReferral)42 CrossReport (gov.ca.cwds.rest.api.domain.cms.CrossReport)42 LongText (gov.ca.cwds.rest.api.domain.cms.LongText)42 ReferralClient (gov.ca.cwds.rest.api.domain.cms.ReferralClient)42 LinkedHashSet (java.util.LinkedHashSet)42 Set (java.util.Set)42 Reporter (gov.ca.cwds.rest.api.domain.cms.Reporter)41 ErrorMessage (gov.ca.cwds.rest.api.domain.error.ErrorMessage)23 ExpectedException (org.junit.rules.ExpectedException)16 Allegation (gov.ca.cwds.rest.api.domain.Allegation)1