Search in sources :

Example 51 with URIDetails

use of com.linkedin.restli.internal.testutils.URIDetails in project rest.li by linkedin.

the class TestClientBuilders method batchGetWithProjections.

@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "batchGetWithProjections")
public Object[][] batchGetWithProjections() {
    //Sample valid URIs:
    //"test?fields=message,id&ids=1&ids=2&ids=3"
    //"test?fields=message,id&ids=List(1,2,3)"
    final Set<String> fieldSet = new HashSet<String>();
    fieldSet.add("message");
    fieldSet.add("id");
    final Set<String> idSet = new HashSet<String>();
    idSet.add("1");
    idSet.add("2");
    idSet.add("3");
    final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "test", idSet, null, fieldSet);
    final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "test", idSet, null, fieldSet);
    return new Object[][] { { uriDetails1 }, { uriDetails2 } };
}
Also used : URIDetails(com.linkedin.restli.internal.testutils.URIDetails) ByteString(com.linkedin.data.ByteString) HashSet(java.util.HashSet) DataProvider(org.testng.annotations.DataProvider)

Example 52 with URIDetails

use of com.linkedin.restli.internal.testutils.URIDetails in project rest.li by linkedin.

the class TestClientBuilders method subResourceBatch.

@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "subResourceBatch")
public Object[][] subResourceBatch() {
    //Sample URIs:
    //"foo/bar/1/baz?ids=1&ids=2"
    //"foo/bar/1/baz?ids=List(1,2)"
    final Set<String> idSet = new HashSet<String>();
    idSet.add("1");
    idSet.add("2");
    final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "foo/bar/1/baz", idSet, null, null);
    final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "foo/bar/1/baz", idSet, null, null);
    return new Object[][] { { uriDetails1 }, { uriDetails2 } };
}
Also used : URIDetails(com.linkedin.restli.internal.testutils.URIDetails) ByteString(com.linkedin.data.ByteString) HashSet(java.util.HashSet) DataProvider(org.testng.annotations.DataProvider)

Example 53 with URIDetails

use of com.linkedin.restli.internal.testutils.URIDetails in project rest.li by linkedin.

the class TestClientBuilders method noEntity.

@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "noEntity")
public Object[][] noEntity() {
    //Sample URIs:
    //"test"
    //"test"
    final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "test", null, null, null);
    final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "test", null, null, null);
    return new Object[][] { { uriDetails1 }, { uriDetails2 } };
}
Also used : URIDetails(com.linkedin.restli.internal.testutils.URIDetails) DataProvider(org.testng.annotations.DataProvider)

Example 54 with URIDetails

use of com.linkedin.restli.internal.testutils.URIDetails in project rest.li by linkedin.

the class TestClientBuilders method complexKey.

@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "complexKey")
public Object[][] complexKey() {
    //Sample URIs:
    //"test/$params.id=2&$params.message=paramMessage&id=1&message=keyMessage"
    //"test/($params:(id:2,message:paramMessage),id:1,message:keyMessage)"
    final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "test/$params.id=2&$params.message=paramMessage&id=1&message=keyMessage", null, null, null);
    final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "test/($params:(id:2,message:paramMessage),id:1,message:keyMessage)", null, null, null);
    return new Object[][] { { uriDetails1 }, { uriDetails2 } };
}
Also used : URIDetails(com.linkedin.restli.internal.testutils.URIDetails) DataProvider(org.testng.annotations.DataProvider)

Example 55 with URIDetails

use of com.linkedin.restli.internal.testutils.URIDetails in project rest.li by linkedin.

the class TestClientBuilders method batchSingleWithParam.

@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "batchSingleWithParam")
public Object[][] batchSingleWithParam() {
    //"test?foo=bar&ids=1"
    //"test?foo=bar&ids=List(1)"
    final Set<String> idSet = new HashSet<String>();
    idSet.add("1");
    final Map<String, String> queryParamsMap = new HashMap<String, String>();
    queryParamsMap.put("foo", "bar");
    final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "test", idSet, queryParamsMap, null);
    final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "test", idSet, queryParamsMap, null);
    return new Object[][] { { uriDetails1 }, { uriDetails2 } };
}
Also used : URIDetails(com.linkedin.restli.internal.testutils.URIDetails) HashMap(java.util.HashMap) ByteString(com.linkedin.data.ByteString) HashSet(java.util.HashSet) DataProvider(org.testng.annotations.DataProvider)

Aggregations

URIDetails (com.linkedin.restli.internal.testutils.URIDetails)68 DataProvider (org.testng.annotations.DataProvider)65 HashMap (java.util.HashMap)39 ByteString (com.linkedin.data.ByteString)34 HashSet (java.util.HashSet)20 Group (com.linkedin.restli.examples.groups.api.Group)10 GroupsBuilders (com.linkedin.restli.examples.groups.client.GroupsBuilders)10 GroupsRequestBuilders (com.linkedin.restli.examples.groups.client.GroupsRequestBuilders)10 DataMap (com.linkedin.data.DataMap)7 CompoundKey (com.linkedin.restli.common.CompoundKey)4 GroupContact (com.linkedin.restli.examples.groups.api.GroupContact)4 GroupMembership (com.linkedin.restli.examples.groups.api.GroupMembership)4 ContactsBuilders (com.linkedin.restli.examples.groups.client.ContactsBuilders)4 ContactsRequestBuilders (com.linkedin.restli.examples.groups.client.ContactsRequestBuilders)4 GroupMembershipsBuilders (com.linkedin.restli.examples.groups.client.GroupMembershipsBuilders)4 GroupMembershipsRequestBuilders (com.linkedin.restli.examples.groups.client.GroupMembershipsRequestBuilders)4 CollectionMetadata (com.linkedin.restli.common.CollectionMetadata)3 CollectionResponse (com.linkedin.restli.common.CollectionResponse)3 Test (org.testng.annotations.Test)3 DataComplex (com.linkedin.data.DataComplex)2