@Test
public void testGetUserList() {

    ZMSClient client = createClient(systemAdminUser);
    ZMSRDLGeneratedClient c = Mockito.mock(ZMSRDLGeneratedClient.class);
    client.setZMSRDLGeneratedClient(c);
    UserList userListMock = Mockito.mock(UserList.class);
    Mockito.when(c.getUserList())
            .thenReturn(userListMock)
            .thenThrow(new ResourceException(401))
            .thenThrow(new NullPointerException());
    try {
        UserList userList = client.getUserList();
        assertNotNull(userList);
    } catch (ZMSClientException ex) {
        fail();
    }
    
    try {
        client.getUserList();
        fail();
    } catch (ZMSClientException ex) {
        assertEquals(ex.getCode(), 401);
    }
    try {
        client.getUserList();
        fail();
    } catch (ZMSClientException ex) {
        assertEquals(ex.getCode(), 400);
    }
}