// Path: awex-core/src/main/java/com/raycoarana/awex/callbacks/AlwaysCallback.java
// public interface AlwaysCallback {
// 
//     void onAlways();
// 
// }
// 
// Path: awex-core/src/main/java/com/raycoarana/awex/callbacks/CancelCallback.java
// public interface CancelCallback {
// 
//     void onCancel();
// 
// }
// 
// Path: awex-core/src/main/java/com/raycoarana/awex/callbacks/DoneCallback.java
// public interface DoneCallback<T> {
// 
//     void onDone(T result);
// 
// }
// 
// Path: awex-core/src/main/java/com/raycoarana/awex/callbacks/FailCallback.java
// public interface FailCallback {
// 
//     void onFail(Exception exception);
// 
// }
// 
// Path: awex-core/src/main/java/com/raycoarana/awex/callbacks/ProgressCallback.java
// public interface ProgressCallback<Progress> {
// 
//     void onProgress(Progress progress);
// 
// }
// 
// Path: awex-core/src/main/java/com/raycoarana/awex/callbacks/ThenCallback.java
// public interface ThenCallback<Arg, Result, Progress> {
// 
//     Promise<Result, Progress> then(Arg arg);
// 
// }
// 
// Path: awex-core/src/main/java/com/raycoarana/awex/callbacks/UIAlwaysCallback.java
// public interface UIAlwaysCallback extends AlwaysCallback {
// }
// 
// Path: awex-core/src/main/java/com/raycoarana/awex/callbacks/UICancelCallback.java
// public interface UICancelCallback extends CancelCallback {
// }
// 
// Path: awex-core/src/main/java/com/raycoarana/awex/callbacks/UIDoneCallback.java
// public interface UIDoneCallback<T> extends DoneCallback<T> {
// }
// 
// Path: awex-core/src/main/java/com/raycoarana/awex/callbacks/UIFailCallback.java
// public interface UIFailCallback extends FailCallback {
// }
// 
// Path: awex-core/src/main/java/com/raycoarana/awex/callbacks/UIProgressCallback.java
// public interface UIProgressCallback<Progress> extends ProgressCallback<Progress> {
// }


import com.raycoarana.awex.callbacks.AlwaysCallback;
import com.raycoarana.awex.callbacks.CancelCallback;
import com.raycoarana.awex.callbacks.DoneCallback;
import com.raycoarana.awex.callbacks.FailCallback;
import com.raycoarana.awex.callbacks.ProgressCallback;
import com.raycoarana.awex.callbacks.ThenCallback;
import com.raycoarana.awex.callbacks.UIAlwaysCallback;
import com.raycoarana.awex.callbacks.UICancelCallback;
import com.raycoarana.awex.callbacks.UIDoneCallback;
import com.raycoarana.awex.callbacks.UIFailCallback;
import com.raycoarana.awex.callbacks.UIProgressCallback;
import org.junit.Test;
import org.mockito.Mock;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.IsInstanceOf.instanceOf;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
    public void shouldExecuteFailCallbackAddedBeforeRejectThePromise() throws Exception {
        setUpAwex();

        mPromise = new AwexPromise<>(mAwex, mTask);
        mPromise.fail(mFailCallback)
                .always(mAlwaysCallback);
        mPromise.reject(REJECT_EXCEPTION);

        verify(mFailCallback).onFail(REJECT_EXCEPTION);
        verify(mAlwaysCallback).onAlways();
    }

    @Test
    public void shouldExecuteFailCallbackAddedAfterRejectThePromise() throws Exception {
        setUpAwex();

        mPromise = new AwexPromise<>(mAwex, mTask);
        mPromise.reject(REJECT_EXCEPTION);
        mPromise.fail(mFailCallback)
                .always(mAlwaysCallback);

        verify(mFailCallback).onFail(REJECT_EXCEPTION);
        verify(mAlwaysCallback).onAlways();
    }

    @Test
    public void shouldExecuteUIFailCallbackAddedBeforeRejectThePromise() throws Exception {
        setUpAwex();

        mPromise = new AwexPromise<>(mAwex, mTask);
// Path: awex-core/src/main/java/com/raycoarana/awex/callbacks/AlwaysCallback.java
// public interface AlwaysCallback {
// 
//     void onAlways();
// 
// }
// 
// Path: awex-core/src/main/java/com/raycoarana/awex/callbacks/CancelCallback.java
// public interface CancelCallback {
// 
//     void onCancel();
// 
// }
// 
// Path: awex-core/src/main/java/com/raycoarana/awex/callbacks/DoneCallback.java
// public interface DoneCallback<T> {
// 
//     void onDone(T result);
// 
// }
// 
// Path: awex-core/src/main/java/com/raycoarana/awex/callbacks/FailCallback.java
// public interface FailCallback {
// 
//     void onFail(Exception exception);
// 
// }
// 
// Path: awex-core/src/main/java/com/raycoarana/awex/callbacks/ProgressCallback.java
// public interface ProgressCallback<Progress> {
// 
//     void onProgress(Progress progress);
// 
// }
// 
// Path: awex-core/src/main/java/com/raycoarana/awex/callbacks/ThenCallback.java
// public interface ThenCallback<Arg, Result, Progress> {
// 
//     Promise<Result, Progress> then(Arg arg);
// 
// }
// 
// Path: awex-core/src/main/java/com/raycoarana/awex/callbacks/UIAlwaysCallback.java
// public interface UIAlwaysCallback extends AlwaysCallback {
// }
// 
// Path: awex-core/src/main/java/com/raycoarana/awex/callbacks/UICancelCallback.java
// public interface UICancelCallback extends CancelCallback {
// }
// 
// Path: awex-core/src/main/java/com/raycoarana/awex/callbacks/UIDoneCallback.java
// public interface UIDoneCallback<T> extends DoneCallback<T> {
// }
// 
// Path: awex-core/src/main/java/com/raycoarana/awex/callbacks/UIFailCallback.java
// public interface UIFailCallback extends FailCallback {
// }
// 
// Path: awex-core/src/main/java/com/raycoarana/awex/callbacks/UIProgressCallback.java
// public interface UIProgressCallback<Progress> extends ProgressCallback<Progress> {
// }


// Path: awex-core/src/test/java/com/raycoarana/awex/AwexPromiseTest.java
import com.raycoarana.awex.callbacks.AlwaysCallback;
import com.raycoarana.awex.callbacks.CancelCallback;
import com.raycoarana.awex.callbacks.DoneCallback;
import com.raycoarana.awex.callbacks.FailCallback;
import com.raycoarana.awex.callbacks.ProgressCallback;
import com.raycoarana.awex.callbacks.ThenCallback;
import com.raycoarana.awex.callbacks.UIAlwaysCallback;
import com.raycoarana.awex.callbacks.UICancelCallback;
import com.raycoarana.awex.callbacks.UIDoneCallback;
import com.raycoarana.awex.callbacks.UIFailCallback;
import com.raycoarana.awex.callbacks.UIProgressCallback;
import org.junit.Test;
import org.mockito.Mock;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.IsInstanceOf.instanceOf;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;

    public void shouldExecuteFailCallbackAddedBeforeRejectThePromise() throws Exception {
        setUpAwex();

        mPromise = new AwexPromise<>(mAwex, mTask);
        mPromise.fail(mFailCallback)
                .always(mAlwaysCallback);
        mPromise.reject(REJECT_EXCEPTION);

        verify(mFailCallback).onFail(REJECT_EXCEPTION);
        verify(mAlwaysCallback).onAlways();
    }

    @Test
    public void shouldExecuteFailCallbackAddedAfterRejectThePromise() throws Exception {
        setUpAwex();

        mPromise = new AwexPromise<>(mAwex, mTask);
        mPromise.reject(REJECT_EXCEPTION);
        mPromise.fail(mFailCallback)
                .always(mAlwaysCallback);

        verify(mFailCallback).onFail(REJECT_EXCEPTION);
        verify(mAlwaysCallback).onAlways();
    }

    @Test
    public void shouldExecuteUIFailCallbackAddedBeforeRejectThePromise() throws Exception {
        setUpAwex();

        mPromise = new AwexPromise<>(mAwex, mTask);
        mPromise.fail(mUIFailCallback)