Search in sources :

Example 1 with ActionsFluentClient

use of com.linkedin.restli.examples.greetings.client.ActionsFluentClient in project rest.li by linkedin.

the class TestParseqBasedFluentClientApi method testActionSetActionWithTypeRef.

@Test
public void testActionSetActionWithTypeRef() throws Exception {
    // This end point use typeref for both ActionParam and Action methods' return value
    Actions actionsFluentClient = new ActionsFluentClient(_parSeqRestliClient, _parSeqUnitTestHelper.getEngine());
    Assert.assertEquals(actionsFluentClient.customTypeRef(new CustomLong(500L)).toCompletableFuture().get(5000, TimeUnit.MILLISECONDS), new CustomLong(500L));
}
Also used : ActionsFluentClient(com.linkedin.restli.examples.greetings.client.ActionsFluentClient) Actions(com.linkedin.restli.examples.greetings.client.Actions) CustomLong(com.linkedin.restli.examples.custom.types.CustomLong) Test(org.testng.annotations.Test)

Example 2 with ActionsFluentClient

use of com.linkedin.restli.examples.greetings.client.ActionsFluentClient in project rest.li by linkedin.

the class TestParseqBasedFluentClientApi method testActionSetActionWithReturn.

@Test
public void testActionSetActionWithReturn() throws Exception {
    Actions actionsFluentClient = new ActionsFluentClient(_parSeqRestliClient, _parSeqUnitTestHelper.getEngine());
    Assert.assertTrue(actionsFluentClient.ultimateAnswer().toCompletableFuture().get(5000, TimeUnit.MILLISECONDS) == 42);
}
Also used : ActionsFluentClient(com.linkedin.restli.examples.greetings.client.ActionsFluentClient) Actions(com.linkedin.restli.examples.greetings.client.Actions) Test(org.testng.annotations.Test)

Example 3 with ActionsFluentClient

use of com.linkedin.restli.examples.greetings.client.ActionsFluentClient in project rest.li by linkedin.

the class TestParseqBasedFluentClientApi method testActionSetActionWithNoReturn.

@Test
public void testActionSetActionWithNoReturn() throws Exception {
    Actions actionsFluentClient = new ActionsFluentClient(_parSeqRestliClient, _parSeqUnitTestHelper.getEngine());
    Assert.assertNull(actionsFluentClient.returnVoid().toCompletableFuture().get(5000, TimeUnit.MILLISECONDS));
}
Also used : ActionsFluentClient(com.linkedin.restli.examples.greetings.client.ActionsFluentClient) Actions(com.linkedin.restli.examples.greetings.client.Actions) Test(org.testng.annotations.Test)

Aggregations

Actions (com.linkedin.restli.examples.greetings.client.Actions)3 ActionsFluentClient (com.linkedin.restli.examples.greetings.client.ActionsFluentClient)3 Test (org.testng.annotations.Test)3 CustomLong (com.linkedin.restli.examples.custom.types.CustomLong)1