use of com.globalcollect.gateway.sdk.client.android.sdk.asynctask.IinLookupAsyncTask in project connect-sdk-client-android by Ingenico-ePayments.
the class GetIinDetailsAsyncTaskTest method testGetIinDetailsAsyncTaskSUPPORTEDWithValidRequest.
@Test
public void testGetIinDetailsAsyncTaskSUPPORTEDWithValidRequest() throws InterruptedException, CommunicationException {
initializeValidMocksAndSession();
final CountDownLatch waitForAsyncTaskCallBack = new CountDownLatch(1);
// Create the IinLookupAsyncTask and then begin the test by calling execute.
List<IinLookupAsyncTask.OnIinLookupCompleteListener> listeners = new ArrayList<>(1);
Listener listener = new Listener(waitForAsyncTaskCallBack);
listeners.add(listener);
IinLookupAsyncTask iinLookupAsyncTask = new IinLookupAsyncTask(getContext(), // Visa number
"401200", getCommunicator(), listeners, minimalValidPaymentContext);
iinLookupAsyncTask.execute();
// Test that the response is received within 'ASYNCTASK_CALLBACK_TEST_TIMEOUT_SEC' seconds
assertTrue(waitForAsyncTaskCallBack.await(ASYNCTASK_CALLBACK_TEST_TIMEOUT_SEC, TimeUnit.SECONDS));
// Retrieve the iin details response from the listener
IinDetailsResponse iinDetailsResponse = listener.getIinDetailsResponse();
validateResponseStatusSUPPORTED(iinDetailsResponse);
}
Aggregations