Examples of batchCreate()


Examples of com.linkedin.restli.examples.greetings.client.ComplexKeysBuilders.batchCreate()

  @Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestOptionsDataProvider")
  public void testBatchCreate(RestliRequestOptions requestOptions) throws RemoteInvocationException
  {
    final ComplexKeysBuilders builders = new ComplexKeysBuilders(requestOptions);
    testBatchCreateMain(builders.batchCreate(), builders.batchGet());
  }

  @Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestOptionsDataProvider")
  public void testBatchCreateId(RestliRequestOptions requestOptions) throws RemoteInvocationException
  {
View Full Code Here

Examples of com.linkedin.restli.examples.greetings.client.ComplexKeysRequestBuilders.batchCreate()

  @Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestOptionsDataProvider")
  public void testBatchCreateId(RestliRequestOptions requestOptions) throws RemoteInvocationException
  {
    final ComplexKeysRequestBuilders builders = new ComplexKeysRequestBuilders(requestOptions);
    testBatchCreateIdMain(builders.batchCreate(), builders.batchGet());
  }

  @Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestBuilderDataProvider")
  public void testPartialUpdate(RootBuilderWrapper<ComplexResourceKey<TwoPartKey, TwoPartKey>, Message> builders) throws RemoteInvocationException
  {
View Full Code Here

Examples of com.linkedin.restli.examples.greetings.client.CustomTypes2Builders.batchCreate()

  @Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestOptionsDataProvider")
  public void testCollectionBatchCreate(RestliRequestOptions options) throws RemoteInvocationException
  {
    CustomTypes2Builders builders = new CustomTypes2Builders(options);
    BatchCreateRequest<Greeting> request = builders.batchCreate().input(new Greeting().setId(1)).input(new Greeting().setId(2)).build();
    Response<CollectionResponse<CreateStatus>> response = REST_CLIENT.sendRequest(request).getResponse();
    List<CreateStatus> results = response.getEntity().getElements();

    Set<CustomLong> expectedKeys = new HashSet<CustomLong>();
    expectedKeys.add(new CustomLong(1L));
View Full Code Here

Examples of com.linkedin.restli.examples.greetings.client.CustomTypes2RequestBuilders.batchCreate()

  @Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestOptionsDataProvider")
  public void testCollectionBatchCreateId(RestliRequestOptions options) throws RemoteInvocationException
  {
    CustomTypes2RequestBuilders builders = new CustomTypes2RequestBuilders(options);
    BatchCreateIdRequest<CustomLong, Greeting> request = builders.batchCreate().input(new Greeting().setId(1)).input(new Greeting().setId(2)).build();
    Response<BatchCreateIdResponse<CustomLong>> response = REST_CLIENT.sendRequest(request).getResponse();
    List<CreateIdStatus<CustomLong>> results = response.getEntity().getElements();

    Set<CustomLong> expectedKeys = new HashSet<CustomLong>();
    expectedKeys.add(new CustomLong(1L));
View Full Code Here

Examples of com.linkedin.restli.examples.greetings.client.ExceptionsBuilders.batchCreate()

  @Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestOptionsDataProvider")
  public void testBatchCreateErrors(RestliRequestOptions requestOptions) throws Exception
  {
    ExceptionsBuilders builders = new ExceptionsBuilders(requestOptions);

    Request<CollectionResponse<CreateStatus>> batchCreateRequest = builders.batchCreate()
      .input(new Greeting().setId(10L).setMessage("Greetings.").setTone(Tone.SINCERE))
      .input(new Greeting().setId(11L).setMessage("@#$%@!$%").setTone(Tone.INSULTING))
      .build();

    Response<CollectionResponse<CreateStatus>> response = REST_CLIENT.sendRequest(batchCreateRequest).getResponse();
View Full Code Here

Examples of com.linkedin.restli.examples.greetings.client.ExceptionsRequestBuilders.batchCreate()

  @Test(dataProvider = com.linkedin.restli.internal.common.TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestOptionsDataProvider")
  public void testBatchCreateIdErrors(RestliRequestOptions requestOptions) throws Exception
  {
    ExceptionsRequestBuilders builders = new ExceptionsRequestBuilders(requestOptions);

    BatchCreateIdRequest<Long, Greeting> batchCreateRequest = builders.batchCreate()
      .input(new Greeting().setId(10L).setMessage("Greetings.").setTone(Tone.SINCERE))
      .input(new Greeting().setId(11L).setMessage("@#$%@!$%").setTone(Tone.INSULTING))
      .build();

    Response<BatchCreateIdResponse<Long>> response = REST_CLIENT.sendRequest(batchCreateRequest).getResponse();
View Full Code Here

Examples of com.linkedin.restli.examples.greetings.client.GreetingsBuilders.batchCreate()

    // batch Create
    Greeting repeatedGreeting = new Greeting();
    repeatedGreeting.setMessage("Hello Hello");
    repeatedGreeting.setTone(Tone.SINCERE);
    List<Greeting> entities = Arrays.asList(repeatedGreeting, repeatedGreeting);
    Request<CollectionResponse<CreateStatus>> batchCreateRequest = builders.batchCreate().inputs(entities).build();
    List<CreateStatus> statuses = client.sendRequest(batchCreateRequest).getResponse().getEntity().getElements();
    for (CreateStatus status : statuses)
    {
      Assert.assertEquals(status.getStatus().intValue(), HttpStatus.S_201_CREATED.getCode());
      @SuppressWarnings("deprecation")
View Full Code Here

Examples of com.linkedin.restli.examples.greetings.client.GreetingsBuilders.batchCreate()

    greetingResponse = future2.get();

    Greeting repeatedGreeting = new Greeting();
    repeatedGreeting.setMessage("Hello Hello");
    repeatedGreeting.setTone(Tone.SINCERE);
    Request<CollectionResponse<CreateStatus>> request3 = builders.batchCreate().inputs(Arrays.asList(repeatedGreeting, repeatedGreeting)).build();
    CollectionResponse<CreateStatus> statuses = REST_CLIENT.sendRequest(request3).getResponse().getEntity();
    for (CreateStatus status : statuses.getElements())
    {
      Assert.assertEquals(status.getStatus().intValue(), HttpStatus.S_201_CREATED.getCode());
      @SuppressWarnings("deprecation")
View Full Code Here

Examples of com.linkedin.restli.examples.greetings.client.GreetingsRequestBuilders.batchCreate()

    // batch Create
    Greeting repeatedGreeting = new Greeting();
    repeatedGreeting.setMessage("Hello Hello");
    repeatedGreeting.setTone(Tone.SINCERE);
    List<Greeting> entities = Arrays.asList(repeatedGreeting, repeatedGreeting);
    Request<BatchCreateIdResponse<Long>> batchCreateRequest = builders.batchCreate().inputs(entities).build();
    List<CreateIdStatus<Long>> statuses = client.sendRequest(batchCreateRequest).getResponse().getEntity().getElements();
    for (CreateIdStatus<Long> status : statuses)
    {
      Assert.assertEquals(status.getStatus().intValue(), HttpStatus.S_201_CREATED.getCode());
      @SuppressWarnings("deprecation")
View Full Code Here

Examples of com.linkedin.restli.examples.greetings.client.GreetingsRequestBuilders.batchCreate()

    Greeting repeatedGreeting = new Greeting();
    repeatedGreeting.setMessage("Hello Hello");
    repeatedGreeting.setTone(Tone.SINCERE);
    List<Greeting> entities = Arrays.asList(repeatedGreeting, repeatedGreeting);

    Request<BatchCreateIdResponse<Long>> request3 = builders.batchCreate().inputs(entities).build();
    BatchCreateIdResponse<Long> statuses = REST_CLIENT.sendRequest(request3).getResponse().getEntity();
    for (CreateIdStatus<Long> status : statuses.getElements())
    {
      Assert.assertEquals(status.getStatus().intValue(), HttpStatus.S_201_CREATED.getCode());
      @SuppressWarnings("deprecation")
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.