Search in sources :

Example 11 with GroupsRequestBuilders

use of com.linkedin.restli.examples.groups.client.GroupsRequestBuilders in project rest.li by linkedin.

the class TestGroupsRequestBuilders method requestGroupsBuilderDataProviderFindByManagerId.

@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestGroupsBuilderDataProviderFindByManagerId")
private static Object[][] requestGroupsBuilderDataProviderFindByManagerId() {
    //Sample URIs:
    //"groups?managerMemberID=1&q=manager"
    //"groups?managerMemberID=1&q=manager"
    final Map<String, String> queryParamsMap = new HashMap<String, String>();
    queryParamsMap.put("managerMemberID", "1");
    queryParamsMap.put("q", "manager");
    final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "groups", null, queryParamsMap, null);
    final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "groups", null, queryParamsMap, null);
    return new Object[][] { { new RootBuilderWrapper<Integer, Group>(new GroupsBuilders()), uriDetails1 }, { new RootBuilderWrapper<Integer, Group>(new GroupsBuilders()), uriDetails2 }, { new RootBuilderWrapper<Integer, Group>(new GroupsRequestBuilders()), uriDetails1 }, { new RootBuilderWrapper<Integer, Group>(new GroupsRequestBuilders()), uriDetails2 } };
}
Also used : Group(com.linkedin.restli.examples.groups.api.Group) URIDetails(com.linkedin.restli.internal.testutils.URIDetails) GroupsRequestBuilders(com.linkedin.restli.examples.groups.client.GroupsRequestBuilders) HashMap(java.util.HashMap) GroupsBuilders(com.linkedin.restli.examples.groups.client.GroupsBuilders) DataProvider(org.testng.annotations.DataProvider)

Example 12 with GroupsRequestBuilders

use of com.linkedin.restli.examples.groups.client.GroupsRequestBuilders in project rest.li by linkedin.

the class TestGroupsRequestBuilders method requestGroupsBuilderDataProviderSearchWithOptional2.

@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestGroupsBuilderDataProviderSearchWithOptional2")
private static Object[][] requestGroupsBuilderDataProviderSearchWithOptional2() {
    //Sample URIs:
    //"groups?keywords=linkedin&nameKeywords=test&q=search"
    //"groups?keywords=linkedin&nameKeywords=test&q=search"
    final Map<String, String> queryParamsMap = new HashMap<String, String>();
    queryParamsMap.put("keywords", "linkedin");
    queryParamsMap.put("nameKeywords", "test");
    queryParamsMap.put("q", "search");
    final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "groups", null, queryParamsMap, null);
    final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "groups", null, queryParamsMap, null);
    return new Object[][] { { new RootBuilderWrapper<Integer, Group>(new GroupsBuilders()), uriDetails1 }, { new RootBuilderWrapper<Integer, Group>(new GroupsBuilders()), uriDetails2 }, { new RootBuilderWrapper<Integer, Group>(new GroupsRequestBuilders()), uriDetails1 }, { new RootBuilderWrapper<Integer, Group>(new GroupsRequestBuilders()), uriDetails2 } };
}
Also used : Group(com.linkedin.restli.examples.groups.api.Group) URIDetails(com.linkedin.restli.internal.testutils.URIDetails) GroupsRequestBuilders(com.linkedin.restli.examples.groups.client.GroupsRequestBuilders) HashMap(java.util.HashMap) GroupsBuilders(com.linkedin.restli.examples.groups.client.GroupsBuilders) DataProvider(org.testng.annotations.DataProvider)

Example 13 with GroupsRequestBuilders

use of com.linkedin.restli.examples.groups.client.GroupsRequestBuilders in project rest.li by linkedin.

the class TestGroupsRequestBuilders method requestSpecialBuilderDataProvider.

@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestSpecialBuilderDataProvider")
private static Object[][] requestSpecialBuilderDataProvider() {
    //Sample URIs:
    //"SpecialGroups/42"
    //"SpecialGroups/1/contacts/42"
    //"SpecialGroups/42"
    //"SpecialGroups/1/contacts/42"
    final URIDetails uriDetailsV1_1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "SpecialGroups/42", null, null, null);
    final URIDetails uriDetailsV1_2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "SpecialGroups/1/contacts/42", null, null, null);
    final URIDetails uriDetailsV2_1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "SpecialGroups/42", null, null, null);
    final URIDetails uriDetailsV2_2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "SpecialGroups/1/contacts/42", null, null, null);
    return new Object[][] { { new RootBuilderWrapper<Integer, Group>(new GroupsBuilders("SpecialGroups")), new RootBuilderWrapper<Integer, GroupContact>(new ContactsBuilders("SpecialGroups")), uriDetailsV1_1, uriDetailsV1_2 }, { new RootBuilderWrapper<Integer, Group>(new GroupsBuilders("SpecialGroups")), new RootBuilderWrapper<Integer, GroupContact>(new ContactsBuilders("SpecialGroups")), uriDetailsV2_1, uriDetailsV2_2 }, { new RootBuilderWrapper<Integer, Group>(new GroupsRequestBuilders("SpecialGroups")), new RootBuilderWrapper<Integer, GroupContact>(new ContactsRequestBuilders("SpecialGroups")), uriDetailsV1_1, uriDetailsV1_2 }, { new RootBuilderWrapper<Integer, Group>(new GroupsRequestBuilders("SpecialGroups")), new RootBuilderWrapper<Integer, GroupContact>(new ContactsRequestBuilders("SpecialGroups")), uriDetailsV2_1, uriDetailsV2_2 } };
}
Also used : Group(com.linkedin.restli.examples.groups.api.Group) URIDetails(com.linkedin.restli.internal.testutils.URIDetails) GroupsRequestBuilders(com.linkedin.restli.examples.groups.client.GroupsRequestBuilders) GroupsBuilders(com.linkedin.restli.examples.groups.client.GroupsBuilders) ContactsRequestBuilders(com.linkedin.restli.examples.groups.client.ContactsRequestBuilders) ContactsBuilders(com.linkedin.restli.examples.groups.client.ContactsBuilders) GroupContact(com.linkedin.restli.examples.groups.api.GroupContact) DataProvider(org.testng.annotations.DataProvider)

Aggregations

Group (com.linkedin.restli.examples.groups.api.Group)13 GroupsRequestBuilders (com.linkedin.restli.examples.groups.client.GroupsRequestBuilders)13 GroupsBuilders (com.linkedin.restli.examples.groups.client.GroupsBuilders)10 URIDetails (com.linkedin.restli.internal.testutils.URIDetails)10 DataProvider (org.testng.annotations.DataProvider)10 HashMap (java.util.HashMap)7 Test (org.testng.annotations.Test)3 RestLiResponseException (com.linkedin.restli.client.RestLiResponseException)2 EmptyRecord (com.linkedin.restli.common.EmptyRecord)2 IdResponse (com.linkedin.restli.common.IdResponse)2 GroupMembershipParam (com.linkedin.restli.examples.groups.api.GroupMembershipParam)2 GroupMembershipsRequestBuilders (com.linkedin.restli.examples.groups.client.GroupMembershipsRequestBuilders)2 HashSet (java.util.HashSet)2 GroupContact (com.linkedin.restli.examples.groups.api.GroupContact)1 ContactsBuilders (com.linkedin.restli.examples.groups.client.ContactsBuilders)1 ContactsRequestBuilders (com.linkedin.restli.examples.groups.client.ContactsRequestBuilders)1