"Jakton Nyonje (Returning Officer Oriri Constituency)\n" +
"Noah Bowen (Rongo Constituency)\n" +
"Alex Uyuga (Returning officer Suna East Constituency)\n" +
"Jairus Obago (Returning Officer Migori County)\n" +
"Adam Mohamed (Returning officer Kuria West Constituency)\n";
Matter matter = getTestMatter(localReference, statusText, name);
// C
getBoSvc().save(matter);
// R
matter = getBoSvc().findBySinglePrimaryKey(getDataObjectClass(), matter.getId());
matter.refreshNonUpdateableReferences(); //without this, case status (object) is null
assertEquals("case name differs", name, matter.getName());
assertEquals("local reference differs", localReference, matter.getLocalReference());
assertNotNull("clients should not be null", matter.getClients());
assertEquals("number of clients expected differs", 2, matter.getClients().size());
assertNotNull("status id should not be null", matter.getStatusId());
assertNotNull("status should not be null", matter.getStatus());
assertNotNull("type should not be null", matter.getType());
assertEquals("status differs", statusText, matter.getStatus().getName());
assertNotNull("considerations should not be null", matter.getConsiderations());
assertEquals("default number of considerations differs", 2, matter.getConsiderations().size());
log.debug("Created case with id " + matter.getId());
assertNotNull("case id should not be null", matter.getId());
assertEquals("ojb concrete class differs", getDataObjectClass().getCanonicalName(), matter.getConcreteClass());
assertEquals("tags differ", matterTags, matter.getTags());
additionalTestsForCreatedMatter(matter);
// U
matter.getConsiderations().add((MatterConsideration) getTestUtils().getTestConsideration());
getBoSvc().save(matter);
matter = getBoSvc().findBySinglePrimaryKey(matter.getClass(), matter.getId());
getTestUtils().testConsiderationFields(matter.getConsiderations().get(0));
getTestUtils().testMatterClient(matter, getTestUtils().getTestClientFirstName());
// D
getBoSvc().delete(matter);
assertNull("matter should have been deleted", getBoSvc().findBySinglePrimaryKey(getDataObjectClass(), matter.getId()));
for (MatterClient client: matter.getClients()) {
assertNull("client should have been deleted", getBoSvc().findBySinglePrimaryKey(MatterClient.class, client.getId()));
}
assertNull("consideration should have been deleted", getBoSvc().findBySinglePrimaryKey(MatterConsideration.class,
matter.getConsiderations().get(0).getId()));
additionalTestsForDeletedMatter(matter);
}