Search in sources :

Example 1 with CountyTriggerEmbeddable

use of gov.ca.cwds.data.persistence.cms.CountyTriggerEmbeddable in project API by ca-cwds.

the class CountyTriggerDaoIT method testDelete.

@Override
@Test
public void testDelete() throws Exception {
    String timestamp = "2017-05-23 19:53:50.505";
    CountyTriggerEmbeddable countyTriggerEmbeddable = new CountyTriggerEmbeddable(countyOwnershipT, null);
    DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
    Date date = formatter.parse(timestamp);
    countyTriggerEmbeddable.setIntegratorTimeStamp(date);
    CountyTrigger deleted = countyTriggerDao.delete(countyTriggerEmbeddable);
    assertThat(deleted.getCountyTriggerEmbeddable().getCountyOwnershipT(), is(countyOwnershipT));
}
Also used : SimpleDateFormat(java.text.SimpleDateFormat) DateFormat(java.text.DateFormat) CountyTrigger(gov.ca.cwds.data.persistence.cms.CountyTrigger) CountyTriggerEmbeddable(gov.ca.cwds.data.persistence.cms.CountyTriggerEmbeddable) SimpleDateFormat(java.text.SimpleDateFormat) Date(java.util.Date) Test(org.junit.Test)

Example 2 with CountyTriggerEmbeddable

use of gov.ca.cwds.data.persistence.cms.CountyTriggerEmbeddable in project API by ca-cwds.

the class CountyTriggerDaoIT method testFind.

@Override
@Test
public void testFind() throws Exception {
    String timestamp = "2017-05-23 19:53:50.505";
    CountyTriggerEmbeddable countyTriggerEmbeddable = new CountyTriggerEmbeddable(countyOwnershipT, null);
    DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
    Date date = formatter.parse(timestamp);
    countyTriggerEmbeddable.setIntegratorTimeStamp(date);
    CountyTrigger found = countyTriggerDao.find(countyTriggerEmbeddable);
    assertThat(found.getCountyTriggerEmbeddable().getCountyOwnershipT(), is(equalTo(countyOwnershipT)));
}
Also used : SimpleDateFormat(java.text.SimpleDateFormat) DateFormat(java.text.DateFormat) CountyTrigger(gov.ca.cwds.data.persistence.cms.CountyTrigger) CountyTriggerEmbeddable(gov.ca.cwds.data.persistence.cms.CountyTriggerEmbeddable) SimpleDateFormat(java.text.SimpleDateFormat) Date(java.util.Date) Test(org.junit.Test)

Example 3 with CountyTriggerEmbeddable

use of gov.ca.cwds.data.persistence.cms.CountyTriggerEmbeddable in project API by ca-cwds.

the class CountyTriggerDaoIT method testDeleteEntityNotFoundException.

@Override
@Test
public void testDeleteEntityNotFoundException() throws Exception {
    CountyTriggerEmbeddable countyTriggerEmbeddable = new CountyTriggerEmbeddable("ABC1234568", null);
    CountyTrigger deleted = countyTriggerDao.delete(countyTriggerEmbeddable);
    assertThat(deleted, is(nullValue()));
}
Also used : CountyTrigger(gov.ca.cwds.data.persistence.cms.CountyTrigger) CountyTriggerEmbeddable(gov.ca.cwds.data.persistence.cms.CountyTriggerEmbeddable) Test(org.junit.Test)

Example 4 with CountyTriggerEmbeddable

use of gov.ca.cwds.data.persistence.cms.CountyTriggerEmbeddable in project API by ca-cwds.

the class CountyTriggerDaoIT method testUpdate.

@Override
@Test
public void testUpdate() throws Exception {
    String timestamp = "2017-05-23 19:53:50.505";
    CountyTriggerEmbeddable countyTriggerEmbeddable = new CountyTriggerEmbeddable(countyOwnershipT, null);
    DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
    Date date = formatter.parse(timestamp);
    CountyTrigger countyTrigger = new CountyTrigger(countyOwnershipT, "61", "C", null, "REFR_CLT");
    countyTrigger.getPrimaryKey().setIntegratorTimeStamp(date);
    CountyTrigger updated = countyTriggerDao.update(countyTrigger);
    assertThat(updated, is(countyTrigger));
}
Also used : SimpleDateFormat(java.text.SimpleDateFormat) DateFormat(java.text.DateFormat) CountyTrigger(gov.ca.cwds.data.persistence.cms.CountyTrigger) CountyTriggerEmbeddable(gov.ca.cwds.data.persistence.cms.CountyTriggerEmbeddable) SimpleDateFormat(java.text.SimpleDateFormat) Date(java.util.Date) Test(org.junit.Test)

Example 5 with CountyTriggerEmbeddable

use of gov.ca.cwds.data.persistence.cms.CountyTriggerEmbeddable in project API by ca-cwds.

the class CountyTriggerDaoIT method testFindEntityNotFoundException.

@Override
@Test
public void testFindEntityNotFoundException() throws Exception {
    CountyTriggerEmbeddable countyTriggerEmbeddable = new CountyTriggerEmbeddable("9999999KKK", null);
    CountyTrigger found = countyTriggerDao.find(countyTriggerEmbeddable);
    assertThat(found, is(nullValue()));
}
Also used : CountyTrigger(gov.ca.cwds.data.persistence.cms.CountyTrigger) CountyTriggerEmbeddable(gov.ca.cwds.data.persistence.cms.CountyTriggerEmbeddable) Test(org.junit.Test)

Aggregations

CountyTrigger (gov.ca.cwds.data.persistence.cms.CountyTrigger)5 CountyTriggerEmbeddable (gov.ca.cwds.data.persistence.cms.CountyTriggerEmbeddable)5 Test (org.junit.Test)5 DateFormat (java.text.DateFormat)3 SimpleDateFormat (java.text.SimpleDateFormat)3 Date (java.util.Date)3