Search in sources :

Example 11 with DBUnitAssertHelper

use of gov.ca.cwds.cals.persistence.DBUnitAssertHelper in project cals-api by ca-cwds.

the class RFA1aCoreSubmitApplicationTest method testIfEmergencyContactDetailWasCreatedProperly.

private void testIfEmergencyContactDetailWasCreatedProperly(String placementHomeId) throws Exception {
    DBUnitAssertHelper helper = DBUnitAssertHelper.builder(dbUnitSupport).setExpectedResultTemplatePath("/dbunit/EmergencyContactDetail.xml").setTestedTableName("EM_CNT_T").appendTableFilter("ESTBLSH_ID", placementHomeId).build();
    ReplacementDataSet expectedDataSet = helper.getExpectedDataSet();
    expectedDataSet.addReplacementObject("$placementHomeId", placementHomeId);
    helper.assertEquals(new String[] { "IDENTIFIER", "LST_UPD_TS" });
}
Also used : DBUnitAssertHelper(gov.ca.cwds.cals.persistence.DBUnitAssertHelper) ReplacementDataSet(org.dbunit.dataset.ReplacementDataSet)

Example 12 with DBUnitAssertHelper

use of gov.ca.cwds.cals.persistence.DBUnitAssertHelper in project cals-api by ca-cwds.

the class RFA1aCoreSubmitApplicationTest method testIfOtherAdultsWasCreatedProperly.

private void testIfOtherAdultsWasCreatedProperly(String placementHomeId) throws Exception {
    DBUnitAssertHelper helper = DBUnitAssertHelper.builder(dbUnitSupport).setExpectedResultTemplatePath("/dbunit/OtherAdultsInPlacementHome.xml").setTestedTableName("OTH_ADLT").appendTableFilter("FKPLC_HM_T", placementHomeId).build();
    helper.assertEquals(new String[] { "IDENTIFIER", "FKPLC_HM_T", "LST_UPD_TS" }, new String[] { "OTH_ADLTNM" });
}
Also used : DBUnitAssertHelper(gov.ca.cwds.cals.persistence.DBUnitAssertHelper)

Example 13 with DBUnitAssertHelper

use of gov.ca.cwds.cals.persistence.DBUnitAssertHelper in project cals-api by ca-cwds.

the class RFA1aCoreSubmitApplicationTest method testIfPhoneContactDetailsWasCreatedProperly.

private void testIfPhoneContactDetailsWasCreatedProperly(String substituteCareProviderId) throws Exception {
    DBUnitAssertHelper helper = DBUnitAssertHelper.builder(dbUnitSupport).setExpectedResultTemplatePath("/dbunit/PhoneContactDetail.xml").setTestedTableName("PH_CNT_T").appendTableFilter("ESTBLSH_ID", substituteCareProviderId).build();
    String[] ignoreCols = { "THIRD_ID", "ESTBLSH_ID", "LST_UPD_TS" };
    String[] sortedCols = { "PHONE_NO" };
    helper.assertEquals(ignoreCols, sortedCols);
}
Also used : DBUnitAssertHelper(gov.ca.cwds.cals.persistence.DBUnitAssertHelper)

Example 14 with DBUnitAssertHelper

use of gov.ca.cwds.cals.persistence.DBUnitAssertHelper in project cals-api by ca-cwds.

the class RFA1aCoreSubmitApplicationTest method testIfPlacementFacilityTypeHistoryWasCreatedProperly.

private void testIfPlacementFacilityTypeHistoryWasCreatedProperly(String placementHomeId) throws Exception {
    DBUnitAssertHelper helper = DBUnitAssertHelper.builder(dbUnitSupport).setExpectedResultTemplatePath("/dbunit/PlacementFacilityTypeHistory.xml").setTestedTableName("PFACHIST").appendTableFilter("FKPLC_HM_T", placementHomeId).appendTemplateParameter("faciltiyType", getFacilityType(placementHomeId)).appendTemplateParameter("placementHomeId", placementHomeId).build();
    ITable actualTable = helper.getActualTable();
    assertEquals(1, actualTable.getRowCount());
    helper.assertEquals(new String[] { "THIRD_ID", "CREATN_TS", "LST_UPD_ID", "LST_UPD_TS", "START_TS" });
}
Also used : DBUnitAssertHelper(gov.ca.cwds.cals.persistence.DBUnitAssertHelper) ITable(org.dbunit.dataset.ITable)

Aggregations

DBUnitAssertHelper (gov.ca.cwds.cals.persistence.DBUnitAssertHelper)14 ReplacementDataSet (org.dbunit.dataset.ReplacementDataSet)6 ITable (org.dbunit.dataset.ITable)2