Examples of RestClientImpl


Examples of com.cloudseal.rest.client.RESTClientImpl

 
  @Mock private HttpClient httpClient;
 
  @Before
  public void setup() {
    RESTClientImpl restClient = new RESTClientImpl("test", "a", "b", httpClient);
    classUnderTest = new UserServiceImpl(restClient);
  }
View Full Code Here

Examples of com.cloudseal.rest.client.RESTClientImpl

 
  @Mock private HttpClient httpClient;
 
  @Before
  public void setup() {
    classUnderTest = new RESTClientImpl("test", "a", "b", httpClient);
  }
View Full Code Here

Examples of com.impetus.kundera.rest.dao.RESTClientImpl

        {
            loadData();
        }

        // Initialize REST Client
        restClient = new RESTClientImpl();

    }
View Full Code Here

Examples of com.impetus.kundera.rest.dao.RESTClientImpl

    }

    @Test
    public void testCompositeUserCRUD() throws JsonParseException, JsonMappingException, IOException {
        WebResource webResource = resource();
        restClient = new RESTClientImpl();
        restClient.initialize(webResource, mediaType);

        // Get Application Token
        applicationToken = restClient.getApplicationToken(_PU, null);
        Assert.assertNotNull(applicationToken);
View Full Code Here

Examples of com.impetus.kundera.rest.dao.RESTClientImpl

    }

    @Test
    public void testMongoNativeQuery() throws JsonParseException, JsonMappingException, IOException {
        WebResource webResource = resource();
        restClient = new RESTClientImpl();
        restClient.initialize(webResource, mediaType);

        // Get Application Token
        applicationToken = restClient.getApplicationToken(_PU, null);
        Assert.assertNotNull(applicationToken);
View Full Code Here

Examples of com.impetus.kundera.rest.dao.RESTClientImpl

   
    @Test
    public void testUserCRUD() throws JsonParseException, JsonMappingException, IOException
    {
        WebResource webResource = resource();
        restClient = new RESTClientImpl();
        restClient.initialize(webResource, mediaType);

        buildUser1Str();
        // Get Application Token
        applicationToken = restClient.getApplicationToken(_PU, null);
View Full Code Here

Examples of com.impetus.kundera.rest.dao.RESTClientImpl

    @Test
    public void testCRUD()
    {
        WebResource webResource = resource();
        restClient = new RESTClientImpl();
        restClient.initialize(webResource, mediaType);


        buildProfessional1Str();
        buildProfessional2Str();
View Full Code Here

Examples of smartrics.rest.client.RestClientImpl

     *            the configuration for the rest client to build
     * @return the rest client
     */
    public RestClient buildRestClient(final Config config) {
        HttpClient httpClient = new HttpClientBuilder().createHttpClient(config);
        return new RestClientImpl(httpClient) {
            @Override
            protected URI createUri(String uriString, boolean escaped) throws URIException {
                boolean useNewHttpUriFactory = config.getAsBoolean("http.client.use.new.http.uri.factory", false);
                if (useNewHttpUriFactory) {
                    return new HttpURL(uriString);
View Full Code Here

Examples of smartrics.rest.client.RestClientImpl

    public static void main(String[] args) {
        postForm(args);
    }

    public static void postForm(String[] args) {
        RestClient c = new RestClientImpl(new HttpClient());
        RestRequest req = new RestRequest();
        req.setBody("name=n&data=d1");
        req.setResource("/resources/");
        req.setMethod(Method.Post);
        req.addHeader("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");
        RestResponse res = c.execute("http://localhost:8765", req);
        System.out.println("=======>\n" + res + "\n<=======");
    }
View Full Code Here

Examples of smartrics.rest.client.RestClientImpl

        RestResponse res = c.execute("http://localhost:8765", req);
        System.out.println("=======>\n" + res + "\n<=======");
    }

    public static void postXml(String[] args) {
        RestClient c = new RestClientImpl(new HttpClient());
        RestRequest req = new RestRequest();

        req.setBody("<resource><name>n</name><data>d1</data></resource>");
        req.setResource("/resources/");
        req.setMethod(Method.Post);
        RestResponse res = c.execute("http://localhost:8765", req);
        System.out.println("=======>\n" + res + "\n<=======");

        String loc = res.getHeader("Location").get(0).getValue();
        req.setResource(loc + ".json");
        req.setMethod(Method.Get);
        res = c.execute("http://localhost:8765", req);
        System.out.println("=======>\n" + res + "\n<=======");

        req.setMethod(Method.Put);
        req.setBody("<resource><name>another name</name><data>another data</data></resource>");
        res = c.execute("http://localhost:8765", req);
        System.out.println("=======>\n" + res + "\n<=======");

        req.setResource("/resources/");
        req.setMethod(Method.Get);
        res = c.execute("http://localhost:8765", req);
        System.out.println("=======>\n" + res + "\n<=======");

        req.setMethod(Method.Delete);
        req.setResource(loc);
        res = c.execute("http://localhost:8765", req);
        System.out.println("=======>\n" + res + "\n<=======");
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.