// Path: src/test/java/com/amplitude/api/util/MockHttpURLConnectionHelper.java
// public class MockHttpURLConnectionHelper {
// 
//     public static HttpURLConnection getMockHttpURLConnection(int code, String response)
//             throws IOException {
//         HttpURLConnection connection = mock(HttpURLConnection.class);
//         OutputStream outputStream = mock(OutputStream.class);
//         when(connection.getOutputStream()).thenReturn(outputStream);
//         when(connection.getResponseCode()).thenReturn(code);
//         InputStream inputStream = new ByteArrayInputStream(response.getBytes(StandardCharsets.UTF_8));
//         if (code == 200) {
//             when(connection.getInputStream()).thenReturn(inputStream);
//         } else {
//             when(connection.getErrorStream()).thenReturn(inputStream);
//         }
//         return connection;
//     }
// }
// 
// Path: src/test/java/com/amplitude/api/util/MockURLStreamHandler.java
// public class MockURLStreamHandler extends URLStreamHandler implements URLStreamHandlerFactory {
// 
//     private final Map<URL, URLConnection> connections = new HashMap<>();
// 
//     private static final MockURLStreamHandler instance = new MockURLStreamHandler();
// 
//     public static MockURLStreamHandler getInstance() {
//         return instance;
//     }
// 
//     @Override
//     protected URLConnection openConnection(URL url) throws IOException {
//         return connections.get(url);
//     }
// 
//     public void resetConnections() {
//         connections.clear();
//     }
// 
//     public MockURLStreamHandler setConnection(URL url, URLConnection urlConnection) {
//         connections.put(url, urlConnection);
//         return this;
//     }
// 
//     @Override
//     public URLStreamHandler createURLStreamHandler(String protocol) {
//         return getInstance();
//     }
// }


import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.amplitude.api.util.MockHttpURLConnectionHelper;
import com.amplitude.api.util.MockURLStreamHandler;
import org.json.JSONObject;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.Config;
import java.net.HttpURLConnection;
import java.net.URL;
import static org.junit.Assert.assertEquals;
package com.amplitude.api;







@RunWith(AndroidJUnit4.class)
@Config(manifest=Config.NONE)
public class ConfigManagerTest {
// Path: src/test/java/com/amplitude/api/util/MockHttpURLConnectionHelper.java
// public class MockHttpURLConnectionHelper {
// 
//     public static HttpURLConnection getMockHttpURLConnection(int code, String response)
//             throws IOException {
//         HttpURLConnection connection = mock(HttpURLConnection.class);
//         OutputStream outputStream = mock(OutputStream.class);
//         when(connection.getOutputStream()).thenReturn(outputStream);
//         when(connection.getResponseCode()).thenReturn(code);
//         InputStream inputStream = new ByteArrayInputStream(response.getBytes(StandardCharsets.UTF_8));
//         if (code == 200) {
//             when(connection.getInputStream()).thenReturn(inputStream);
//         } else {
//             when(connection.getErrorStream()).thenReturn(inputStream);
//         }
//         return connection;
//     }
// }
// 
// Path: src/test/java/com/amplitude/api/util/MockURLStreamHandler.java
// public class MockURLStreamHandler extends URLStreamHandler implements URLStreamHandlerFactory {
// 
//     private final Map<URL, URLConnection> connections = new HashMap<>();
// 
//     private static final MockURLStreamHandler instance = new MockURLStreamHandler();
// 
//     public static MockURLStreamHandler getInstance() {
//         return instance;
//     }
// 
//     @Override
//     protected URLConnection openConnection(URL url) throws IOException {
//         return connections.get(url);
//     }
// 
//     public void resetConnections() {
//         connections.clear();
//     }
// 
//     public MockURLStreamHandler setConnection(URL url, URLConnection urlConnection) {
//         connections.put(url, urlConnection);
//         return this;
//     }
// 
//     @Override
//     public URLStreamHandler createURLStreamHandler(String protocol) {
//         return getInstance();
//     }
// }


// Path: src/test/java/com/amplitude/api/ConfigManagerTest.java
import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.amplitude.api.util.MockHttpURLConnectionHelper;
import com.amplitude.api.util.MockURLStreamHandler;
import org.json.JSONObject;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.Config;
import java.net.HttpURLConnection;
import java.net.URL;
import static org.junit.Assert.assertEquals;

package com.amplitude.api;







@RunWith(AndroidJUnit4.class)
@Config(manifest=Config.NONE)
public class ConfigManagerTest {
    private final MockURLStreamHandler mockURLStreamHandler = MockURLStreamHandler.getInstance();