// Path: iterableapi/src/test/java/com/iterable/iterableapi/unit/PathBasedQueueDispatcher.java
// public class PathBasedQueueDispatcher extends Dispatcher {
// 
//     private static class PathBasedResponse {
//         String pathPrefix;
//         MockResponse response;
// 
//         PathBasedResponse(String pathPrefix, MockResponse response) {
//             this.pathPrefix = pathPrefix;
//             this.response = response;
//         }
//     }
// 
//     private final ArrayList<PathBasedResponse> responseQueue = new ArrayList<>();
// 
// 
// 
//     public void enqueueResponse(String pathPrefix, MockResponse mockResponse) {
//         synchronized (responseQueue) {
//             responseQueue.add(new PathBasedResponse(pathPrefix, mockResponse));
//         }
//     }
// 
//     @Override
//     public MockResponse dispatch(RecordedRequest request) throws InterruptedException {
//         String path = request.getPath();
//         PathBasedResponse selectedResponse = null;
//         synchronized (responseQueue) {
//             for (PathBasedResponse response : responseQueue) {
//                 if (path.startsWith(response.pathPrefix)) {
//                     selectedResponse = response;
//                     break;
//                 }
//             }
//             if (selectedResponse != null) {
//                 responseQueue.remove(selectedResponse);
//                 return selectedResponse.response;
//             }
//         }
//         return new MockResponse().setResponseCode(404).setBody("{}");
//     }
// }


import android.app.Activity;
import android.graphics.Rect;
import android.net.Uri;
import androidx.annotation.NonNull;
import androidx.fragment.app.FragmentActivity;
import java.util.List;
import com.iterable.iterableapi.unit.PathBasedQueueDispatcher;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.robolectric.Robolectric;
import org.robolectric.android.controller.ActivityController;
import org.robolectric.android.util.concurrent.PausedExecutorService;
import org.robolectric.shadows.ShadowDialog;
import java.io.IOException;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;
import static android.os.Looper.getMainLooper;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertSame;
import static junit.framework.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.timeout;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.robolectric.Shadows.shadowOf;
package com.iterable.iterableapi;









public class IterableInAppManagerTest extends BaseTest {

    private MockWebServer server;
    private PathBasedQueueDispatcher dispatcher;
    private IterableInAppHandler inAppHandler;
    private IterableCustomActionHandler customActionHandler;
    private IterableUrlHandler urlHandler;
    private PausedExecutorService backgroundExecutor;

    @Before
    public void setUp() throws IOException {
        backgroundExecutor = new PausedExecutorService();
        server = new MockWebServer();
// Path: iterableapi/src/test/java/com/iterable/iterableapi/unit/PathBasedQueueDispatcher.java
// public class PathBasedQueueDispatcher extends Dispatcher {
// 
//     private static class PathBasedResponse {
//         String pathPrefix;
//         MockResponse response;
// 
//         PathBasedResponse(String pathPrefix, MockResponse response) {
//             this.pathPrefix = pathPrefix;
//             this.response = response;
//         }
//     }
// 
//     private final ArrayList<PathBasedResponse> responseQueue = new ArrayList<>();
// 
// 
// 
//     public void enqueueResponse(String pathPrefix, MockResponse mockResponse) {
//         synchronized (responseQueue) {
//             responseQueue.add(new PathBasedResponse(pathPrefix, mockResponse));
//         }
//     }
// 
//     @Override
//     public MockResponse dispatch(RecordedRequest request) throws InterruptedException {
//         String path = request.getPath();
//         PathBasedResponse selectedResponse = null;
//         synchronized (responseQueue) {
//             for (PathBasedResponse response : responseQueue) {
//                 if (path.startsWith(response.pathPrefix)) {
//                     selectedResponse = response;
//                     break;
//                 }
//             }
//             if (selectedResponse != null) {
//                 responseQueue.remove(selectedResponse);
//                 return selectedResponse.response;
//             }
//         }
//         return new MockResponse().setResponseCode(404).setBody("{}");
//     }
// }


// Path: iterableapi/src/test/java/com/iterable/iterableapi/IterableInAppManagerTest.java
import android.app.Activity;
import android.graphics.Rect;
import android.net.Uri;
import androidx.annotation.NonNull;
import androidx.fragment.app.FragmentActivity;
import java.util.List;
import com.iterable.iterableapi.unit.PathBasedQueueDispatcher;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.robolectric.Robolectric;
import org.robolectric.android.controller.ActivityController;
import org.robolectric.android.util.concurrent.PausedExecutorService;
import org.robolectric.shadows.ShadowDialog;
import java.io.IOException;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;
import static android.os.Looper.getMainLooper;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertSame;
import static junit.framework.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.timeout;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.robolectric.Shadows.shadowOf;

package com.iterable.iterableapi;









public class IterableInAppManagerTest extends BaseTest {

    private MockWebServer server;
    private PathBasedQueueDispatcher dispatcher;
    private IterableInAppHandler inAppHandler;
    private IterableCustomActionHandler customActionHandler;
    private IterableUrlHandler urlHandler;
    private PausedExecutorService backgroundExecutor;

    @Before
    public void setUp() throws IOException {
        backgroundExecutor = new PausedExecutorService();
        server = new MockWebServer();
        dispatcher = new PathBasedQueueDispatcher();