use of com.linkedin.restli.server.CustomStringRef in project rest.li by linkedin.
the class TestParameterDefaultValue method testCustomParams.
@Test
public void testCustomParams() {
// Initialize the custom class to ensure the coercer is registered.
Custom.initializeCustomClass(CustomString.class);
Object result = test("custom string ref", CustomString.class, new CustomStringRef().getSchema());
final CustomString expectedCustomString = new CustomString("custom string ref");
Assert.assertEquals(result, expectedCustomString);
Assert.assertSame(result.getClass(), CustomString.class);
result = test("12345", CustomLong.class, new CustomLongRef().getSchema());
final CustomLong expectedCustomLong = new CustomLong(12345L);
Assert.assertEquals(result, expectedCustomLong);
Assert.assertSame(result.getClass(), CustomLong.class);
}
Aggregations