Package com.linkedin.restli.examples.greetings.client

Examples of com.linkedin.restli.examples.greetings.client.StringKeysBuilders


  public void testBatchGetWithSimpleKey(RestliRequestOptions requestOptions) throws Exception
  {
    Set<String> keys = new HashSet<String>();
    keys.add(key1());
    keys.add(key2());
    Request<BatchResponse<Message>> req = new StringKeysBuilders(requestOptions).batchGet().ids(keys).build();
    BatchResponse<Message> response = REST_CLIENT.sendRequest(req).get().getEntity();
    Map<String, Message> results = response.getResults();
    Assert.assertEquals(results.get(key1()).getMessage(), key1(), "Message should match key for key1");
    Assert.assertEquals(results.get(key2()).getMessage(), key2(), "Message should match key for key2");
  }
View Full Code Here


  public void testBatchGetKVWithSimpleKey(RestliRequestOptions requestOptions) throws Exception
  {
    Set<String> keys = new HashSet<String>();
    keys.add(key1());
    keys.add(key2());
    Request<BatchKVResponse<String, Message>> req = new StringKeysBuilders(requestOptions).batchGet().ids(keys).buildKV();
    BatchKVResponse<String,Message> response = REST_CLIENT.sendRequest(req).get().getEntity();
    Map<String, Message> results = response.getResults();
    Assert.assertEquals(results.get(key1()).getMessage(), key1(), "Message should match key for key1");
    Assert.assertEquals(results.get(key2()).getMessage(), key2(), "Message should match key for key2");
  }
View Full Code Here

  @DataProvider(name = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestStringKeysBuilderDataProvider")
  private static Object[][] requestStringKeysBuilderDataProvider()
  {
    return new Object[][] {
      { new RootBuilderWrapper<String, Message>(new StringKeysBuilders()) },
      { new RootBuilderWrapper<String, Message>(new StringKeysBuilders(TestConstants.FORCE_USE_NEXT_OPTIONS)) },
      { new RootBuilderWrapper<String, Message>(new StringKeysRequestBuilders()) },
      { new RootBuilderWrapper<String, Message>(new StringKeysRequestBuilders(TestConstants.FORCE_USE_NEXT_OPTIONS)) }
    };
  }
View Full Code Here

TOP

Related Classes of com.linkedin.restli.examples.greetings.client.StringKeysBuilders

Copyright © 2018 www.massapicom. 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.