use of com.fitpay.android.api.callbacks.ResultProvidingCallback in project fitpay-android-sdk by fitpay.
the class TestActions method getAllCommits.
protected Collections.CommitsCollection getAllCommits(Device device, String lastCommitId) throws Exception {
final CountDownLatch latch = new CountDownLatch(1);
ResultProvidingCallback<Collections.CommitsCollection> callback = new ResultProvidingCallback<>(latch);
device.getAllCommits(lastCommitId, callback);
latch.await(TIMEOUT * 3, TimeUnit.SECONDS);
assertEquals("get commits error code. (message: " + callback.getErrorMessage() + ")", -1, callback.getErrorCode());
return callback.getResult();
}
use of com.fitpay.android.api.callbacks.ResultProvidingCallback in project fitpay-android-sdk by fitpay.
the class TestActions method getCreditCard.
protected CreditCard getCreditCard(CreditCard creditCard) throws Exception {
final CountDownLatch latch = new CountDownLatch(1);
ResultProvidingCallback<CreditCard> callback = new ResultProvidingCallback<>(latch);
creditCard.self(callback);
latch.await(TIMEOUT, TimeUnit.SECONDS);
assertEquals("get credit card had error code. (message: " + callback.getErrorMessage() + ")", -1, callback.getErrorCode());
return callback.getResult();
}
use of com.fitpay.android.api.callbacks.ResultProvidingCallback in project fitpay-android-sdk by fitpay.
the class TestActions method verifyVerificationMethod.
protected VerificationMethod verifyVerificationMethod(VerificationMethod method, String verificationCode) throws Exception {
final CountDownLatch latch = new CountDownLatch(1);
ResultProvidingCallback<VerificationMethod> callback = new ResultProvidingCallback<>(latch);
method.verify(verificationCode, callback);
latch.await(TIMEOUT, TimeUnit.SECONDS);
return callback.getResult();
}
use of com.fitpay.android.api.callbacks.ResultProvidingCallback in project fitpay-android-sdk by fitpay.
the class TestActions method getDevices.
protected Collections.DeviceCollection getDevices(User user) throws Exception {
final CountDownLatch latch = new CountDownLatch(1);
ResultProvidingCallback<Collections.DeviceCollection> callback = new ResultProvidingCallback<>(latch);
user.getDevices(10, 0, callback);
latch.await(TIMEOUT, TimeUnit.SECONDS);
assertEquals("get devices error code. (message: " + callback.getErrorMessage() + ")", -1, callback.getErrorCode());
return callback.getResult();
}
use of com.fitpay.android.api.callbacks.ResultProvidingCallback in project fitpay-android-sdk by fitpay.
the class TestActions method getUser.
protected User getUser() throws Exception {
final CountDownLatch latch = new CountDownLatch(1);
ResultProvidingCallback<User> callback = new ResultProvidingCallback<>(latch);
ApiManager.getInstance().getUser(callback);
latch.await(TIMEOUT, TimeUnit.SECONDS);
User user = callback.getResult();
Assert.assertNotNull(user);
return user;
}
Aggregations