Search in sources :

Example 21 with URIDetails

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

the class TestGroupsRequestBuilders method requestGroupsBuilderDataProviderSearchWithOptional1.

@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestGroupsBuilderDataProviderSearchWithOptional1")
private static Object[][] requestGroupsBuilderDataProviderSearchWithOptional1() {
    //Sample URIs:
    //"groups?keywords=linkedin&q=search"
    //"groups?keywords=linkedin&q=search"
    final Map<String, String> queryParamsMap = new HashMap<String, String>();
    queryParamsMap.put("keywords", "linkedin");
    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 22 with URIDetails

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

the class TestGroupsRequestBuilders method requestGroupsBuilderDataProviderSearch.

@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestGroupsBuilderDataProviderSearch")
private static Object[][] requestGroupsBuilderDataProviderSearch() {
    //Sample URIs:
    //"groups?groupID=1&keywords=linkedin&nameKeywords=test&q=search"
    //"groups?groupID=1&keywords=linkedin&nameKeywords=test&q=search"
    final Map<String, String> queryParamsMap = new HashMap<String, String>();
    queryParamsMap.put("groupID", "1");
    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 23 with URIDetails

use of com.linkedin.restli.internal.testutils.URIDetails 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 } };
}
Also used : URIDetails(com.linkedin.restli.internal.testutils.URIDetails) CompoundKey(com.linkedin.restli.common.CompoundKey) GroupMembershipsRequestBuilders(com.linkedin.restli.examples.groups.client.GroupMembershipsRequestBuilders) GroupMembership(com.linkedin.restli.examples.groups.api.GroupMembership) GroupMembershipsBuilders(com.linkedin.restli.examples.groups.client.GroupMembershipsBuilders) DataProvider(org.testng.annotations.DataProvider)

Example 24 with URIDetails

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

the class TestGroupsRequestBuilders method requestGroupsBatchDataProviderBatch.

@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestGroupsBatchDataProvider")
private static Object[][] requestGroupsBatchDataProviderBatch() {
    //Sample URIs:
    //"groups?fields=approvalModes&ids=1&ids=3"
    //"groups?fields=approvalModes&ids=List(1,3)"
    final Set<String> fieldSet = new HashSet<String>();
    fieldSet.add("approvalModes");
    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", idSet, null, fieldSet);
    final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "groups", idSet, null, fieldSet);
    return new Object[][] { { uriDetails1 }, { uriDetails2 } };
}
Also used : URIDetails(com.linkedin.restli.internal.testutils.URIDetails) HashSet(java.util.HashSet) DataProvider(org.testng.annotations.DataProvider)

Example 25 with URIDetails

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

the class TestGroupsRequestBuilders method requestGroupsBuilderDataProviderFindByEmailDomainWithFields.

@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestGroupsBuilderDataProviderFindByEmailDomainWithFields")
private static Object[][] requestGroupsBuilderDataProviderFindByEmailDomainWithFields() {
    //Sample URIs:
    //"groups?count=10&emailDomain=foo.com&fields=locale,state&q=emailDomain&start=0"
    //"groups?count=10&emailDomain=foo.com&fields=locale,state&q=emailDomain&start=0"
    final Set<String> fieldSet = new HashSet<String>();
    fieldSet.add("locale");
    fieldSet.add("state");
    final Map<String, String> queryParamsMap = new HashMap<String, String>();
    queryParamsMap.put("count", "10");
    queryParamsMap.put("emailDomain", "foo.com");
    queryParamsMap.put("q", "emailDomain");
    queryParamsMap.put("start", "0");
    final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "groups", null, queryParamsMap, fieldSet);
    final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "groups", null, queryParamsMap, fieldSet);
    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) 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