Search in sources :

Example 26 with PromiseStatusCollectionResource

use of com.linkedin.restli.server.twitter.PromiseStatusCollectionResource in project rest.li by linkedin.

the class TestRestLiMethodInvocation method testPromisePagingContextUserTimelineDefault.

@Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "statusUserTimelineDefault")
public void testPromisePagingContextUserTimelineDefault(ProtocolVersion version, String query) throws Exception {
    ResourceModel statusResourceModel = buildResourceModel(PromiseStatusCollectionResource.class);
    ResourceMethodDescriptor methodDescriptor = statusResourceModel.findFinderMethod("user_timeline");
    PromiseStatusCollectionResource statusResource = getMockResource(PromiseStatusCollectionResource.class);
    EasyMock.expect(statusResource.getUserTimeline(eq(true), eq(new PagingContext(10, 100, false, false)))).andReturn(Promises.value(null)).once();
    checkInvocation(statusResource, methodDescriptor, "GET", version, "/promisestatuses" + query);
}
Also used : PromiseStatusCollectionResource(com.linkedin.restli.server.twitter.PromiseStatusCollectionResource) PagingContext(com.linkedin.restli.server.PagingContext) ResourceMethodDescriptor(com.linkedin.restli.internal.server.model.ResourceMethodDescriptor) ResourceModel(com.linkedin.restli.internal.server.model.ResourceModel) RestLiTestHelper.buildResourceModel(com.linkedin.restli.server.test.RestLiTestHelper.buildResourceModel) Test(org.testng.annotations.Test) AfterTest(org.testng.annotations.AfterTest) BeforeTest(org.testng.annotations.BeforeTest)

Aggregations

ResourceMethodDescriptor (com.linkedin.restli.internal.server.model.ResourceMethodDescriptor)26 ResourceModel (com.linkedin.restli.internal.server.model.ResourceModel)26 RestLiTestHelper.buildResourceModel (com.linkedin.restli.server.test.RestLiTestHelper.buildResourceModel)26 PromiseStatusCollectionResource (com.linkedin.restli.server.twitter.PromiseStatusCollectionResource)26 AfterTest (org.testng.annotations.AfterTest)26 BeforeTest (org.testng.annotations.BeforeTest)26 Test (org.testng.annotations.Test)26 ByteString (com.linkedin.data.ByteString)11 CustomString (com.linkedin.restli.server.custom.types.CustomString)11 PromiseDiscoveredItemsResource (com.linkedin.restli.server.twitter.PromiseDiscoveredItemsResource)7 DiscoveredItemKey (com.linkedin.restli.server.twitter.TwitterTestDataModels.DiscoveredItemKey)6 DiscoveredItemKeyParams (com.linkedin.restli.server.twitter.TwitterTestDataModels.DiscoveredItemKeyParams)6 RestResponse (com.linkedin.r2.message.rest.RestResponse)4 HttpStatus (com.linkedin.restli.common.HttpStatus)4 PromiseLocationResource (com.linkedin.restli.server.twitter.PromiseLocationResource)4 Status (com.linkedin.restli.server.twitter.TwitterTestDataModels.Status)4 RequestContext (com.linkedin.r2.message.RequestContext)3 RestException (com.linkedin.r2.message.rest.RestException)3 RestLiSyntaxException (com.linkedin.restli.internal.server.util.RestLiSyntaxException)3 RestLiServiceException (com.linkedin.restli.server.RestLiServiceException)3