import java.util.List; import java.util.Map; import org.junit.Test; import org.restlet.data.ChallengeScheme; import org.restlet.resource.ClientResource; import com.sibvisions.rad.server.http.rest.JSONUtil; import com.sibvisions.util.type.StringUtil; public class ContactClient { //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Test methods //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @Test public void getContacts() throws Exception { ClientResource cres = new ClientResource("https://cloud.sibvisions.com/demoerp/services/rest/DemoERP/Customers/data/customer/"); cres.setChallengeResponse(ChallengeScheme.HTTP_BASIC, "manager", "manager"); List> list = JSONUtil.getObject(cres.get(), List.class); for (Map m : list) { //System.out.println(StringUtil.toString(m.keySet())); System.out.println(m.get("ID") + ": " + m.get("FIRSTNAME") + " " + m.get("SURNAME")); } } }