@Test public void getRequestId_shouldParseAndReturnRequestIdFromFailUrl() throws Exception { String requestId = subject.getRequestId("http: assertThat(requestId).isEqualTo("7fd6dd3bf1c84f87876b4740c1dd7baa"); }
@Nullable @VisibleForTesting String getRequestId(@Nullable String failUrl) { if (failUrl == null) { return null; } String requestId = null; Uri uri = Uri.parse(failUrl); try { requestId = uri.getQueryParameter("request_id"); } catch (UnsupportedOperationException e) { MoPubLog.d("Unable to obtain request id from fail url."); } return requestId; }
AdRequest extends Request<AdResponse> { @Nullable @VisibleForTesting String getRequestId(@Nullable String failUrl) { if (failUrl == null) { return null; } String requestId = null; Uri uri = Uri.parse(failUrl); try { requestId = uri.getQueryParameter("request_id"); } catch (UnsupportedOperationException e) { MoPubLog.d("Unable to obtain request id from fail url."); } return requestId; } }
AdRequest extends Request<AdResponse> { @Nullable @VisibleForTesting String getRequestId(@Nullable String failUrl) { if (failUrl == null) { return null; } String requestId = null; Uri uri = Uri.parse(failUrl); try { requestId = uri.getQueryParameter("request_id"); } catch (UnsupportedOperationException e) { MoPubLog.d("Unable to obtain request id from fail url."); } return requestId; } AdRequest(@NonNull final String url,
            @NonNull final AdFormat adFormat,
            @Nullable final String adUnitId,
            @NonNull Context context,
            @NonNull final Listener listener); }
AdRequest extends Request<AdResponse> { @Nullable @VisibleForTesting String getRequestId(@Nullable String failUrl) { if (failUrl == null) { return null; } String requestId = null; Uri uri = Uri.parse(failUrl); try { requestId = uri.getQueryParameter("request_id"); } catch (UnsupportedOperationException e) { MoPubLog.d("Unable to obtain request id from fail url."); } return requestId; } AdRequest(@NonNull final String url,
            @NonNull final AdFormat adFormat,
            @Nullable final String adUnitId,
            @NonNull Context context,
            @NonNull final Listener listener); @NonNull Listener getListener(); @Override Map<String, String> getHeaders(); }
AdRequest extends Request<AdResponse> { @Nullable @VisibleForTesting String getRequestId(@Nullable String failUrl) { if (failUrl == null) { return null; } String requestId = null; Uri uri = Uri.parse(failUrl); try { requestId = uri.getQueryParameter("request_id"); } catch (UnsupportedOperationException e) { MoPubLog.d("Unable to obtain request id from fail url."); } return requestId; } AdRequest(@NonNull final String url,
            @NonNull final AdFormat adFormat,
            @Nullable final String adUnitId,
            @NonNull Context context,
            @NonNull final Listener listener); @NonNull Listener getListener(); @Override Map<String, String> getHeaders();  }