Search in sources :

Example 1 with GroupsBuilders

use of com.linkedin.restli.examples.groups.client.GroupsBuilders 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 2 with GroupsBuilders

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

the class TestGroupsRequestBuilders method testEntityCreate.

@Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestGroupsBuilderDataProviderNonEntity")
public void testEntityCreate(URIDetails expectedURIDetails) throws IOException, RestException {
    Request<EmptyRecord> request = new GroupsBuilders().create().input(new Group()).build();
    checkRequestBuilder(request, ResourceMethod.CREATE, CreateResponseDecoder.class, expectedURIDetails, new Group());
}
Also used : Group(com.linkedin.restli.examples.groups.api.Group) EmptyRecord(com.linkedin.restli.common.EmptyRecord) GroupsBuilders(com.linkedin.restli.examples.groups.client.GroupsBuilders) Test(org.testng.annotations.Test)

Example 3 with GroupsBuilders

use of com.linkedin.restli.examples.groups.client.GroupsBuilders 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 4 with GroupsBuilders

use of com.linkedin.restli.examples.groups.client.GroupsBuilders 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)

Example 5 with GroupsBuilders

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

the class TestGroupsRequestBuilders method requestGroupsBuilderDataProviderEntityWithFields.

@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "requestGroupsBuilderDataProviderEntityWithFields")
private static Object[][] requestGroupsBuilderDataProviderEntityWithFields() {
    //Sample URIs:
    //"groups/1?fields=badge"
    //"groups/1?fields=badge"
    final Set<String> fieldSet = new HashSet<String>();
    fieldSet.add("badge");
    final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "groups/1", null, null, fieldSet);
    final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "groups/1", null, null, 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) GroupsBuilders(com.linkedin.restli.examples.groups.client.GroupsBuilders) HashSet(java.util.HashSet) DataProvider(org.testng.annotations.DataProvider)

Aggregations

Group (com.linkedin.restli.examples.groups.api.Group)11 GroupsBuilders (com.linkedin.restli.examples.groups.client.GroupsBuilders)11 GroupsRequestBuilders (com.linkedin.restli.examples.groups.client.GroupsRequestBuilders)10 URIDetails (com.linkedin.restli.internal.testutils.URIDetails)10 DataProvider (org.testng.annotations.DataProvider)10 HashMap (java.util.HashMap)7 HashSet (java.util.HashSet)2 EmptyRecord (com.linkedin.restli.common.EmptyRecord)1 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 Test (org.testng.annotations.Test)1