@Test
public void testGetEntityList() {

    ZMSClient client = createClient(systemAdminUser);
    ZMSRDLGeneratedClient c = Mockito.mock(ZMSRDLGeneratedClient.class);
    client.setZMSRDLGeneratedClient(c);
    EntityList entityList = new EntityList();
    Mockito.when(c.getEntityList("athenz"))
            .thenReturn(entityList)
            .thenThrow(new ZMSClientException(401, "fail"))
            .thenThrow(new IllegalArgumentException("other-error"));
    EntityList listCheck = client.getEntityList("athenz");
    assertNotNull(listCheck);
    try {
        client.getEntityList("athenz");
        fail();
    } catch  (ZMSClientException ex) {
        assertEquals(401, ex.getCode());
    }
    try {
        client.getEntityList("athenz");
        fail();
    } catch  (ZMSClientException ex) {
        assertEquals(400, ex.getCode());
    }
}