use of com.linkedin.restli.examples.greetings.client.AssociationsFluentClient in project rest.li by linkedin.
the class TestParseqBasedFluentClientApi method testAssociateResourceBatchUpdate.
@Test
public void testAssociateResourceBatchUpdate() throws Exception {
Associations associations = new AssociationsFluentClient(_parSeqRestliClient, _parSeqUnitTestHelper.getEngine());
Map<CompoundKey, UpdateStatus> ids = associations.batchUpdate(getAssociateResourceMockDB(associations)).toCompletableFuture().get(5000, TimeUnit.MILLISECONDS);
Assert.assertEquals(ids.size(), 2);
for (CompoundKey id : ids.keySet()) {
Assert.assertEquals(ids.get(id).getStatus().intValue(), 204);
}
}
use of com.linkedin.restli.examples.greetings.client.AssociationsFluentClient in project rest.li by linkedin.
the class TestParseqBasedFluentClientApi method testAssociateResourceBatchPartialUpdate.
@Test
public void testAssociateResourceBatchPartialUpdate() throws Exception {
Associations associations = new AssociationsFluentClient(_parSeqRestliClient, _parSeqUnitTestHelper.getEngine());
Map<CompoundKey, PatchRequest<Message>> patches = new HashMap<>();
patches.put(getAssociateResourceUrlKey(associations), new PatchRequest<>());
patches.put(getAssociateResourceSimpleKey(associations), new PatchRequest<>());
Map<CompoundKey, UpdateStatus> ids = associations.batchPartialUpdate(patches).toCompletableFuture().get(5000, TimeUnit.MILLISECONDS);
for (CompoundKey id : ids.keySet()) {
Assert.assertEquals(ids.get(id).getStatus().intValue(), 204);
}
}
use of com.linkedin.restli.examples.greetings.client.AssociationsFluentClient in project rest.li by linkedin.
the class TestParseqBasedFluentClientApi method testAssociateResourceBatchGet.
@Test
public void testAssociateResourceBatchGet() throws Exception {
Associations associations = new AssociationsFluentClient(_parSeqRestliClient, _parSeqUnitTestHelper.getEngine());
Map<CompoundKey, EntityResponse<Message>> entityResponse = associations.batchGet(getAssociateResourceMockDB(associations).keySet()).toCompletableFuture().get(5000, TimeUnit.MILLISECONDS);
for (CompoundKey id : getAssociateResourceMockDB(associations).keySet()) {
Assert.assertTrue(entityResponse.containsKey(id));
EntityResponse<Message> single = entityResponse.get(id);
Assert.assertEquals(single.getEntity(), getAssociateResourceMockDB(associations).get(id));
}
}
Aggregations