use of com.linkedin.restli.internal.testutils.URIDetails in project rest.li by linkedin.
the class TestClientBuilders method getAll1.
@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "getAll1")
public Object[][] getAll1() {
//Sample URIs:
//"test?count=4&fields=message,id&start=1"
//"test?count=4&fields=message,id&start=1"
final Set<String> fieldSet = new HashSet<String>();
fieldSet.add("message");
fieldSet.add("id");
final Map<String, String> queryParamsMap = new HashMap<String, String>();
queryParamsMap.put("count", "4");
queryParamsMap.put("start", "1");
final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "test", null, queryParamsMap, fieldSet);
final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "test", null, queryParamsMap, fieldSet);
return new Object[][] { { uriDetails1 }, { uriDetails2 } };
}
use of com.linkedin.restli.internal.testutils.URIDetails in project rest.li by linkedin.
the class TestClientBuilders method search2.
@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "search2")
public Object[][] search2() {
//Sample URIs:
//"test/key=a%3Ab?p=42&q=search&start=1"
//"test/(key:a%3Ab)?p=42&q=search&start=1"
final Map<String, String> queryParamsMap = new HashMap<String, String>();
queryParamsMap.put("p", "42");
queryParamsMap.put("q", "search");
queryParamsMap.put("start", "1");
final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "test/key=a%3Ab", null, queryParamsMap, null);
final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "test/(key:a%3Ab)", null, queryParamsMap, null);
return new Object[][] { { uriDetails1 }, { uriDetails2 } };
}
use of com.linkedin.restli.internal.testutils.URIDetails in project rest.li by linkedin.
the class TestClientBuilders method batchComplexKeyAndParam.
@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "batchComplexKeyAndParam")
public Object[][] batchComplexKeyAndParam() {
//Sample valid URIs:
//"test?ids%5B0%5D.$params.id=20&ids%5B0%5D.$params.message=ParamMessage2&ids%5B0%5D.id=2&ids%5B0%5D.message=KeyMessage2&ids%5B1%5D.$params.id=10&ids%5B1%5D.$params.message=ParamMessage1&ids%5B1%5D.id=1&ids%5B1%5D.message=KeyMessage1&testParam.id=123&testParam.message=ParamMessage"
//"test?ids=List(($params:(id:20,message:ParamMessage2),id:2,message:KeyMessage2),($params:(id:10,message:ParamMessage1),id:1,message:KeyMessage1))&testParam=(id:123,message:ParamMessage)"
final DataMap idMessageMap = new DataMap();
idMessageMap.put("id", "123");
idMessageMap.put("message", "ParamMessage");
final Map<String, DataComplex> queryParamsMap = new HashMap<String, DataComplex>();
queryParamsMap.put("testParam", idMessageMap);
final Set<DataMap> idList = new HashSet<DataMap>();
final DataMap idMapOne = new DataMap();
idMapOne.put("id", "1");
idMapOne.put("message", "KeyMessage1");
final DataMap paramMapOne = new DataMap();
paramMapOne.put("id", "10");
paramMapOne.put("message", "ParamMessage1");
idMapOne.put("$params", paramMapOne);
final DataMap idMapTwo = new DataMap();
idMapTwo.put("id", "2");
idMapTwo.put("message", "KeyMessage2");
final DataMap paramMapTwo = new DataMap();
paramMapTwo.put("id", "20");
paramMapTwo.put("message", "ParamMessage2");
idMapTwo.put("$params", paramMapTwo);
idList.add(idMapOne);
idList.add(idMapTwo);
final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "test", idList, queryParamsMap, null);
final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "test", idList, queryParamsMap, null);
return new Object[][] { { uriDetails1 }, { uriDetails2 } };
}
use of com.linkedin.restli.internal.testutils.URIDetails in project rest.li by linkedin.
the class TestClientBuilders method complexKeyAndParam.
@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "complexKeyAndParam")
public Object[][] complexKeyAndParam() {
//Sample URIs:
//"test/$params.id=10&$params.message=ParamMessage&id=1&message=KeyMessage?testParam.id=123&testParam.message=ParamMessage"
//"test/($params:(id:10,message:ParamMessage),id:1,message:KeyMessage)?testParam=(id:123,message:ParamMessage)"
final DataMap idMessageMap = new DataMap();
idMessageMap.put("id", "123");
idMessageMap.put("message", "ParamMessage");
final Map<String, DataComplex> queryParamsMap = new HashMap<String, DataComplex>();
queryParamsMap.put("testParam", idMessageMap);
final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "test/$params.id=10&$params.message=ParamMessage&id=1&message=KeyMessage", null, queryParamsMap, null);
final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "test/($params:(id:10,message:ParamMessage),id:1,message:KeyMessage)", null, queryParamsMap, null);
return new Object[][] { { uriDetails1 }, { uriDetails2 } };
}
use of com.linkedin.restli.internal.testutils.URIDetails in project rest.li by linkedin.
the class TestClientBuilders method entityWithParam.
@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "entityWithParam")
public Object[][] entityWithParam() {
//Sample URIs"
//"test/3?foo=bar"
//"test/3?foo=bar"
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/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 } };
}
Aggregations