use of com.fitpay.android.api.callbacks.ResultProvidingCallback in project fitpay-android-sdk by fitpay.
the class DeviceTest2 method testCantAddDeviceWithMissingType.
@Test
public void testCantAddDeviceWithMissingType() throws Exception {
Device device = getPoorlyDefinedDevice();
final CountDownLatch latch = new CountDownLatch(1);
ResultProvidingCallback<Device> callback = new ResultProvidingCallback<>(latch);
user.createDevice(device, callback);
latch.await(TIMEOUT, TimeUnit.SECONDS);
Device createdDevice = callback.getResult();
assertNull("created device", createdDevice);
assertEquals("error code", 400, callback.getErrorCode());
}
use of com.fitpay.android.api.callbacks.ResultProvidingCallback in project fitpay-android-sdk by fitpay.
the class DeviceTest2 method testCantAddDeviceWithMissingInfo.
@Test
public void testCantAddDeviceWithMissingInfo() throws Exception {
Device device = getPoorlyDeviceTestSmartStrapDevice();
final CountDownLatch latch = new CountDownLatch(1);
ResultProvidingCallback<Device> callback = new ResultProvidingCallback<>(latch);
user.createDevice(device, callback);
latch.await(TIMEOUT, TimeUnit.SECONDS);
Device createdDevice = callback.getResult();
assertNull("created device", createdDevice);
assertEquals("error code", 400, callback.getErrorCode());
}
Aggregations