use of com.linkedin.restli.examples.greetings.client.Actions 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));
}
use of com.linkedin.restli.examples.greetings.client.Actions 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);
}
use of com.linkedin.restli.examples.greetings.client.Actions 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));
}
use of com.linkedin.restli.examples.greetings.client.Actions in project rest.li by linkedin.
the class TestParseqBasedFluentClientApi method testCollectionEntityActionWithReturn.
// ----- Tests with actions ------
@Test
public void testCollectionEntityActionWithReturn() throws Exception {
Greetings greetings = new GreetingsFluentClient(_parSeqRestliClient, _parSeqUnitTestHelper.getEngine());
Greeting newGreeting;
newGreeting = greetings.updateTone(1L, param -> param.setNewTone(Tone.SINCERE).setDelOld(false)).toCompletableFuture().get(5000, TimeUnit.MILLISECONDS);
Assert.assertNotNull(newGreeting);
Assert.assertEquals(newGreeting.getId().longValue(), 1L);
Assert.assertEquals(newGreeting.getTone(), Tone.SINCERE);
newGreeting = greetings.updateTone(1L, param -> param.setNewTone(Tone.INSULTING)).toCompletableFuture().get(5000, TimeUnit.MILLISECONDS);
Assert.assertNotNull(newGreeting);
Assert.assertEquals(newGreeting.getId().longValue(), 1L);
Assert.assertEquals(newGreeting.getTone(), Tone.INSULTING);
}
Aggregations