use of net.servicestack.client.AsyncResultVoid in project ServiceStack.Java by ServiceStack.
the class TestServiceTestsAsync method test_Can_send_ReturnVoid_Async.
public void test_Can_send_ReturnVoid_Async() {
final CountDownLatch signal = new CountDownLatch(1);
final List<String> sentMethods = new ArrayList<>();
client.RequestFilter = new ConnectionFilter() {
@Override
public void exec(HttpURLConnection conn) {
sentMethods.add(conn.getRequestMethod());
}
};
client.sendAsync(new HelloReturnVoid().setId(1), new AsyncResultVoid() {
@Override
public void success() {
assertEquals(HttpMethods.Post, sentMethods.get(sentMethods.size() - 1));
signal.countDown();
}
});
}
use of net.servicestack.client.AsyncResultVoid in project ServiceStack.Java by ServiceStack.
the class TestServiceTestsAsync method test_Can_delete_ReturnVoid_Async.
public void test_Can_delete_ReturnVoid_Async() {
final CountDownLatch signal = new CountDownLatch(1);
final List<String> sentMethods = new ArrayList<>();
client.RequestFilter = new ConnectionFilter() {
@Override
public void exec(HttpURLConnection conn) {
sentMethods.add(conn.getRequestMethod());
}
};
client.deleteAsync(new HelloReturnVoid().setId(1), new AsyncResultVoid() {
@Override
public void success() {
assertEquals(HttpMethods.Delete, sentMethods.get(sentMethods.size() - 1));
signal.countDown();
}
});
}
Aggregations