use of com.linkedin.restli.internal.testutils.URIDetails in project rest.li by linkedin.
the class TestClientBuilders method batchCompoundKey.
@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "batchCompoundKey")
public Object[][] batchCompoundKey() {
//Sample URIs:
//"test?ids=part1%3D1%26part2%3D2&ids=part1%3D11%26part2%3D22",
//"test?ids=List((part1:1,part2:2),(part1:11,part2:22))");
//Note that we need two different ID sets, one for V1 and one for V2 since batch operations on compound keys
//are unique.
final Set<String> idSetV1 = new HashSet<String>();
idSetV1.add("part1=1&part2=2");
idSetV1.add("part1=11&part2=22");
final Set<DataMap> idSetV2 = new HashSet<DataMap>();
final DataMap id1 = new DataMap();
id1.put("part1", "1");
id1.put("part2", "2");
final DataMap id2 = new DataMap();
id2.put("part1", "11");
id2.put("part2", "22");
idSetV2.add(id1);
idSetV2.add(id2);
final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "test", idSetV1, null, null);
final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "test", idSetV2, null, null);
return new Object[][] { { uriDetails1 }, { uriDetails2 } };
}
use of com.linkedin.restli.internal.testutils.URIDetails in project rest.li by linkedin.
the class TestClientBuilders method search3.
@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "search3")
public Object[][] search3() {
//Sample URIs:
//"test/key=a%3Ab?count=4&p=42&q=search"
//"test/(key:a%3Ab)?count=4&p=42&q=search"
final Map<String, String> queryParamsMap = new HashMap<String, String>();
queryParamsMap.put("p", "42");
queryParamsMap.put("q", "search");
queryParamsMap.put("count", "4");
final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "test/key=a%3Ab", null, queryParamsMap, null);
final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "test/(key:a%3Ab)", null, queryParamsMap, null);
return new Object[][] { { uriDetails1 }, { uriDetails2 } };
}
use of com.linkedin.restli.internal.testutils.URIDetails in project rest.li by linkedin.
the class TestGroupsRequestBuilders method requestContactsBatchDataProvider.
@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestContactsBatchDataProvider")
private static Object[][] requestContactsBatchDataProvider() {
//Sample URIs:
//"groups/1/contacts?ids=1&ids=3"
//"groups/1/contacts?ids=List(1,3)"
final Set<String> idSet = new HashSet<String>();
idSet.add("1");
idSet.add("3");
final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "groups/1/contacts", idSet, null, null);
final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "groups/1/contacts", idSet, null, null);
return new Object[][] { { uriDetails1 }, { uriDetails2 } };
}
use of com.linkedin.restli.internal.testutils.URIDetails in project rest.li by linkedin.
the class TestGroupsRequestBuilders method requestMembershipsBatchDataProviderBatch.
@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestMembershipsBatchDataProvider")
private static Object[][] requestMembershipsBatchDataProviderBatch() {
//Sample URIs:
//"groupMemberships?ids=groupID%3D1%26memberID%3D1&ids=groupID%3D2%26memberID%3D1&ids=groupID%3D2%26memberID%3D2"
//"groupMemberships?ids=List((groupID:2,memberID:1),(groupID:2,memberID:2),(groupID:1,memberID:1))"
//Note that we need two different ID sets, one for V1 and one for V2 since batch operations on compound keys
//are unique.
final Set<String> idSetV1 = new HashSet<String>();
idSetV1.add("groupID=2&memberID=1");
idSetV1.add("groupID=2&memberID=2");
idSetV1.add("groupID=1&memberID=1");
final Set<DataMap> idSetV2 = new HashSet<DataMap>();
final DataMap id1 = new DataMap();
id1.put("groupID", "2");
id1.put("memberID", "1");
final DataMap id2 = new DataMap();
id2.put("groupID", "2");
id2.put("memberID", "2");
final DataMap id3 = new DataMap();
id3.put("groupID", "1");
id3.put("memberID", "1");
idSetV2.add(id1);
idSetV2.add(id2);
idSetV2.add(id3);
final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "groupMemberships", idSetV1, null, null);
final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "groupMemberships", idSetV2, null, null);
return new Object[][] { { uriDetails1 }, { uriDetails2 } };
}
use of com.linkedin.restli.internal.testutils.URIDetails in project rest.li by linkedin.
the class TestGroupsRequestBuilders method requestContactsBuilderDataProviderAction.
@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestContactsBuilderDataProviderAction")
private static Object[][] requestContactsBuilderDataProviderAction() {
//Sample URIs:
//"groups/42/contacts?action=spamContacts"
//"groups/42/contacts?action=spamContacts"
final Map<String, String> queryParamsMap = new HashMap<String, String>();
queryParamsMap.put("action", "spamContacts");
final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "groups/42/contacts", null, queryParamsMap, null);
final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "groups/42/contacts", null, queryParamsMap, null);
return new Object[][] { { new RootBuilderWrapper<Integer, GroupContact>(new ContactsBuilders()), uriDetails1 }, { new RootBuilderWrapper<Integer, GroupContact>(new ContactsBuilders()), uriDetails2 }, { new RootBuilderWrapper<Integer, GroupContact>(new ContactsRequestBuilders()), uriDetails1 }, { new RootBuilderWrapper<Integer, GroupContact>(new ContactsRequestBuilders()), uriDetails2 } };
}
Aggregations