Search in sources :

Example 21 with Foo

use of com.linkedin.pegasus.generator.examples.Foo in project rest.li by linkedin.

the class TestGetResponseBuilder method dataProvider.

@DataProvider(name = "testData")
public Object[][] dataProvider() {
    DataMap projectionDataMap = new DataMap();
    projectionDataMap.put("stringField", MaskOperation.POSITIVE_MASK_OP.getRepresentation());
    MaskTree maskTree = new MaskTree(projectionDataMap);
    ProjectionMode manual = ProjectionMode.MANUAL;
    ProjectionMode auto = ProjectionMode.AUTOMATIC;
    return new Object[][] { // no projections with null projection masks and auto projection mode
    { getRecord(), HttpStatus.S_200_OK, null, auto }, { new GetResult<Foo>(getRecord(), HttpStatus.S_207_MULTI_STATUS), HttpStatus.S_207_MULTI_STATUS, null, auto }, // no projections with null projection masks and manual projection mode
    { getRecord(), HttpStatus.S_200_OK, null, manual }, { new GetResult<Foo>(getRecord(), HttpStatus.S_207_MULTI_STATUS), HttpStatus.S_207_MULTI_STATUS, null, manual }, // no projections with non-null projection masks and manual projection mode
    { getRecord(), HttpStatus.S_200_OK, maskTree, manual }, { new GetResult<Foo>(getRecord(), HttpStatus.S_207_MULTI_STATUS), HttpStatus.S_207_MULTI_STATUS, maskTree, manual }, // projections with non-null projection masks and auto projection mode
    { getRecord(), HttpStatus.S_200_OK, maskTree, auto }, { new GetResult<Foo>(getRecord(), HttpStatus.S_207_MULTI_STATUS), HttpStatus.S_207_MULTI_STATUS, maskTree, auto } };
}
Also used : MaskTree(com.linkedin.data.transform.filter.request.MaskTree) ProjectionMode(com.linkedin.restli.server.ProjectionMode) Foo(com.linkedin.pegasus.generator.examples.Foo) DataMap(com.linkedin.data.DataMap) DataProvider(org.testng.annotations.DataProvider)

Aggregations

Foo (com.linkedin.pegasus.generator.examples.Foo)21 RoutingResult (com.linkedin.restli.internal.server.RoutingResult)11 RestLiResponseData (com.linkedin.restli.server.RestLiResponseData)11 Test (org.testng.annotations.Test)11 HashMap (java.util.HashMap)9 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)9 MaskTree (com.linkedin.data.transform.filter.request.MaskTree)8 ServerResourceContext (com.linkedin.restli.internal.server.ServerResourceContext)8 ResourceMethodDescriptor (com.linkedin.restli.internal.server.model.ResourceMethodDescriptor)8 ResourceContext (com.linkedin.restli.server.ResourceContext)8 DataProvider (org.testng.annotations.DataProvider)8 DataMap (com.linkedin.data.DataMap)5 PathSpec (com.linkedin.data.schema.PathSpec)5 CompoundKey (com.linkedin.restli.common.CompoundKey)5 BatchResult (com.linkedin.restli.server.BatchResult)5 RestLiServiceException (com.linkedin.restli.server.RestLiServiceException)5 ArrayList (java.util.ArrayList)5 RecordTemplate (com.linkedin.data.template.RecordTemplate)4 StringDataSchema (com.linkedin.data.schema.StringDataSchema)3 BatchResponse (com.linkedin.restli.common.BatchResponse)3