use of com.linkedin.restli.server.BatchCreateRequest in project rest.li by linkedin.
the class BatchCreateArgumentBuilder method buildArguments.
@Override
public Object[] buildArguments(RestLiRequestData requestData, RoutingResult routingResult) {
@SuppressWarnings({ "unchecked", "rawtypes" }) BatchCreateRequest batchRequest = new BatchCreateRequest(requestData.getBatchEntities());
Object[] positionalArguments = { batchRequest };
return ArgumentBuilder.buildArgs(positionalArguments, routingResult.getResourceMethod(), routingResult.getContext(), null);
}
use of com.linkedin.restli.server.BatchCreateRequest in project rest.li by linkedin.
the class TestRestLiMethodInvocation method testCustomCrudParamsCollectionBatchCreate.
@Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "paramCollectionBatchCreate")
public void testCustomCrudParamsCollectionBatchCreate(ProtocolVersion version, String uri, String body) throws Exception {
ResourceModel model = buildResourceModel(CombinedResources.CollectionWithCustomCrudParams.class);
ResourceMethodDescriptor methodDescriptor = model.findMethod(ResourceMethod.BATCH_CREATE);
CombinedResources.CollectionWithCustomCrudParams resource = getMockResource(CombinedResources.CollectionWithCustomCrudParams.class);
@SuppressWarnings("rawtypes") BatchCreateRequest batchCreateRequest = (BatchCreateRequest) EasyMock.anyObject();
@SuppressWarnings("unchecked") BatchCreateResult<String, CombinedTestDataModels.Foo> batchCreateResult = resource.myBatchCreate(batchCreateRequest, eq(1), eq("bar"));
EasyMock.expect(batchCreateResult).andReturn(null).once();
checkInvocation(resource, methodDescriptor, "POST", version, uri, body, buildBatchPathKeys());
}
Aggregations