use of com.linkedin.restli.examples.groups.client.GroupMembershipsBuilders in project rest.li by linkedin.
the class TestGroupsRequestBuilders method requestMembershipsBuilderDataProviderEntity.
@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestMembershipsBuilderDataProviderEntity")
private static Object[][] requestMembershipsBuilderDataProviderEntity() {
//Sample URIs:
//"groupMemberships/groupID=7&memberID=1"
//"groupMemberships/(groupID:7,memberID:1)"
final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "groupMemberships/groupID=7&memberID=1", null, null, null);
final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "groupMemberships/(groupID:7,memberID:1)", null, null, null);
return new Object[][] { { new RootBuilderWrapper<CompoundKey, GroupMembership>(new GroupMembershipsBuilders()), uriDetails1 }, { new RootBuilderWrapper<CompoundKey, GroupMembership>(new GroupMembershipsBuilders()), uriDetails2 }, { new RootBuilderWrapper<CompoundKey, GroupMembership>(new GroupMembershipsRequestBuilders()), uriDetails1 }, { new RootBuilderWrapper<CompoundKey, GroupMembership>(new GroupMembershipsRequestBuilders()), uriDetails2 } };
}
use of com.linkedin.restli.examples.groups.client.GroupMembershipsBuilders in project rest.li by linkedin.
the class TestGroupsRequestBuilders method requestMembershipsBuilderDataProviderEntityFinderByGroupWithOptional.
@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestMembershipsBuilderDataProviderEntityFinderByGroupWithOptional")
private static Object[][] requestMembershipsBuilderDataProviderEntityFinderByGroupWithOptional() {
//Sample URIs:
//"groupMemberships/groupID=1?firstName=Bruce&q=group"
//"groupMemberships/(groupID:1)?firstName=Bruce&q=group"
final Map<String, String> queryParamsMap = new HashMap<String, String>();
queryParamsMap.put("firstName", "Bruce");
queryParamsMap.put("q", "group");
final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "groupMemberships/groupID=1", null, queryParamsMap, null);
final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "groupMemberships/(groupID:1)", null, queryParamsMap, null);
return new Object[][] { { new RootBuilderWrapper<CompoundKey, GroupMembership>(new GroupMembershipsBuilders()), uriDetails1 }, { new RootBuilderWrapper<CompoundKey, GroupMembership>(new GroupMembershipsBuilders()), uriDetails2 }, { new RootBuilderWrapper<CompoundKey, GroupMembership>(new GroupMembershipsRequestBuilders()), uriDetails1 }, { new RootBuilderWrapper<CompoundKey, GroupMembership>(new GroupMembershipsRequestBuilders()), uriDetails2 } };
}
use of com.linkedin.restli.examples.groups.client.GroupMembershipsBuilders in project rest.li by linkedin.
the class TestGroupsRequestBuilders method requestMembershipsBuilderDataProviderEntityFinderByMember.
@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestMembershipsBuilderDataProviderEntityFinderByMember")
private static Object[][] requestMembershipsBuilderDataProviderEntityFinderByMember() {
//Sample URIs:
//"groupMemberships/memberID=1?q=member"
//"groupMemberships/(memberID:1)?q=member"
final Map<String, String> queryParamsMap = new HashMap<String, String>();
queryParamsMap.put("q", "member");
final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "groupMemberships/memberID=1", null, queryParamsMap, null);
final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "groupMemberships/(memberID:1)", null, queryParamsMap, null);
return new Object[][] { { new RootBuilderWrapper<CompoundKey, GroupMembership>(new GroupMembershipsBuilders()), uriDetails1 }, { new RootBuilderWrapper<CompoundKey, GroupMembership>(new GroupMembershipsBuilders()), uriDetails2 }, { new RootBuilderWrapper<CompoundKey, GroupMembership>(new GroupMembershipsRequestBuilders()), uriDetails1 }, { new RootBuilderWrapper<CompoundKey, GroupMembership>(new GroupMembershipsRequestBuilders()), uriDetails2 } };
}
use of com.linkedin.restli.examples.groups.client.GroupMembershipsBuilders in project rest.li by linkedin.
the class TestGroupsRequestBuilders method requestMembershipsBuilderDataProviderEntityFinderByGroup.
@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestMembershipsBuilderDataProviderEntityFinderByGroup")
private static Object[][] requestMembershipsBuilderDataProviderEntityFinderByGroup() {
//Sample URIs:
//"groupMemberships/groupID=1?email=bruce@test.linkedin.com&firstName=Bruce&lastName=Willis&level=MEMBER&q=group&sort=LAST_NAME_ASC"
//"groupMemberships/(groupID:1)?email=bruce@test.linkedin.com&firstName=Bruce&lastName=Willis&level=MEMBER&q=group&sort=LAST_NAME_ASC"
final Map<String, String> queryParamsMap = new HashMap<String, String>();
queryParamsMap.put("email", "bruce@test.linkedin.com");
queryParamsMap.put("firstName", "Bruce");
queryParamsMap.put("lastName", "Willis");
queryParamsMap.put("level", "MEMBER");
queryParamsMap.put("q", "group");
queryParamsMap.put("sort", "LAST_NAME_ASC");
final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "groupMemberships/groupID=1", null, queryParamsMap, null);
final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "groupMemberships/(groupID:1)", null, queryParamsMap, null);
return new Object[][] { { new RootBuilderWrapper<CompoundKey, GroupMembership>(new GroupMembershipsBuilders()), uriDetails1 }, { new RootBuilderWrapper<CompoundKey, GroupMembership>(new GroupMembershipsBuilders()), uriDetails2 }, { new RootBuilderWrapper<CompoundKey, GroupMembership>(new GroupMembershipsRequestBuilders()), uriDetails1 }, { new RootBuilderWrapper<CompoundKey, GroupMembership>(new GroupMembershipsRequestBuilders()), uriDetails2 } };
}
use of com.linkedin.restli.examples.groups.client.GroupMembershipsBuilders in project rest.li by linkedin.
the class TestGroupsRequestBuilders method testAssociationBatchGetByAssociationMultipleCompoundKeys2.
@Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestMembershipsBatchDataProvider")
public void testAssociationBatchGetByAssociationMultipleCompoundKeys2(URIDetails expectedURIDetails) throws IOException, RestException {
GroupMembershipsBuilders.Key key1 = new GroupMembershipsBuilders.Key().setGroupId(1).setMemberId(1);
GroupMembershipsBuilders.Key key2 = new GroupMembershipsBuilders.Key().setGroupId(2).setMemberId(1);
GroupMembershipsBuilders.Key key3 = new GroupMembershipsBuilders.Key().setGroupId(2).setMemberId(2);
Request<BatchKVResponse<CompoundKey, GroupMembership>> request = new GroupMembershipsBuilders().batchGet().ids(key1, key2, key3).buildKV();
checkRequestBuilder(request, ResourceMethod.BATCH_GET, BatchKVResponseDecoder.class, expectedURIDetails, null);
}
Aggregations