diff --git a/bugsnag-plugin-android-okhttp/src/test/java/com/bugsnag/android/ComplexRequestIntegrationTest.kt b/bugsnag-plugin-android-okhttp/src/test/java/com/bugsnag/android/ComplexRequestIntegrationTest.kt index c776eb69d0..7a44eed37e 100644 --- a/bugsnag-plugin-android-okhttp/src/test/java/com/bugsnag/android/ComplexRequestIntegrationTest.kt +++ b/bugsnag-plugin-android-okhttp/src/test/java/com/bugsnag/android/ComplexRequestIntegrationTest.kt @@ -22,7 +22,6 @@ import org.mockito.Mockito import org.mockito.Mockito.times import org.mockito.Mockito.verify import org.mockito.junit.MockitoJUnitRunner -import java.util.concurrent.Executors import java.util.concurrent.TimeUnit @RunWith(MockitoJUnitRunner::class) @@ -96,49 +95,6 @@ class ComplexRequestIntegrationTest { } } - /** - * Performs a GET request but manually cancel it before it can complete - */ - @Test - fun cancelledRequest() { - val server = MockWebServer().apply { start() } - val url = server.url("/test") - val request = Request.Builder().url(url).build() - val plugin = BugsnagOkHttpPlugin().apply { load(client) } - - // make a request but then cancel it on another thread before completion - val okHttpClient = OkHttpClient.Builder().eventListener(plugin).build() - val call = okHttpClient.newCall(request) - - Executors.newSingleThreadScheduledExecutor().schedule( - { - call.cancel() - }, - 100, TimeUnit.MILLISECONDS - ) - - runCatching { - call.execute().close() - } - server.shutdown() - - // verify breadcrumb received - verify(client, times(1)).leaveBreadcrumb( - eq("OkHttp call error"), - mapCaptor.capture(), - eq(BreadcrumbType.REQUEST) - ) - with(mapCaptor.value) { - assertEquals("GET", get("method")) - assertEquals(0L, get("requestContentLength")) - assertTrue(get("duration") is Long) - assertNull(get("urlParams")) - assertEquals(url.toString(), get("url")) - assertNull(get("status")) - assertNull(get("responseContentLength")) - } - } - /** * Performs a GET request that does not close an empty response body. This is captured * as a breadcrumb regardless.