@Test
public void testDeleteServiceIdentity() {

    ZMSClient client = createClient(systemAdminUser);
    ZMSRDLGeneratedClient c = Mockito.mock(ZMSRDLGeneratedClient.class);
    client.setZMSRDLGeneratedClient(c);
    ServiceIdentity serviceMock = Mockito.mock(ServiceIdentity.class);
    Mockito.when(c.deleteServiceIdentity("ServiceDelDom1", "Service1", AUDIT_REF)).thenReturn(serviceMock);
    client.deleteServiceIdentity("ServiceDelDom1", "Service1", AUDIT_REF);
    try {
        Mockito.when(c.deleteServiceIdentity("ServiceDelDom1", "Service2", AUDIT_REF)).thenThrow(new ResourceException(204));
        client.deleteServiceIdentity("ServiceDelDom1", "Service2", AUDIT_REF);
        fail();
    } catch  (ResourceException ex) {
        assertEquals(ex.getCode(), 204);
    }
    try {
        Mockito.when(c.deleteServiceIdentity("ServiceDelDom2", "Service2", AUDIT_REF))
                .thenThrow(new NullPointerException());
        client.deleteServiceIdentity("ServiceDelDom2", "Service2", AUDIT_REF);
        fail();
    } catch (ResourceException ex) {
        assertEquals(ex.getCode(), 400);
    }
}