Search in sources :

Example 6 with RepliesCollectionResource

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

the class TestRestLiMethodInvocation method testCustomTypeParametersCustomLongWithDefault.

@Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "customLongDefault")
public void testCustomTypeParametersCustomLongWithDefault(ProtocolVersion version, String uri) throws Exception {
    ResourceModel repliesResourceModel = buildResourceModel(RepliesCollectionResource.class);
    ResourceMethodDescriptor methodDescriptor = repliesResourceModel.findFinderMethod("customLongDefault");
    RepliesCollectionResource repliesResource = getMockResource(RepliesCollectionResource.class);
    repliesResource.customLongDefault(new CustomLong(100L), new CustomLong(1235L));
    EasyMock.expectLastCall().andReturn(null).once();
    checkInvocation(repliesResource, methodDescriptor, "GET", version, uri);
}
Also used : PromiseRepliesCollectionResource(com.linkedin.restli.server.twitter.PromiseRepliesCollectionResource) RepliesCollectionResource(com.linkedin.restli.server.twitter.RepliesCollectionResource) AsyncRepliesCollectionResource(com.linkedin.restli.server.twitter.AsyncRepliesCollectionResource) 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) CustomLong(com.linkedin.restli.server.custom.types.CustomLong) Test(org.testng.annotations.Test) AfterTest(org.testng.annotations.AfterTest) BeforeTest(org.testng.annotations.BeforeTest)

Example 7 with RepliesCollectionResource

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

the class TestRestLiMethodInvocation method testCustomTypeParametersCustomString.

@Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "customStringParam")
public void testCustomTypeParametersCustomString(ProtocolVersion version, String uri) throws Exception {
    ResourceModel repliesResourceModel = buildResourceModel(RepliesCollectionResource.class);
    ResourceMethodDescriptor methodDescriptor = repliesResourceModel.findFinderMethod("customString");
    RepliesCollectionResource repliesResource = getMockResource(RepliesCollectionResource.class);
    repliesResource.customString(new CustomString("foo"));
    EasyMock.expectLastCall().andReturn(null).once();
    checkInvocation(repliesResource, methodDescriptor, "GET", version, uri);
}
Also used : PromiseRepliesCollectionResource(com.linkedin.restli.server.twitter.PromiseRepliesCollectionResource) RepliesCollectionResource(com.linkedin.restli.server.twitter.RepliesCollectionResource) AsyncRepliesCollectionResource(com.linkedin.restli.server.twitter.AsyncRepliesCollectionResource) 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) CustomString(com.linkedin.restli.server.custom.types.CustomString) Test(org.testng.annotations.Test) AfterTest(org.testng.annotations.AfterTest) BeforeTest(org.testng.annotations.BeforeTest)

Aggregations

ResourceMethodDescriptor (com.linkedin.restli.internal.server.model.ResourceMethodDescriptor)7 ResourceModel (com.linkedin.restli.internal.server.model.ResourceModel)7 RestLiTestHelper.buildResourceModel (com.linkedin.restli.server.test.RestLiTestHelper.buildResourceModel)7 AsyncRepliesCollectionResource (com.linkedin.restli.server.twitter.AsyncRepliesCollectionResource)7 PromiseRepliesCollectionResource (com.linkedin.restli.server.twitter.PromiseRepliesCollectionResource)7 RepliesCollectionResource (com.linkedin.restli.server.twitter.RepliesCollectionResource)7 AfterTest (org.testng.annotations.AfterTest)7 BeforeTest (org.testng.annotations.BeforeTest)7 Test (org.testng.annotations.Test)7 CustomLong (com.linkedin.restli.server.custom.types.CustomLong)4 CustomString (com.linkedin.restli.server.custom.types.CustomString)3 ByteString (com.linkedin.data.ByteString)2 AsyncDiscoveredItemsResource (com.linkedin.restli.server.twitter.AsyncDiscoveredItemsResource)2 AsyncLocationResource (com.linkedin.restli.server.twitter.AsyncLocationResource)2 DiscoveredItemsResource (com.linkedin.restli.server.twitter.DiscoveredItemsResource)2 LocationResource (com.linkedin.restli.server.twitter.LocationResource)2 PromiseDiscoveredItemsResource (com.linkedin.restli.server.twitter.PromiseDiscoveredItemsResource)2 PromiseLocationResource (com.linkedin.restli.server.twitter.PromiseLocationResource)2 PathSpec (com.linkedin.data.schema.PathSpec)1 PatchTree (com.linkedin.data.transform.patch.request.PatchTree)1