/**
* test CRUD ops on {@link Conveyance}
*/
public void testConveyanceCRUD() {
// C
Conveyance conv = getTestUtils().getTestConveyance();
// add client
MatterClient client = new MatterClient();
String principalName = "clientX";
client.setPrincipalName(principalName);
conv.getClients().add(client);
getBoSvc().save(conv);
// R
conv.refresh();
assertEquals("conveyance name differs", getTestUtils().getTestConveyance().getName(), conv.getName());
assertEquals("number of clients differs", 1, conv.getClients().size());
assertEquals("principal name differs", principalName, conv.getClients().get(0).getPrincipalName());
assertNotNull("matter type should not be null", conv.getType());
assertEquals("matter type name differs", "Sale of Motor Vehicle", conv.getType().getName());
getTestUtils().testConsiderationFields(conv.getConsiderations().get(0));
assertNotNull("considerations should not be null", conv.getConsiderations());
assertEquals("default number of considerations differs", 2, conv.getConsiderations().size());
getTestUtils().testMatterClient(conv, getTestUtils().getTestClientFirstName());
// U
String name2 = "EN/C010";
conv.setName(name2);
conv.refresh();
assertEquals(name2, conv.getName());
// D
getBoSvc().delete(conv);
assertNull("client should have been deleted",
getBoSvc().findBySinglePrimaryKey(MatterClient.class, conv.getClients().get(0).getId()));
/*assertNull("conveyance fee should have been deleted",
getBoSvc().findBySinglePrimaryKey(Transaction.class, conv.getFees().get(0).getId()));*/
}