@Test
public void testDeleteUser() {

    ZMSClient client = createClient(systemAdminUser);
    ZMSRDLGeneratedClient c = Mockito.mock(ZMSRDLGeneratedClient.class);
    client.setZMSRDLGeneratedClient(c);
    User userMock = Mockito.mock(User.class);
    Mockito.when(c.deleteUser("joe", AUDIT_REF)).thenReturn(userMock);
    Mockito.when(c.deleteUser("doe", AUDIT_REF)).thenThrow(new ResourceException(404));
    Mockito.when(c.deleteUser("jane", AUDIT_REF)).thenThrow(new NullPointerException());
    try {
        client.deleteUser("joe", AUDIT_REF);
        assertTrue(true);
    } catch (ZMSClientException ex) {
        fail();
    }
    
    try {
        client.deleteUser("doe", AUDIT_REF);
        fail();
    } catch (ZMSClientException ex) {
        assertEquals(ex.getCode(), 404);
    }
    try {
        client.deleteUser("jane", AUDIT_REF);
        fail();
    } catch (ZMSClientException ex) {
        assertEquals(ex.getCode(), 400);
    }
}