Search in sources :

Example 6 with URIDetails

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

the class TestClientBuilders method batchWithParam.

@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "batchWithParam")
public Object[][] batchWithParam() {
    //Sample URIs:
    //"test?foo=bar&ids=1&ids=2"
    //"test?foo=bar&ids=List(1,2)"
    final Set<String> idSet = new HashSet<String>();
    idSet.add("1");
    idSet.add("2");
    final Map<String, String> queryParamsMap = new HashMap<String, String>();
    queryParamsMap.put("foo", "bar");
    final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "test", idSet, queryParamsMap, null);
    final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "test", idSet, queryParamsMap, null);
    return new Object[][] { { uriDetails1 }, { uriDetails2 } };
}
Also used : URIDetails(com.linkedin.restli.internal.testutils.URIDetails) HashMap(java.util.HashMap) ByteString(com.linkedin.data.ByteString) HashSet(java.util.HashSet) DataProvider(org.testng.annotations.DataProvider)

Example 7 with URIDetails

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

the class TestClientBuilders method subSubResourceAction2.

@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "subSubResourceAction2")
public Object[][] subSubResourceAction2() {
    //Sample URIs:
    //"foo/http%3A%2F%2Fexample.com%2Fimages%2F1.png/bar/http%3A%2F%2Fexample.com%2Fimages%2F2.png/baz?action=action"
    //"foo/http%3A%2F%2Fexample.com%2Fimages%2F1.png/bar/http%3A%2F%2Fexample.com%2Fimages%2F2.png/baz?action=action"
    final Map<String, String> queryParamsMap = new HashMap<String, String>();
    queryParamsMap.put("action", "action");
    final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "foo/http%3A%2F%2Fexample.com%2Fimages%2F1.png/bar/http%3A%2F%2Fexample.com%2Fimages%2F2.png/baz", null, queryParamsMap, null);
    final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "foo/http%3A%2F%2Fexample.com%2Fimages%2F1.png/bar/http%3A%2F%2Fexample.com%2Fimages%2F2.png/baz", null, queryParamsMap, null);
    return new Object[][] { { uriDetails1 }, { uriDetails2 } };
}
Also used : URIDetails(com.linkedin.restli.internal.testutils.URIDetails) HashMap(java.util.HashMap) ByteString(com.linkedin.data.ByteString) DataProvider(org.testng.annotations.DataProvider)

Example 8 with URIDetails

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

the class TestClientBuilders method singleEntity.

@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "singleEntity")
public Object[][] singleEntity() {
    //Sample URIs:
    //"test/1"
    //"test/1"
    final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "test/1", null, null, null);
    final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "test/1", null, null, null);
    return new Object[][] { { uriDetails1 }, { uriDetails2 } };
}
Also used : URIDetails(com.linkedin.restli.internal.testutils.URIDetails) DataProvider(org.testng.annotations.DataProvider)

Example 9 with URIDetails

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

the class TestClientBuilders method encodingEqualsAnd1.

@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "encodingEqualsAndValue")
public Object[][] encodingEqualsAnd1() {
    //Sample URIs:
    //"test/3?foo=bar%26baz%3Dqux"
    //"test/3?foo=bar%26baz%3Dqux"
    final Map<String, String> queryParamsMap = new HashMap<String, String>();
    queryParamsMap.put("foo", "bar&baz=qux");
    final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "test/3", null, queryParamsMap, null);
    final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "test/3", null, queryParamsMap, null);
    return new Object[][] { { uriDetails1 }, { uriDetails2 } };
}
Also used : URIDetails(com.linkedin.restli.internal.testutils.URIDetails) HashMap(java.util.HashMap) ByteString(com.linkedin.data.ByteString) DataProvider(org.testng.annotations.DataProvider)

Example 10 with URIDetails

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

the class TestClientBuilders method simpleSubResourceAction2.

@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "simpleSubResourceAction2")
public Object[][] simpleSubResourceAction2() {
    //Sample URIs:
    //"foo/http%3A%2F%2Fexample.com%2Fimages%2F1.png/bar?action=action"
    //"foo/http%3A%2F%2Fexample.com%2Fimages%2F1.png/bar?action=action"
    final Map<String, String> queryParamsMap = new HashMap<String, String>();
    queryParamsMap.put("action", "action");
    final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "foo/http%3A%2F%2Fexample.com%2Fimages%2F1.png/bar", null, queryParamsMap, null);
    final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "foo/http%3A%2F%2Fexample.com%2Fimages%2F1.png/bar", null, queryParamsMap, null);
    return new Object[][] { { uriDetails1 }, { uriDetails2 } };
}
Also used : URIDetails(com.linkedin.restli.internal.testutils.URIDetails) HashMap(java.util.HashMap) ByteString(com.linkedin.data.ByteString) 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