Examples of batchCreate()


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

  private static Long[] prepareData(List<Greeting> entities, RestliRequestOptions requestOptions)
    throws RemoteInvocationException
  {
    GreetingsRequestBuilders builders = new GreetingsRequestBuilders(requestOptions);
    BatchCreateIdRequest<Long, Greeting> request = builders.batchCreate().inputs(entities).build();
    Response<BatchCreateIdResponse<Long>> response = REST_CLIENT.sendRequest(request).getResponse();
    List<CreateIdStatus<Long>> statuses = response.getEntity().getElements();
    final Long[] requestIds = new Long[entities.size()];
    for (int i = 0; i < statuses.size(); ++i)
    {
View Full Code Here

Examples of com.linkedin.restli.server.twitter.AsyncDiscoveredItemsResource.batchCreate()

    discoveredResource = getMockResource(AsyncDiscoveredItemsResource.class);

    @SuppressWarnings("unchecked")
    BatchCreateRequest<ComplexResourceKey<DiscoveredItemKey, DiscoveredItemKeyParams>, DiscoveredItem> mockBatchCreateReq =
        (BatchCreateRequest<ComplexResourceKey<DiscoveredItemKey, DiscoveredItemKeyParams>, DiscoveredItem>)EasyMock.anyObject();
    discoveredResource.batchCreate(mockBatchCreateReq,
                                   EasyMock.<Callback<BatchCreateResult<ComplexResourceKey<DiscoveredItemKey, DiscoveredItemKeyParams>, DiscoveredItem>>>anyObject());
    EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() {
      @Override
      public Object answer() throws Throwable {
        @SuppressWarnings("unchecked")
View Full Code Here

Examples of com.linkedin.restli.server.twitter.AsyncStatusCollectionResource.batchCreate()

    methodDescriptor = statusResourceModel.findMethod(ResourceMethod.BATCH_CREATE);
    statusResource = getMockResource(AsyncStatusCollectionResource.class);

    @SuppressWarnings("unchecked")
    BatchCreateRequest<Long, Status> mockBatchCreateReq = (BatchCreateRequest<Long, Status>)EasyMock.anyObject();
    statusResource.batchCreate(mockBatchCreateReq, EasyMock.<Callback<BatchCreateResult<Long, Status>>> anyObject());
    EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() {
      @Override
      public Object answer() throws Throwable {
        @SuppressWarnings("unchecked")
        Callback<BatchCreateResult<Long, Status>> callback =
View Full Code Here

Examples of com.linkedin.restli.server.twitter.DiscoveredItemsResource.batchCreate()

    // #2 Batch create on complex-key resource
    methodDescriptor = discoveredItemsResourceModel.findMethod(ResourceMethod.BATCH_CREATE);
    discoveredItemsResource = getMockResource(DiscoveredItemsResource.class);
    batchCreateRequest =(BatchCreateRequest)EasyMock.anyObject();
    EasyMock.expect(discoveredItemsResource.batchCreate(batchCreateRequest)).andReturn(null).once();
    checkInvocation(discoveredItemsResource,
                    methodDescriptor,
                    "POST",
                    version,
                    "/discovereditems",
View Full Code Here

Examples of com.linkedin.restli.server.twitter.PromiseDiscoveredItemsResource.batchCreate()

    // #2 Batch create on complex-key resource
    methodDescriptor = discoveredItemsResourceModel.findMethod(ResourceMethod.BATCH_CREATE);
    discoveredItemsResource = getMockResource(PromiseDiscoveredItemsResource.class);
    batchCreateRequest =(BatchCreateRequest)EasyMock.anyObject();
    EasyMock.expect(discoveredItemsResource.batchCreate(batchCreateRequest)).andReturn(
        Promises.<BatchCreateResult<ComplexResourceKey<DiscoveredItemKey, DiscoveredItemKeyParams>, DiscoveredItem>>value(null)).once();
    checkInvocation(discoveredItemsResource,
                    methodDescriptor,
                    "POST",
                    version, "/promisediscovereditems",
View Full Code Here

Examples of com.linkedin.restli.server.twitter.PromiseStatusCollectionResource.batchCreate()

    // #1 Batch create on collection resource
    methodDescriptor = statusResourceModel.findMethod(ResourceMethod.BATCH_CREATE);
    statusResource = getMockResource(PromiseStatusCollectionResource.class);
    @SuppressWarnings("rawtypes")
    BatchCreateRequest batchCreateRequest =(BatchCreateRequest)EasyMock.anyObject();
    EasyMock.expect(statusResource.batchCreate(batchCreateRequest)).andReturn(
        Promises.<BatchCreateResult<Long, Status>>value(null)).once();
    String body = RestLiTestHelper.doubleQuote("{'elements':[{},{}]}");
    checkInvocation(statusResource,
                    methodDescriptor,
                    "POST",
View Full Code Here

Examples of com.linkedin.restli.server.twitter.StatusCollectionResource.batchCreate()

    // #1 Batch create on collection resource
    methodDescriptor = statusResourceModel.findMethod(ResourceMethod.BATCH_CREATE);
    statusResource = getMockResource(StatusCollectionResource.class);
    @SuppressWarnings("rawtypes")
    BatchCreateRequest batchCreateRequest =(BatchCreateRequest)EasyMock.anyObject();
    EasyMock.expect(statusResource.batchCreate(batchCreateRequest)).andReturn(null).once();
    String body = RestLiTestHelper.doubleQuote("{'elements':[{},{}]}");
    checkInvocation(statusResource,
                    methodDescriptor,
                    "POST",
                    version,
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.