protected void setUp() throws Exception {
   mContext = getInstrumentation().getContext();
   MIDaaS.setContext(mContext);
   // set the persistence delegate to a simple list. database doesn't seem to work after deletion.
   AttributePersistenceCoordinator.setPersistenceDelegate(new MockPersistence());
   AuthenticationManager.getInstance()
       .setAccessTokenStrategy(new MockAccessTokenSuccessStrategy());
   emailAttribute = EmailAttributeFactory.createAttribute();
   emailAttribute.setValue(validEmail);
   mockFactory = new MockTransportFactory("init_email_ver_success.json");
   mockFactory.setTrasport(new MockTransport(mContext));
   ConnectionManager.setNetworkFactory(mockFactory);
   isInit = true;
 }
  private void initializeEmailVerificationSuccess() throws Exception {
    final CountDownLatch mLatch = new CountDownLatch(1);
    mockFactory.setFilename("init_email_ver_success.json");
    emailAttribute.startVerification(
        new InitializeVerificationCallback() {

          @Override
          public void onSuccess() {
            notificationSuccess = true;
            mLatch.countDown();
          }

          @Override
          public void onError(MIDaaSException exception) {
            notificationSuccess = false;
            mLatch.countDown();
          }
        });
    mLatch.await();
    Assert.assertTrue(notificationSuccess);
  }
  private void completeEmailVerificationSuccess() throws Exception {
    final CountDownLatch mLatch = new CountDownLatch(1);
    MIDaaS.setContext(mContext);
    mockFactory.setFilename("complete_email_ver_success.json");
    notificationSuccess = false;
    emailAttribute.completeVerification(
        "1234",
        new CompleteVerificationCallback() {

          @Override
          public void onSuccess() {
            notificationSuccess = true;
            mLatch.countDown();
          }

          @Override
          public void onError(MIDaaSException exception) {
            notificationSuccess = false;
            mLatch.countDown();
          }
        });
    mLatch.await();
    Assert.assertTrue(notificationSuccess);
  }