use of com.linkedin.restli.server.custom.types.CustomLong in project rest.li by linkedin.
the class TestRestLiMethodInvocation method testCustomTypeParametersCustomLong.
@Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "customLongParam")
public void testCustomTypeParametersCustomLong(ProtocolVersion version, String uri) throws Exception {
ResourceModel repliesResourceModel = buildResourceModel(RepliesCollectionResource.class);
ResourceMethodDescriptor methodDescriptor = repliesResourceModel.findFinderMethod("customLong");
RepliesCollectionResource repliesResource = getMockResource(RepliesCollectionResource.class);
repliesResource.customLong(new CustomLong(100L));
EasyMock.expectLastCall().andReturn(null).once();
checkInvocation(repliesResource, methodDescriptor, "GET", version, uri);
}
use of com.linkedin.restli.server.custom.types.CustomLong in project rest.li by linkedin.
the class TestRestLiMethodInvocation method testCustomTypeParametersCustomLongArrayWithDefault.
@Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "customLongArrayDefault")
public void testCustomTypeParametersCustomLongArrayWithDefault(ProtocolVersion version, String uri) throws Exception {
ResourceModel repliesResourceModel = buildResourceModel(RepliesCollectionResource.class);
ResourceMethodDescriptor methodDescriptor = repliesResourceModel.findFinderMethod("customLongArrayDefault");
RepliesCollectionResource repliesResource = getMockResource(RepliesCollectionResource.class);
CustomLong[] longs = { new CustomLong(100L), new CustomLong(200L) };
CustomLong[] longsFromDefault = { new CustomLong(1235L), new CustomLong(6789L) };
repliesResource.customLongArrayDefault(EasyMock.aryEq(longs), EasyMock.aryEq(longsFromDefault));
EasyMock.expectLastCall().andReturn(null).once();
checkInvocation(repliesResource, methodDescriptor, "GET", version, uri);
}
use of com.linkedin.restli.server.custom.types.CustomLong in project rest.li by linkedin.
the class TestRestLiMethodInvocation method testCustomTypeParametersCustomLongArray.
@Test(dataProvider = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "customLongArray")
public void testCustomTypeParametersCustomLongArray(ProtocolVersion version, String uri) throws Exception {
ResourceModel repliesResourceModel = buildResourceModel(RepliesCollectionResource.class);
ResourceMethodDescriptor methodDescriptor = repliesResourceModel.findFinderMethod("customLongArray");
RepliesCollectionResource repliesResource = getMockResource(RepliesCollectionResource.class);
CustomLong[] longs = { new CustomLong(100L), new CustomLong(200L) };
repliesResource.customLongArray(EasyMock.aryEq(longs));
EasyMock.expectLastCall().andReturn(null).once();
checkInvocation(repliesResource, methodDescriptor, "GET", version, uri);
}
use of com.linkedin.restli.server.custom.types.CustomLong 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);
}
use of com.linkedin.restli.server.custom.types.CustomLong in project rest.li by linkedin.
the class TestConvertSimpleValue method testConvertCustomLong.
@Test
public void testConvertCustomLong() {
CustomLong forceRegistration = new CustomLong(0L);
Class<?> customLongClass = CustomLong.class;
Object convertedCustomLong = ArgumentUtils.convertSimpleValue("100", DataTemplateUtil.getSchema(CustomLongRef.class), customLongClass);
Assert.assertTrue(convertedCustomLong.getClass().equals(customLongClass));
CustomLong customLong = (CustomLong) convertedCustomLong;
Assert.assertTrue(customLong.toLong().equals(Long.valueOf(100)));
}
Aggregations