From 05a40f3fc30935d1250fd7986061c1b0b86c47f0 Mon Sep 17 00:00:00 2001 From: jason plumb <75337021+breedx-splk@users.noreply.github.com> Date: Fri, 7 Apr 2023 04:07:02 -0700 Subject: [PATCH] update and run spotless (#519) --- buildSrc/build.gradle.kts | 2 +- .../sample/ExampleInstrumentedTest.java | 2 ++ .../android/sample/DemoAnimatedView.java | 2 ++ .../splunk/android/sample/FirstFragment.java | 22 +++++++++++++------ .../android/sample/MailDialogFragment.java | 3 +++ .../splunk/android/sample/MainActivity.java | 4 ++++ .../android/sample/SampleApplication.java | 3 +++ .../splunk/android/sample/SecondFragment.java | 4 ++++ .../android/sample/ShopWebViewFragment.java | 2 ++ .../splunk/android/sample/VolleyExample.java | 2 ++ .../android/sample/WebViewFragment.java | 3 +++ .../java/com/splunk/rum/RequestWrapper.java | 1 + .../java/com/splunk/rum/TracingHurlStack.java | 3 +++ .../rum/VolleyHttpClientAttributesGetter.java | 3 +++ .../rum/VolleyNetClientAttributesGetter.java | 2 ++ .../VolleyResponseAttributesExtractor.java | 2 ++ .../java/com/splunk/rum/VolleyTracing.java | 2 ++ .../com/splunk/rum/VolleyTracingBuilder.java | 2 ++ .../java/com/splunk/rum/TestRequestQueue.java | 1 + .../rum/TracingHurlStackExceptionTest.java | 8 +++++-- .../com/splunk/rum/TracingHurlStackTest.java | 16 +++++++++----- .../VolleyHttpClientAttributesGetterTest.java | 8 ++++--- ...VolleyResponseAttributesExtractorTest.java | 6 ++++- .../splunk/rum/CrashComponentExtractor.java | 1 + .../com/splunk/rum/CustomZipkinEncoder.java | 5 +++-- .../splunk/rum/DeviceSpanStorageLimiter.java | 3 +++ .../com/splunk/rum/DiskToZipkinExporter.java | 4 ++++ .../main/java/com/splunk/rum/FileSender.java | 8 +++++-- .../main/java/com/splunk/rum/FileUtils.java | 1 + .../com/splunk/rum/InitializationEvents.java | 1 + .../splunk/rum/MemoryBufferingExporter.java | 3 +++ .../java/com/splunk/rum/NoOpSplunkRum.java | 5 ++++- .../java/com/splunk/rum/RumInitializer.java | 11 ++++++++-- .../rum/RumResponseAttributesExtractor.java | 1 + .../splunk/rum/RuntimeDetailsExtractor.java | 3 +++ .../splunk/rum/ServerTimingHeaderParser.java | 1 + .../com/splunk/rum/SpanFilterBuilder.java | 1 + .../main/java/com/splunk/rum/SplunkRum.java | 8 +++++-- .../java/com/splunk/rum/SplunkRumBuilder.java | 3 +++ .../splunk/rum/SplunkScreenNameExtractor.java | 3 +++ .../splunk/rum/SplunkSpanDataModifier.java | 3 +++ .../com/splunk/rum/ThrottlingExporter.java | 2 ++ .../com/splunk/rum/ZipkinToDiskSender.java | 10 ++++++--- .../rum/ZipkinWriteToDiskExporterFactory.java | 5 ++++- .../rum/internal/ApplicationStateWatcher.java | 3 +++ .../DefaultingActivityLifecycleCallbacks.java | 1 + .../GlobalAttributesSpanAppender.java | 1 + .../internal/InstrumentedApplicationImpl.java | 1 + .../rum/internal/OpenTelemetryRumBuilder.java | 2 ++ .../opentelemetry/rum/internal/SessionId.java | 2 ++ .../internal/SessionIdRatioBasedSampler.java | 1 + .../rum/internal/SessionIdTimeoutHandler.java | 1 + .../rum/internal/SpanDataModifier.java | 1 + .../rum/internal/SpanFilterBuilder.java | 1 + .../InstrumentedApplication.java | 1 + .../instrumentation/ScreenNameExtractor.java | 1 + .../activity/ActivityCallbacks.java | 2 ++ .../activity/ActivityTracer.java | 3 +++ .../activity/ActivityTracerCache.java | 3 +++ .../activity/Pre29ActivityCallbacks.java | 2 ++ .../Pre29VisibleScreenLifecycleBinding.java | 2 ++ .../RumFragmentActivityRegisterer.java | 2 ++ .../VisibleScreenLifecycleBinding.java | 2 ++ .../activity/VisibleScreenTracker.java | 2 ++ .../instrumentation/anr/AnrDetector.java | 2 ++ .../anr/AnrDetectorBuilder.java | 2 ++ .../anr/AnrDetectorToggler.java | 2 ++ .../instrumentation/anr/AnrWatcher.java | 2 ++ .../instrumentation/crash/CrashReporter.java | 1 + .../crash/CrashReporterBuilder.java | 1 + .../crash/CrashReportingExceptionHandler.java | 2 ++ .../fragment/FragmentTracer.java | 1 + .../RumFragmentLifecycleCallbacks.java | 3 +++ .../AndroidLifecycleInstrumentation.java | 3 +++ ...ndroidLifecycleInstrumentationBuilder.java | 1 + .../instrumentation/network/Carrier.java | 2 ++ .../network/CarrierFinder.java | 1 + .../network/CurrentNetwork.java | 2 ++ .../CurrentNetworkAttributesExtractor.java | 1 + .../network/CurrentNetworkProvider.java | 2 ++ .../network/NetworkApplicationListener.java | 1 + .../network/NetworkChangeMonitor.java | 1 + .../network/NetworkChangeMonitorBuilder.java | 1 + .../network/PostApi28NetworkDetector.java | 1 + .../slowrendering/SlowRenderListener.java | 4 ++++ .../slowrendering/SlowRenderingDetector.java | 2 ++ .../SlowRenderingDetectorBuilder.java | 1 + .../startup/AppStartupTimer.java | 3 +++ .../rum/internal/util/ActiveSpan.java | 2 ++ .../com/splunk/rum/BandwidthTrackerTest.java | 5 +++-- .../rum/CrashComponentExtractorTest.java | 2 ++ .../splunk/rum/CustomZipkinEncoderTest.java | 2 ++ .../rum/DeviceSpanStorageLimiterTest.java | 5 +++-- .../splunk/rum/DiskToZipkinExporterTest.java | 6 +++-- .../java/com/splunk/rum/FileSenderTest.java | 17 ++++++++------ .../rum/MemoryBufferingExporterTest.java | 8 ++++--- .../com/splunk/rum/NoOpSplunkRumTest.java | 3 +++ .../com/splunk/rum/RumInitializerTest.java | 17 +++++++++----- .../RumResponseAttributesExtractorTest.java | 4 ++++ .../rum/RuntimeDetailsExtractorTest.java | 6 ++++- .../rum/ScreenAttributesAppenderTest.java | 2 ++ .../com/splunk/rum/SplunkRumBuilderTest.java | 2 ++ .../java/com/splunk/rum/SplunkRumTest.java | 13 +++++++---- .../rum/SplunkSpanDataModifierTest.java | 11 +++++++--- .../splunk/rum/ThrottlingExporterTest.java | 14 +++++++----- .../java/com/splunk/rum/WorkflowTest.java | 4 +++- .../splunk/rum/ZipkinToDiskSenderTest.java | 15 ++++++++----- .../internal/ApplicationStateWatcherTest.java | 2 ++ .../GlobalAttributesSpanAppenderTest.java | 2 ++ .../rum/internal/ModifiedSpanDataTest.java | 5 ++++- .../internal/OpenTelemetryRumBuilderTest.java | 6 ++++- .../internal/SessionIdChangeTracerTest.java | 5 ++++- .../SessionIdRatioBasedSamplerTest.java | 6 +++-- .../internal/SessionIdSpanAppenderTest.java | 2 ++ .../rum/internal/SessionIdTest.java | 6 +++-- .../internal/SessionIdTimeoutHandlerTest.java | 4 +++- .../rum/internal/SpanDataModifierTest.java | 14 +++++++----- .../activity/ActivityCallbacksTest.java | 8 +++++-- .../activity/ActivityTracerCacheTest.java | 6 +++-- .../activity/ActivityTracerTest.java | 6 ++++- .../Pre29ActivityLifecycleCallbacksTest.java | 8 +++++-- ...re29VisibleScreenLifecycleBindingTest.java | 1 + .../RumFragmentActivityRegistererTest.java | 2 ++ .../VisibleScreenLifecycleBindingTest.java | 1 + .../activity/VisibleScreenTrackerTest.java | 2 ++ .../instrumentation/anr/AnrDetectorTest.java | 8 +++++-- .../anr/AnrDetectorTogglerTest.java | 7 +++--- .../instrumentation/anr/AnrWatcherTest.java | 2 ++ .../anr/StackTraceFormatterTest.java | 1 + .../crash/CrashReporterTest.java | 7 ++++-- .../CrashReportingExceptionHandlerTest.java | 4 +++- .../fragment/FragmentCallbackTestHarness.java | 1 + .../fragment/FragmentTracerTest.java | 6 ++++- .../RumFragmentLifecycleCallbacksTest.java | 8 +++++-- .../fragment/ScreenNameExtractorTest.java | 3 +++ .../network/CarrierFinderTest.java | 1 + ...CurrentNetworkAttributesExtractorTest.java | 3 +++ .../network/CurrentNetworkProviderTest.java | 4 +++- .../NetworkAttributesSpanAppenderTest.java | 1 + .../network/NetworkChangeMonitorTest.java | 6 ++++- .../network/NetworkDetectorTest.java | 2 ++ .../network/PostApi28NetworkDetectorTest.java | 2 ++ .../network/SimpleNetworkDetectorTest.java | 2 ++ .../slowrendering/SlowRenderListenerTest.java | 17 +++++++++----- .../startup/AppStartupTimerTest.java | 5 ++++- 145 files changed, 461 insertions(+), 114 deletions(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 3ad5d3e25..1705d3f12 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -22,7 +22,7 @@ dependencies { // keep this version in sync with /build.gradle.kts implementation("com.android.tools.build:gradle:7.4.2") - implementation("com.diffplug.spotless:spotless-plugin-gradle:6.17.0") + implementation("com.diffplug.spotless:spotless-plugin-gradle:6.18.0") implementation("net.ltgt.gradle:gradle-errorprone-plugin:3.0.1") implementation("net.ltgt.gradle:gradle-nullaway-plugin:1.5.0") } diff --git a/sample-app/src/androidTest/java/com/splunk/android/sample/ExampleInstrumentedTest.java b/sample-app/src/androidTest/java/com/splunk/android/sample/ExampleInstrumentedTest.java index 5a488c443..6dc8eec6e 100644 --- a/sample-app/src/androidTest/java/com/splunk/android/sample/ExampleInstrumentedTest.java +++ b/sample-app/src/androidTest/java/com/splunk/android/sample/ExampleInstrumentedTest.java @@ -19,8 +19,10 @@ import static org.junit.Assert.*; import android.content.Context; + import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.platform.app.InstrumentationRegistry; + import org.junit.Test; import org.junit.runner.RunWith; diff --git a/sample-app/src/main/java/com/splunk/android/sample/DemoAnimatedView.java b/sample-app/src/main/java/com/splunk/android/sample/DemoAnimatedView.java index 9e302473a..1a290297f 100644 --- a/sample-app/src/main/java/com/splunk/android/sample/DemoAnimatedView.java +++ b/sample-app/src/main/java/com/splunk/android/sample/DemoAnimatedView.java @@ -25,8 +25,10 @@ import android.graphics.Rect; import android.util.AttributeSet; import android.util.Log; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; + import java.security.SecureRandom; import java.util.Arrays; import java.util.List; diff --git a/sample-app/src/main/java/com/splunk/android/sample/FirstFragment.java b/sample-app/src/main/java/com/splunk/android/sample/FirstFragment.java index 04b883e05..75593efde 100644 --- a/sample-app/src/main/java/com/splunk/android/sample/FirstFragment.java +++ b/sample-app/src/main/java/com/splunk/android/sample/FirstFragment.java @@ -17,40 +17,48 @@ package com.splunk.android.sample; import static io.opentelemetry.api.common.AttributeKey.longKey; + import static org.apache.http.conn.ssl.SSLSocketFactory.SSL; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; + import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import androidx.lifecycle.LiveData; import androidx.lifecycle.MutableLiveData; import androidx.navigation.fragment.NavHostFragment; + import com.splunk.android.sample.databinding.FragmentFirstBinding; import com.splunk.rum.SplunkRum; + import io.opentelemetry.api.trace.Span; import io.opentelemetry.api.trace.StatusCode; import io.opentelemetry.context.Scope; + +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +import org.apache.http.conn.ssl.AllowAllHostnameVerifier; + import java.io.IOException; import java.security.KeyManagementException; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; + import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.TrustManager; import javax.net.ssl.X509TrustManager; -import okhttp3.Call; -import okhttp3.Callback; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.ResponseBody; -import org.apache.http.conn.ssl.AllowAllHostnameVerifier; public class FirstFragment extends Fragment { diff --git a/sample-app/src/main/java/com/splunk/android/sample/MailDialogFragment.java b/sample-app/src/main/java/com/splunk/android/sample/MailDialogFragment.java index e457eb563..569e1a2ed 100644 --- a/sample-app/src/main/java/com/splunk/android/sample/MailDialogFragment.java +++ b/sample-app/src/main/java/com/splunk/android/sample/MailDialogFragment.java @@ -21,9 +21,12 @@ import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; + import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.DialogFragment; + import com.splunk.rum.SplunkRum; + import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.common.Attributes; diff --git a/sample-app/src/main/java/com/splunk/android/sample/MainActivity.java b/sample-app/src/main/java/com/splunk/android/sample/MainActivity.java index 8a965daff..496673544 100644 --- a/sample-app/src/main/java/com/splunk/android/sample/MainActivity.java +++ b/sample-app/src/main/java/com/splunk/android/sample/MainActivity.java @@ -29,6 +29,7 @@ import android.util.Log; import android.view.Menu; import android.view.MenuItem; + import androidx.annotation.NonNull; import androidx.annotation.RequiresPermission; import androidx.appcompat.app.AppCompatActivity; @@ -38,10 +39,13 @@ import androidx.navigation.Navigation; import androidx.navigation.ui.AppBarConfiguration; import androidx.navigation.ui.NavigationUI; + import com.splunk.android.sample.databinding.ActivityMainBinding; import com.splunk.rum.RumScreenName; import com.splunk.rum.SplunkRum; + import io.opentelemetry.api.common.Attributes; + import java.util.Arrays; import java.util.concurrent.TimeUnit; diff --git a/sample-app/src/main/java/com/splunk/android/sample/SampleApplication.java b/sample-app/src/main/java/com/splunk/android/sample/SampleApplication.java index cb21dc851..579c36617 100644 --- a/sample-app/src/main/java/com/splunk/android/sample/SampleApplication.java +++ b/sample-app/src/main/java/com/splunk/android/sample/SampleApplication.java @@ -19,9 +19,12 @@ import static io.opentelemetry.api.common.AttributeKey.stringKey; import android.app.Application; + import com.splunk.rum.SplunkRum; import com.splunk.rum.StandardAttributes; + import io.opentelemetry.api.common.Attributes; + import java.time.Duration; import java.util.regex.Pattern; diff --git a/sample-app/src/main/java/com/splunk/android/sample/SecondFragment.java b/sample-app/src/main/java/com/splunk/android/sample/SecondFragment.java index 70ed69228..cb4b86cd4 100644 --- a/sample-app/src/main/java/com/splunk/android/sample/SecondFragment.java +++ b/sample-app/src/main/java/com/splunk/android/sample/SecondFragment.java @@ -21,19 +21,23 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; + import androidx.annotation.NonNull; import androidx.browser.customtabs.CustomTabsIntent; import androidx.fragment.app.Fragment; import androidx.lifecycle.LiveData; import androidx.lifecycle.MutableLiveData; import androidx.navigation.fragment.NavHostFragment; + import com.splunk.android.sample.databinding.FragmentSecondBinding; import com.splunk.rum.RumScreenName; import com.splunk.rum.SplunkRum; + import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.trace.Span; import io.opentelemetry.api.trace.Tracer; import io.opentelemetry.context.Scope; + import java.util.Random; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; diff --git a/sample-app/src/main/java/com/splunk/android/sample/ShopWebViewFragment.java b/sample-app/src/main/java/com/splunk/android/sample/ShopWebViewFragment.java index a4e58f0ac..decb56e9b 100644 --- a/sample-app/src/main/java/com/splunk/android/sample/ShopWebViewFragment.java +++ b/sample-app/src/main/java/com/splunk/android/sample/ShopWebViewFragment.java @@ -23,10 +23,12 @@ import android.view.ViewGroup; import android.webkit.SslErrorHandler; import android.webkit.WebView; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import androidx.webkit.WebViewClientCompat; + import com.splunk.android.sample.databinding.FragmentWebViewBinding; import com.splunk.rum.SplunkRum; diff --git a/sample-app/src/main/java/com/splunk/android/sample/VolleyExample.java b/sample-app/src/main/java/com/splunk/android/sample/VolleyExample.java index f1f4ae505..0f49084f5 100644 --- a/sample-app/src/main/java/com/splunk/android/sample/VolleyExample.java +++ b/sample-app/src/main/java/com/splunk/android/sample/VolleyExample.java @@ -27,8 +27,10 @@ import com.android.volley.toolbox.HurlStack; import com.android.volley.toolbox.NoCache; import com.android.volley.toolbox.StringRequest; + import com.splunk.rum.SplunkRum; import com.splunk.rum.VolleyTracing; + import java.util.Arrays; import java.util.HashMap; import java.util.List; diff --git a/sample-app/src/main/java/com/splunk/android/sample/WebViewFragment.java b/sample-app/src/main/java/com/splunk/android/sample/WebViewFragment.java index f59730022..4f651ae44 100644 --- a/sample-app/src/main/java/com/splunk/android/sample/WebViewFragment.java +++ b/sample-app/src/main/java/com/splunk/android/sample/WebViewFragment.java @@ -26,13 +26,16 @@ import android.webkit.WebResourceResponse; import android.webkit.WebView; import android.widget.Toast; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import androidx.webkit.WebViewAssetLoader; import androidx.webkit.WebViewClientCompat; + import com.splunk.android.sample.databinding.FragmentWebViewBinding; import com.splunk.rum.SplunkRum; + import io.opentelemetry.api.common.Attributes; /** A simple {@link Fragment} subclass with a WebView in it. */ diff --git a/splunk-otel-android-volley/src/main/java/com/splunk/rum/RequestWrapper.java b/splunk-otel-android-volley/src/main/java/com/splunk/rum/RequestWrapper.java index c4dabb2ea..dc96e14ce 100644 --- a/splunk-otel-android-volley/src/main/java/com/splunk/rum/RequestWrapper.java +++ b/splunk-otel-android-volley/src/main/java/com/splunk/rum/RequestWrapper.java @@ -17,6 +17,7 @@ package com.splunk.rum; import com.android.volley.Request; + import java.util.HashMap; import java.util.Map; diff --git a/splunk-otel-android-volley/src/main/java/com/splunk/rum/TracingHurlStack.java b/splunk-otel-android-volley/src/main/java/com/splunk/rum/TracingHurlStack.java index be7c6e66d..9b15a5173 100644 --- a/splunk-otel-android-volley/src/main/java/com/splunk/rum/TracingHurlStack.java +++ b/splunk-otel-android-volley/src/main/java/com/splunk/rum/TracingHurlStack.java @@ -20,11 +20,14 @@ import com.android.volley.Request; import com.android.volley.toolbox.HttpResponse; import com.android.volley.toolbox.HurlStack; + import io.opentelemetry.context.Context; import io.opentelemetry.context.Scope; import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter; + import java.io.IOException; import java.util.Map; + import javax.net.ssl.SSLSocketFactory; final class TracingHurlStack extends HurlStack { diff --git a/splunk-otel-android-volley/src/main/java/com/splunk/rum/VolleyHttpClientAttributesGetter.java b/splunk-otel-android-volley/src/main/java/com/splunk/rum/VolleyHttpClientAttributesGetter.java index 4d1bce1c3..d4c186407 100644 --- a/splunk-otel-android-volley/src/main/java/com/splunk/rum/VolleyHttpClientAttributesGetter.java +++ b/splunk-otel-android-volley/src/main/java/com/splunk/rum/VolleyHttpClientAttributesGetter.java @@ -19,11 +19,14 @@ import static java.util.Collections.emptyList; import androidx.annotation.Nullable; + import com.android.volley.AuthFailureError; import com.android.volley.Header; import com.android.volley.Request; import com.android.volley.toolbox.HttpResponse; + import io.opentelemetry.instrumentation.api.instrumenter.http.HttpClientAttributesGetter; + import java.util.ArrayList; import java.util.List; import java.util.Map; diff --git a/splunk-otel-android-volley/src/main/java/com/splunk/rum/VolleyNetClientAttributesGetter.java b/splunk-otel-android-volley/src/main/java/com/splunk/rum/VolleyNetClientAttributesGetter.java index f7375d24e..e2352ad65 100644 --- a/splunk-otel-android-volley/src/main/java/com/splunk/rum/VolleyNetClientAttributesGetter.java +++ b/splunk-otel-android-volley/src/main/java/com/splunk/rum/VolleyNetClientAttributesGetter.java @@ -17,7 +17,9 @@ package com.splunk.rum; import androidx.annotation.Nullable; + import com.android.volley.toolbox.HttpResponse; + import io.opentelemetry.instrumentation.api.instrumenter.net.NetClientAttributesGetter; import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; diff --git a/splunk-otel-android-volley/src/main/java/com/splunk/rum/VolleyResponseAttributesExtractor.java b/splunk-otel-android-volley/src/main/java/com/splunk/rum/VolleyResponseAttributesExtractor.java index 5266bc261..560acbb6a 100644 --- a/splunk-otel-android-volley/src/main/java/com/splunk/rum/VolleyResponseAttributesExtractor.java +++ b/splunk-otel-android-volley/src/main/java/com/splunk/rum/VolleyResponseAttributesExtractor.java @@ -21,8 +21,10 @@ import static com.splunk.rum.SplunkRum.LINK_TRACE_ID_KEY; import androidx.annotation.Nullable; + import com.android.volley.Header; import com.android.volley.toolbox.HttpResponse; + import io.opentelemetry.api.common.AttributesBuilder; import io.opentelemetry.context.Context; import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; diff --git a/splunk-otel-android-volley/src/main/java/com/splunk/rum/VolleyTracing.java b/splunk-otel-android-volley/src/main/java/com/splunk/rum/VolleyTracing.java index 054a7c609..f8d88b5ef 100644 --- a/splunk-otel-android-volley/src/main/java/com/splunk/rum/VolleyTracing.java +++ b/splunk-otel-android-volley/src/main/java/com/splunk/rum/VolleyTracing.java @@ -18,8 +18,10 @@ import com.android.volley.toolbox.HttpResponse; import com.android.volley.toolbox.HurlStack; + import io.opentelemetry.api.OpenTelemetry; import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter; + import javax.net.ssl.SSLSocketFactory; /** Entrypoint for tracing Volley clients. */ diff --git a/splunk-otel-android-volley/src/main/java/com/splunk/rum/VolleyTracingBuilder.java b/splunk-otel-android-volley/src/main/java/com/splunk/rum/VolleyTracingBuilder.java index a313310c4..3bd3cb065 100644 --- a/splunk-otel-android-volley/src/main/java/com/splunk/rum/VolleyTracingBuilder.java +++ b/splunk-otel-android-volley/src/main/java/com/splunk/rum/VolleyTracingBuilder.java @@ -17,6 +17,7 @@ package com.splunk.rum; import com.android.volley.toolbox.HttpResponse; + import io.opentelemetry.api.OpenTelemetry; import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter; @@ -26,6 +27,7 @@ import io.opentelemetry.instrumentation.api.instrumenter.http.HttpClientAttributesExtractorBuilder; import io.opentelemetry.instrumentation.api.instrumenter.http.HttpSpanNameExtractor; import io.opentelemetry.instrumentation.api.instrumenter.http.HttpSpanStatusExtractor; + import java.util.ArrayList; import java.util.List; diff --git a/splunk-otel-android-volley/src/test/java/com/splunk/rum/TestRequestQueue.java b/splunk-otel-android-volley/src/test/java/com/splunk/rum/TestRequestQueue.java index d7643b036..f5c9b929b 100644 --- a/splunk-otel-android-volley/src/test/java/com/splunk/rum/TestRequestQueue.java +++ b/splunk-otel-android-volley/src/test/java/com/splunk/rum/TestRequestQueue.java @@ -24,6 +24,7 @@ import com.android.volley.toolbox.BasicNetwork; import com.android.volley.toolbox.HurlStack; import com.android.volley.toolbox.NoCache; + import java.util.concurrent.Executors; class TestRequestQueue { diff --git a/splunk-otel-android-volley/src/test/java/com/splunk/rum/TracingHurlStackExceptionTest.java b/splunk-otel-android-volley/src/test/java/com/splunk/rum/TracingHurlStackExceptionTest.java index 9fe2a147f..81fcef148 100644 --- a/splunk-otel-android-volley/src/test/java/com/splunk/rum/TracingHurlStackExceptionTest.java +++ b/splunk-otel-android-volley/src/test/java/com/splunk/rum/TracingHurlStackExceptionTest.java @@ -17,17 +17,18 @@ package com.splunk.rum; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat; + import static org.assertj.core.api.Assertions.assertThatThrownBy; import com.android.volley.Request; import com.android.volley.toolbox.HurlStack; import com.android.volley.toolbox.RequestFuture; import com.android.volley.toolbox.StringRequest; + import io.opentelemetry.sdk.testing.junit4.OpenTelemetryRule; import io.opentelemetry.sdk.trace.data.SpanData; import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; -import java.util.List; -import java.util.concurrent.TimeUnit; + import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -35,6 +36,9 @@ import org.junit.runner.RunWith; import org.robolectric.RobolectricTestRunner; +import java.util.List; +import java.util.concurrent.TimeUnit; + @RunWith(RobolectricTestRunner.class) public class TracingHurlStackExceptionTest { diff --git a/splunk-otel-android-volley/src/test/java/com/splunk/rum/TracingHurlStackTest.java b/splunk-otel-android-volley/src/test/java/com/splunk/rum/TracingHurlStackTest.java index 3ff70063d..6b7345836 100644 --- a/splunk-otel-android-volley/src/test/java/com/splunk/rum/TracingHurlStackTest.java +++ b/splunk-otel-android-volley/src/test/java/com/splunk/rum/TracingHurlStackTest.java @@ -27,14 +27,24 @@ import com.android.volley.toolbox.HurlStack; import com.android.volley.toolbox.RequestFuture; import com.android.volley.toolbox.StringRequest; + import com.google.mockwebserver.MockResponse; import com.google.mockwebserver.MockWebServer; + import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.trace.SpanKind; import io.opentelemetry.sdk.testing.junit4.OpenTelemetryRule; import io.opentelemetry.sdk.trace.data.SpanData; import io.opentelemetry.sdk.trace.data.StatusData; import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; + +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.robolectric.RobolectricTestRunner; + import java.io.IOException; import java.net.ServerSocket; import java.net.URL; @@ -45,12 +55,6 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; -import org.junit.After; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.robolectric.RobolectricTestRunner; @RunWith(RobolectricTestRunner.class) public class TracingHurlStackTest { diff --git a/splunk-otel-android-volley/src/test/java/com/splunk/rum/VolleyHttpClientAttributesGetterTest.java b/splunk-otel-android-volley/src/test/java/com/splunk/rum/VolleyHttpClientAttributesGetterTest.java index 47be55590..1027ca041 100644 --- a/splunk-otel-android-volley/src/test/java/com/splunk/rum/VolleyHttpClientAttributesGetterTest.java +++ b/splunk-otel-android-volley/src/test/java/com/splunk/rum/VolleyHttpClientAttributesGetterTest.java @@ -24,13 +24,15 @@ import com.android.volley.Header; import com.android.volley.Request; import com.android.volley.toolbox.HttpResponse; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.robolectric.RobolectricTestRunner; + import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.robolectric.RobolectricTestRunner; @RunWith(RobolectricTestRunner.class) public class VolleyHttpClientAttributesGetterTest { diff --git a/splunk-otel-android-volley/src/test/java/com/splunk/rum/VolleyResponseAttributesExtractorTest.java b/splunk-otel-android-volley/src/test/java/com/splunk/rum/VolleyResponseAttributesExtractorTest.java index 71a41a6d3..203a0ab91 100644 --- a/splunk-otel-android-volley/src/test/java/com/splunk/rum/VolleyResponseAttributesExtractorTest.java +++ b/splunk-otel-android-volley/src/test/java/com/splunk/rum/VolleyResponseAttributesExtractorTest.java @@ -17,6 +17,7 @@ package com.splunk.rum; import static com.splunk.rum.SplunkRum.COMPONENT_KEY; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.mockito.Mockito.mock; @@ -25,11 +26,14 @@ import com.android.volley.Header; import com.android.volley.Request; import com.android.volley.toolbox.HttpResponse; + import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.common.AttributesBuilder; + +import org.junit.Test; + import java.util.Collections; import java.util.List; -import org.junit.Test; public class VolleyResponseAttributesExtractorTest { diff --git a/splunk-otel-android/src/main/java/com/splunk/rum/CrashComponentExtractor.java b/splunk-otel-android/src/main/java/com/splunk/rum/CrashComponentExtractor.java index baf5d9cca..d2ec0aab1 100644 --- a/splunk-otel-android/src/main/java/com/splunk/rum/CrashComponentExtractor.java +++ b/splunk-otel-android/src/main/java/com/splunk/rum/CrashComponentExtractor.java @@ -22,6 +22,7 @@ import io.opentelemetry.context.Context; import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; import io.opentelemetry.rum.internal.instrumentation.crash.CrashDetails; + import java.util.concurrent.atomic.AtomicBoolean; final class CrashComponentExtractor implements AttributesExtractor { diff --git a/splunk-otel-android/src/main/java/com/splunk/rum/CustomZipkinEncoder.java b/splunk-otel-android/src/main/java/com/splunk/rum/CustomZipkinEncoder.java index 40adb248e..3bbc1ee2c 100644 --- a/splunk-otel-android/src/main/java/com/splunk/rum/CustomZipkinEncoder.java +++ b/splunk-otel-android/src/main/java/com/splunk/rum/CustomZipkinEncoder.java @@ -16,8 +16,6 @@ package com.splunk.rum; -import java.nio.charset.StandardCharsets; -import java.util.List; import zipkin2.Span; import zipkin2.codec.BytesEncoder; import zipkin2.codec.Encoding; @@ -25,6 +23,9 @@ import zipkin2.internal.V2SpanWriter; import zipkin2.internal.WriteBuffer; +import java.nio.charset.StandardCharsets; +import java.util.List; + /** * We need a custom encoder to correct for the fact that the zipkin Span.Builder lowercases all Span * names. diff --git a/splunk-otel-android/src/main/java/com/splunk/rum/DeviceSpanStorageLimiter.java b/splunk-otel-android/src/main/java/com/splunk/rum/DeviceSpanStorageLimiter.java index 1ff1f6cb4..c6e25e8d4 100644 --- a/splunk-otel-android/src/main/java/com/splunk/rum/DeviceSpanStorageLimiter.java +++ b/splunk-otel-android/src/main/java/com/splunk/rum/DeviceSpanStorageLimiter.java @@ -17,11 +17,14 @@ package com.splunk.rum; import static com.splunk.rum.SplunkRum.LOG_TAG; + import static java.util.Comparator.comparingLong; import static java.util.Objects.requireNonNull; import android.util.Log; + import androidx.annotation.Nullable; + import java.io.File; import java.util.List; import java.util.stream.Collectors; diff --git a/splunk-otel-android/src/main/java/com/splunk/rum/DiskToZipkinExporter.java b/splunk-otel-android/src/main/java/com/splunk/rum/DiskToZipkinExporter.java index 9d5eb0cf4..0cb018b4d 100644 --- a/splunk-otel-android/src/main/java/com/splunk/rum/DiskToZipkinExporter.java +++ b/splunk-otel-android/src/main/java/com/splunk/rum/DiskToZipkinExporter.java @@ -17,12 +17,16 @@ package com.splunk.rum; import static com.splunk.rum.SplunkRum.LOG_TAG; + import static java.util.Collections.emptyList; import static java.util.Objects.requireNonNull; import android.util.Log; + import androidx.annotation.Nullable; + import io.opentelemetry.rum.internal.instrumentation.network.CurrentNetworkProvider; + import java.io.File; import java.util.Comparator; import java.util.List; diff --git a/splunk-otel-android/src/main/java/com/splunk/rum/FileSender.java b/splunk-otel-android/src/main/java/com/splunk/rum/FileSender.java index 1f2200df6..2f5e84d50 100644 --- a/splunk-otel-android/src/main/java/com/splunk/rum/FileSender.java +++ b/splunk-otel-android/src/main/java/com/splunk/rum/FileSender.java @@ -17,11 +17,17 @@ package com.splunk.rum; import static com.splunk.rum.SplunkRum.LOG_TAG; + import static java.util.Collections.emptyList; import static java.util.Objects.requireNonNull; import android.util.Log; + import androidx.annotation.Nullable; + +import zipkin2.Call; +import zipkin2.reporter.Sender; + import java.io.File; import java.io.IOException; import java.util.HashMap; @@ -29,8 +35,6 @@ import java.util.Map; import java.util.concurrent.TimeUnit; import java.util.function.Consumer; -import zipkin2.Call; -import zipkin2.reporter.Sender; class FileSender { diff --git a/splunk-otel-android/src/main/java/com/splunk/rum/FileUtils.java b/splunk-otel-android/src/main/java/com/splunk/rum/FileUtils.java index 67efcee94..05907b605 100644 --- a/splunk-otel-android/src/main/java/com/splunk/rum/FileUtils.java +++ b/splunk-otel-android/src/main/java/com/splunk/rum/FileUtils.java @@ -24,6 +24,7 @@ import android.system.StructStat; import android.util.AtomicFile; import android.util.Log; + import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; diff --git a/splunk-otel-android/src/main/java/com/splunk/rum/InitializationEvents.java b/splunk-otel-android/src/main/java/com/splunk/rum/InitializationEvents.java index e3618c629..89d853cc8 100644 --- a/splunk-otel-android/src/main/java/com/splunk/rum/InitializationEvents.java +++ b/splunk-otel-android/src/main/java/com/splunk/rum/InitializationEvents.java @@ -23,6 +23,7 @@ import io.opentelemetry.api.trace.Tracer; import io.opentelemetry.context.Context; import io.opentelemetry.rum.internal.instrumentation.startup.AppStartupTimer; + import java.util.ArrayList; import java.util.List; import java.util.concurrent.TimeUnit; diff --git a/splunk-otel-android/src/main/java/com/splunk/rum/MemoryBufferingExporter.java b/splunk-otel-android/src/main/java/com/splunk/rum/MemoryBufferingExporter.java index 61d79f06c..299730072 100644 --- a/splunk-otel-android/src/main/java/com/splunk/rum/MemoryBufferingExporter.java +++ b/splunk-otel-android/src/main/java/com/splunk/rum/MemoryBufferingExporter.java @@ -17,11 +17,14 @@ package com.splunk.rum; import android.util.Log; + import androidx.annotation.NonNull; + import io.opentelemetry.rum.internal.instrumentation.network.CurrentNetworkProvider; import io.opentelemetry.sdk.common.CompletableResultCode; import io.opentelemetry.sdk.trace.data.SpanData; import io.opentelemetry.sdk.trace.export.SpanExporter; + import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Collection; diff --git a/splunk-otel-android/src/main/java/com/splunk/rum/NoOpSplunkRum.java b/splunk-otel-android/src/main/java/com/splunk/rum/NoOpSplunkRum.java index 74a971304..077da5cd0 100644 --- a/splunk-otel-android/src/main/java/com/splunk/rum/NoOpSplunkRum.java +++ b/splunk-otel-android/src/main/java/com/splunk/rum/NoOpSplunkRum.java @@ -17,15 +17,18 @@ package com.splunk.rum; import android.webkit.WebView; + import io.opentelemetry.api.OpenTelemetry; import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.common.AttributesBuilder; import io.opentelemetry.api.trace.Tracer; import io.opentelemetry.rum.internal.OpenTelemetryRum; -import java.util.function.Consumer; + import okhttp3.Call; import okhttp3.OkHttpClient; +import java.util.function.Consumer; + class NoOpSplunkRum extends SplunkRum { static final NoOpSplunkRum INSTANCE = new NoOpSplunkRum(); diff --git a/splunk-otel-android/src/main/java/com/splunk/rum/RumInitializer.java b/splunk-otel-android/src/main/java/com/splunk/rum/RumInitializer.java index 96fadbb72..37836585f 100644 --- a/splunk-otel-android/src/main/java/com/splunk/rum/RumInitializer.java +++ b/splunk-otel-android/src/main/java/com/splunk/rum/RumInitializer.java @@ -23,6 +23,7 @@ import static com.splunk.rum.SplunkRum.COMPONENT_UI; import static com.splunk.rum.SplunkRum.RUM_TRACER_NAME; import static com.splunk.rum.SplunkRum.RUM_VERSION_KEY; + import static io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor.constant; import static io.opentelemetry.rum.internal.RumConstants.APP_START_SPAN_NAME; import static io.opentelemetry.semconv.resource.attributes.ResourceAttributes.DEPLOYMENT_ENVIRONMENT; @@ -32,14 +33,18 @@ import static io.opentelemetry.semconv.resource.attributes.ResourceAttributes.OS_TYPE; import static io.opentelemetry.semconv.resource.attributes.ResourceAttributes.OS_VERSION; import static io.opentelemetry.semconv.resource.attributes.ResourceAttributes.SERVICE_NAME; + import static java.util.Objects.requireNonNull; import android.app.Application; import android.os.Build; import android.os.Looper; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; + import com.splunk.android.rum.R; + import io.opentelemetry.api.trace.Tracer; import io.opentelemetry.exporter.logging.LoggingSpanExporter; import io.opentelemetry.exporter.zipkin.ZipkinSpanExporter; @@ -65,14 +70,16 @@ import io.opentelemetry.sdk.trace.export.BatchSpanProcessor; import io.opentelemetry.sdk.trace.export.SimpleSpanProcessor; import io.opentelemetry.sdk.trace.export.SpanExporter; + +import zipkin2.reporter.Sender; +import zipkin2.reporter.okhttp3.OkHttpSender; + import java.io.File; import java.time.Duration; import java.util.Collection; import java.util.function.Function; import java.util.function.Supplier; import java.util.logging.Level; -import zipkin2.reporter.Sender; -import zipkin2.reporter.okhttp3.OkHttpSender; class RumInitializer { diff --git a/splunk-otel-android/src/main/java/com/splunk/rum/RumResponseAttributesExtractor.java b/splunk-otel-android/src/main/java/com/splunk/rum/RumResponseAttributesExtractor.java index 7f8cdef4a..5b54c7a5a 100644 --- a/splunk-otel-android/src/main/java/com/splunk/rum/RumResponseAttributesExtractor.java +++ b/splunk-otel-android/src/main/java/com/splunk/rum/RumResponseAttributesExtractor.java @@ -23,6 +23,7 @@ import io.opentelemetry.api.common.AttributesBuilder; import io.opentelemetry.context.Context; import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; + import okhttp3.Request; import okhttp3.Response; diff --git a/splunk-otel-android/src/main/java/com/splunk/rum/RuntimeDetailsExtractor.java b/splunk-otel-android/src/main/java/com/splunk/rum/RuntimeDetailsExtractor.java index 44cdca87a..135d365df 100644 --- a/splunk-otel-android/src/main/java/com/splunk/rum/RuntimeDetailsExtractor.java +++ b/splunk-otel-android/src/main/java/com/splunk/rum/RuntimeDetailsExtractor.java @@ -21,9 +21,12 @@ import android.content.Intent; import android.content.IntentFilter; import android.os.BatteryManager; + import androidx.annotation.Nullable; + import io.opentelemetry.api.common.AttributesBuilder; import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; + import java.io.File; /** Represents details about the runtime environment at a time */ diff --git a/splunk-otel-android/src/main/java/com/splunk/rum/ServerTimingHeaderParser.java b/splunk-otel-android/src/main/java/com/splunk/rum/ServerTimingHeaderParser.java index 603beef15..59fb1659c 100644 --- a/splunk-otel-android/src/main/java/com/splunk/rum/ServerTimingHeaderParser.java +++ b/splunk-otel-android/src/main/java/com/splunk/rum/ServerTimingHeaderParser.java @@ -17,6 +17,7 @@ package com.splunk.rum; import androidx.annotation.Nullable; + import java.util.regex.Matcher; import java.util.regex.Pattern; diff --git a/splunk-otel-android/src/main/java/com/splunk/rum/SpanFilterBuilder.java b/splunk-otel-android/src/main/java/com/splunk/rum/SpanFilterBuilder.java index a233f46bc..ef6bc4b1d 100644 --- a/splunk-otel-android/src/main/java/com/splunk/rum/SpanFilterBuilder.java +++ b/splunk-otel-android/src/main/java/com/splunk/rum/SpanFilterBuilder.java @@ -18,6 +18,7 @@ import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.sdk.trace.export.SpanExporter; + import java.util.function.Function; import java.util.function.Predicate; diff --git a/splunk-otel-android/src/main/java/com/splunk/rum/SplunkRum.java b/splunk-otel-android/src/main/java/com/splunk/rum/SplunkRum.java index 4664364d6..db3c628f9 100644 --- a/splunk-otel-android/src/main/java/com/splunk/rum/SplunkRum.java +++ b/splunk-otel-android/src/main/java/com/splunk/rum/SplunkRum.java @@ -26,7 +26,9 @@ import android.os.Looper; import android.util.Log; import android.webkit.WebView; + import androidx.annotation.Nullable; + import io.opentelemetry.api.OpenTelemetry; import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.common.Attributes; @@ -39,11 +41,13 @@ import io.opentelemetry.rum.internal.instrumentation.network.CurrentNetworkProvider; import io.opentelemetry.rum.internal.instrumentation.startup.AppStartupTimer; import io.opentelemetry.sdk.OpenTelemetrySdk; + +import okhttp3.Call; +import okhttp3.OkHttpClient; + import java.util.concurrent.TimeUnit; import java.util.function.Consumer; import java.util.function.Function; -import okhttp3.Call; -import okhttp3.OkHttpClient; /** Entrypoint for the Splunk OpenTelemetry Instrumentation for Android. */ public class SplunkRum { diff --git a/splunk-otel-android/src/main/java/com/splunk/rum/SplunkRumBuilder.java b/splunk-otel-android/src/main/java/com/splunk/rum/SplunkRumBuilder.java index 223a9e271..d2b1eae47 100644 --- a/splunk-otel-android/src/main/java/com/splunk/rum/SplunkRumBuilder.java +++ b/splunk-otel-android/src/main/java/com/splunk/rum/SplunkRumBuilder.java @@ -20,10 +20,13 @@ import android.app.Application; import android.util.Log; + import androidx.annotation.Nullable; + import io.opentelemetry.api.common.Attributes; import io.opentelemetry.rum.internal.instrumentation.network.CurrentNetworkProvider; import io.opentelemetry.sdk.trace.export.SpanExporter; + import java.time.Duration; import java.util.function.Consumer; diff --git a/splunk-otel-android/src/main/java/com/splunk/rum/SplunkScreenNameExtractor.java b/splunk-otel-android/src/main/java/com/splunk/rum/SplunkScreenNameExtractor.java index c9398c687..d9503c9ad 100644 --- a/splunk-otel-android/src/main/java/com/splunk/rum/SplunkScreenNameExtractor.java +++ b/splunk-otel-android/src/main/java/com/splunk/rum/SplunkScreenNameExtractor.java @@ -17,9 +17,12 @@ package com.splunk.rum; import android.app.Activity; + import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; + import io.opentelemetry.rum.internal.instrumentation.ScreenNameExtractor; + import java.util.function.Function; /** diff --git a/splunk-otel-android/src/main/java/com/splunk/rum/SplunkSpanDataModifier.java b/splunk-otel-android/src/main/java/com/splunk/rum/SplunkSpanDataModifier.java index fa0312821..d6fb6411e 100644 --- a/splunk-otel-android/src/main/java/com/splunk/rum/SplunkSpanDataModifier.java +++ b/splunk-otel-android/src/main/java/com/splunk/rum/SplunkSpanDataModifier.java @@ -18,10 +18,12 @@ import static com.splunk.rum.SplunkRum.ERROR_MESSAGE_KEY; import static com.splunk.rum.SplunkRum.ERROR_TYPE_KEY; + import static io.opentelemetry.api.common.AttributeKey.stringKey; import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.EXCEPTION_MESSAGE; import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.EXCEPTION_STACKTRACE; import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.EXCEPTION_TYPE; + import static java.util.Arrays.asList; import static java.util.Collections.unmodifiableSet; @@ -37,6 +39,7 @@ import io.opentelemetry.sdk.trace.export.SpanExporter; import io.opentelemetry.semconv.resource.attributes.ResourceAttributes; import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; + import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; diff --git a/splunk-otel-android/src/main/java/com/splunk/rum/ThrottlingExporter.java b/splunk-otel-android/src/main/java/com/splunk/rum/ThrottlingExporter.java index 3dfe836cb..00622f27f 100644 --- a/splunk-otel-android/src/main/java/com/splunk/rum/ThrottlingExporter.java +++ b/splunk-otel-android/src/main/java/com/splunk/rum/ThrottlingExporter.java @@ -17,10 +17,12 @@ package com.splunk.rum; import android.util.Log; + import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.sdk.common.CompletableResultCode; import io.opentelemetry.sdk.trace.data.SpanData; import io.opentelemetry.sdk.trace.export.SpanExporter; + import java.time.Duration; import java.util.ArrayDeque; import java.util.ArrayList; diff --git a/splunk-otel-android/src/main/java/com/splunk/rum/ZipkinToDiskSender.java b/splunk-otel-android/src/main/java/com/splunk/rum/ZipkinToDiskSender.java index ba7762752..69540d156 100644 --- a/splunk-otel-android/src/main/java/com/splunk/rum/ZipkinToDiskSender.java +++ b/splunk-otel-android/src/main/java/com/splunk/rum/ZipkinToDiskSender.java @@ -19,15 +19,19 @@ import static java.util.Objects.requireNonNull; import android.util.Log; + import androidx.annotation.Nullable; + import io.opentelemetry.sdk.common.Clock; -import java.io.File; -import java.io.IOException; -import java.util.List; + import zipkin2.Call; import zipkin2.codec.Encoding; import zipkin2.reporter.Sender; +import java.io.File; +import java.io.IOException; +import java.util.List; + class ZipkinToDiskSender extends Sender { private final File path; diff --git a/splunk-otel-android/src/main/java/com/splunk/rum/ZipkinWriteToDiskExporterFactory.java b/splunk-otel-android/src/main/java/com/splunk/rum/ZipkinWriteToDiskExporterFactory.java index 1a9c1f938..d6a90c64d 100644 --- a/splunk-otel-android/src/main/java/com/splunk/rum/ZipkinWriteToDiskExporterFactory.java +++ b/splunk-otel-android/src/main/java/com/splunk/rum/ZipkinWriteToDiskExporterFactory.java @@ -18,10 +18,13 @@ import android.app.Application; import android.util.Log; + import io.opentelemetry.exporter.zipkin.ZipkinSpanExporter; -import java.io.File; + import zipkin2.reporter.Sender; +import java.io.File; + /** * Creates a ZipkinSpanExporter that is configured with an instance of a ZipkinToDiskSender that * writes telemetry to disk. diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/ApplicationStateWatcher.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/ApplicationStateWatcher.java index 4df387b61..c233dee01 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/ApplicationStateWatcher.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/ApplicationStateWatcher.java @@ -17,8 +17,11 @@ package io.opentelemetry.rum.internal; import android.app.Activity; + import androidx.annotation.NonNull; + import io.opentelemetry.rum.internal.instrumentation.ApplicationStateListener; + import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/DefaultingActivityLifecycleCallbacks.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/DefaultingActivityLifecycleCallbacks.java index 1dad341dd..b46d09e2b 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/DefaultingActivityLifecycleCallbacks.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/DefaultingActivityLifecycleCallbacks.java @@ -19,6 +19,7 @@ import android.app.Activity; import android.app.Application; import android.os.Bundle; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/GlobalAttributesSpanAppender.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/GlobalAttributesSpanAppender.java index 75f8885e6..048dd10b2 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/GlobalAttributesSpanAppender.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/GlobalAttributesSpanAppender.java @@ -24,6 +24,7 @@ import io.opentelemetry.sdk.trace.ReadWriteSpan; import io.opentelemetry.sdk.trace.ReadableSpan; import io.opentelemetry.sdk.trace.SpanProcessor; + import java.util.concurrent.atomic.AtomicReference; import java.util.function.Consumer; diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/InstrumentedApplicationImpl.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/InstrumentedApplicationImpl.java index a8274d4e7..7fc9dec90 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/InstrumentedApplicationImpl.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/InstrumentedApplicationImpl.java @@ -17,6 +17,7 @@ package io.opentelemetry.rum.internal; import android.app.Application; + import io.opentelemetry.rum.internal.instrumentation.ApplicationStateListener; import io.opentelemetry.rum.internal.instrumentation.InstrumentedApplication; import io.opentelemetry.sdk.OpenTelemetrySdk; diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/OpenTelemetryRumBuilder.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/OpenTelemetryRumBuilder.java index 0b36a4634..0430d7533 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/OpenTelemetryRumBuilder.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/OpenTelemetryRumBuilder.java @@ -17,6 +17,7 @@ package io.opentelemetry.rum.internal; import android.app.Application; + import io.opentelemetry.api.trace.Tracer; import io.opentelemetry.rum.internal.instrumentation.InstrumentedApplication; import io.opentelemetry.sdk.OpenTelemetrySdk; @@ -27,6 +28,7 @@ import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.trace.SdkTracerProvider; import io.opentelemetry.sdk.trace.SdkTracerProviderBuilder; + import java.util.ArrayList; import java.util.List; import java.util.function.BiFunction; diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/SessionId.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/SessionId.java index e61c15d4d..fe12ec4dd 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/SessionId.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/SessionId.java @@ -19,8 +19,10 @@ import static java.util.Objects.requireNonNull; import androidx.annotation.Nullable; + import io.opentelemetry.api.trace.TraceId; import io.opentelemetry.sdk.common.Clock; + import java.util.Random; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/SessionIdRatioBasedSampler.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/SessionIdRatioBasedSampler.java index bba3b85b4..05d257ca3 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/SessionIdRatioBasedSampler.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/SessionIdRatioBasedSampler.java @@ -22,6 +22,7 @@ import io.opentelemetry.sdk.trace.data.LinkData; import io.opentelemetry.sdk.trace.samplers.Sampler; import io.opentelemetry.sdk.trace.samplers.SamplingResult; + import java.util.List; /** diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/SessionIdTimeoutHandler.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/SessionIdTimeoutHandler.java index 791aa43fc..aa2c51177 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/SessionIdTimeoutHandler.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/SessionIdTimeoutHandler.java @@ -18,6 +18,7 @@ import io.opentelemetry.rum.internal.instrumentation.ApplicationStateListener; import io.opentelemetry.sdk.common.Clock; + import java.util.concurrent.TimeUnit; /** diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/SpanDataModifier.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/SpanDataModifier.java index dda96f557..25e61d52d 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/SpanDataModifier.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/SpanDataModifier.java @@ -22,6 +22,7 @@ import io.opentelemetry.sdk.common.CompletableResultCode; import io.opentelemetry.sdk.trace.data.SpanData; import io.opentelemetry.sdk.trace.export.SpanExporter; + import java.util.ArrayList; import java.util.Collection; import java.util.List; diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/SpanFilterBuilder.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/SpanFilterBuilder.java index 3f4638d97..49a807bb1 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/SpanFilterBuilder.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/SpanFilterBuilder.java @@ -18,6 +18,7 @@ import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.sdk.trace.export.SpanExporter; + import java.util.HashMap; import java.util.Map; import java.util.function.Function; diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/InstrumentedApplication.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/InstrumentedApplication.java index f853bd050..55014a747 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/InstrumentedApplication.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/InstrumentedApplication.java @@ -17,6 +17,7 @@ package io.opentelemetry.rum.internal.instrumentation; import android.app.Application; + import io.opentelemetry.rum.internal.OpenTelemetryRum; import io.opentelemetry.sdk.OpenTelemetrySdk; diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/ScreenNameExtractor.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/ScreenNameExtractor.java index edceeb900..7ffc2be25 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/ScreenNameExtractor.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/ScreenNameExtractor.java @@ -17,6 +17,7 @@ package io.opentelemetry.rum.internal.instrumentation; import android.app.Activity; + import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/ActivityCallbacks.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/ActivityCallbacks.java index 55b1ed25b..7f4c5425a 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/ActivityCallbacks.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/ActivityCallbacks.java @@ -18,8 +18,10 @@ import android.app.Activity; import android.os.Bundle; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; + import io.opentelemetry.rum.internal.DefaultingActivityLifecycleCallbacks; public class ActivityCallbacks implements DefaultingActivityLifecycleCallbacks { diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/ActivityTracer.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/ActivityTracer.java index 6dd307ba4..854f32b40 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/ActivityTracer.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/ActivityTracer.java @@ -21,8 +21,10 @@ import static io.opentelemetry.rum.internal.RumConstants.START_TYPE_KEY; import android.app.Activity; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; + import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.trace.Span; import io.opentelemetry.api.trace.SpanBuilder; @@ -30,6 +32,7 @@ import io.opentelemetry.context.Context; import io.opentelemetry.rum.internal.instrumentation.startup.AppStartupTimer; import io.opentelemetry.rum.internal.util.ActiveSpan; + import java.util.concurrent.atomic.AtomicReference; public class ActivityTracer { diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/ActivityTracerCache.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/ActivityTracerCache.java index 372e42410..57404d804 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/ActivityTracerCache.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/ActivityTracerCache.java @@ -17,10 +17,13 @@ package io.opentelemetry.rum.internal.instrumentation.activity; import android.app.Activity; + import androidx.annotation.VisibleForTesting; + import io.opentelemetry.api.trace.Tracer; import io.opentelemetry.rum.internal.instrumentation.ScreenNameExtractor; import io.opentelemetry.rum.internal.instrumentation.startup.AppStartupTimer; + import java.util.HashMap; import java.util.Map; import java.util.concurrent.atomic.AtomicReference; diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/Pre29ActivityCallbacks.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/Pre29ActivityCallbacks.java index 60f033bc1..61a713902 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/Pre29ActivityCallbacks.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/Pre29ActivityCallbacks.java @@ -18,8 +18,10 @@ import android.app.Activity; import android.os.Bundle; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; + import io.opentelemetry.rum.internal.DefaultingActivityLifecycleCallbacks; public class Pre29ActivityCallbacks implements DefaultingActivityLifecycleCallbacks { diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/Pre29VisibleScreenLifecycleBinding.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/Pre29VisibleScreenLifecycleBinding.java index 4b8c0c4c4..e0d781f0f 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/Pre29VisibleScreenLifecycleBinding.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/Pre29VisibleScreenLifecycleBinding.java @@ -17,7 +17,9 @@ package io.opentelemetry.rum.internal.instrumentation.activity; import android.app.Activity; + import androidx.annotation.NonNull; + import io.opentelemetry.rum.internal.DefaultingActivityLifecycleCallbacks; /** diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/RumFragmentActivityRegisterer.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/RumFragmentActivityRegisterer.java index b4f104506..ed66ad91c 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/RumFragmentActivityRegisterer.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/RumFragmentActivityRegisterer.java @@ -19,10 +19,12 @@ import android.app.Activity; import android.app.Application; import android.os.Bundle; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentManager; + import io.opentelemetry.rum.internal.DefaultingActivityLifecycleCallbacks; /** diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/VisibleScreenLifecycleBinding.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/VisibleScreenLifecycleBinding.java index bbfa89301..52f1be8bc 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/VisibleScreenLifecycleBinding.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/VisibleScreenLifecycleBinding.java @@ -17,7 +17,9 @@ package io.opentelemetry.rum.internal.instrumentation.activity; import android.app.Activity; + import androidx.annotation.NonNull; + import io.opentelemetry.rum.internal.DefaultingActivityLifecycleCallbacks; /** diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/VisibleScreenTracker.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/VisibleScreenTracker.java index 87fa24d30..77cff5e02 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/VisibleScreenTracker.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/activity/VisibleScreenTracker.java @@ -17,10 +17,12 @@ package io.opentelemetry.rum.internal.instrumentation.activity; import android.app.Activity; + import androidx.annotation.Nullable; import androidx.fragment.app.DialogFragment; import androidx.fragment.app.Fragment; import androidx.navigation.fragment.NavHostFragment; + import java.util.concurrent.atomic.AtomicReference; /** diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/anr/AnrDetector.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/anr/AnrDetector.java index 469e48f3b..378557a8b 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/anr/AnrDetector.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/anr/AnrDetector.java @@ -18,11 +18,13 @@ import android.os.Handler; import android.os.Looper; + import io.opentelemetry.api.OpenTelemetry; import io.opentelemetry.api.trace.StatusCode; import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter; import io.opentelemetry.rum.internal.instrumentation.InstrumentedApplication; + import java.util.List; import java.util.concurrent.ScheduledExecutorService; diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/anr/AnrDetectorBuilder.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/anr/AnrDetectorBuilder.java index 7cd00e95e..8876f762f 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/anr/AnrDetectorBuilder.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/anr/AnrDetectorBuilder.java @@ -17,7 +17,9 @@ package io.opentelemetry.rum.internal.instrumentation.anr; import android.os.Looper; + import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; + import java.util.ArrayList; import java.util.List; import java.util.concurrent.Executors; diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/anr/AnrDetectorToggler.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/anr/AnrDetectorToggler.java index f28d012cc..ddf656606 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/anr/AnrDetectorToggler.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/anr/AnrDetectorToggler.java @@ -17,7 +17,9 @@ package io.opentelemetry.rum.internal.instrumentation.anr; import androidx.annotation.Nullable; + import io.opentelemetry.rum.internal.instrumentation.ApplicationStateListener; + import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/anr/AnrWatcher.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/anr/AnrWatcher.java index d4abf0ca2..bc5008377 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/anr/AnrWatcher.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/anr/AnrWatcher.java @@ -17,8 +17,10 @@ package io.opentelemetry.rum.internal.instrumentation.anr; import android.os.Handler; + import io.opentelemetry.context.Context; import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter; + import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/crash/CrashReporter.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/crash/CrashReporter.java index 4c23724f6..b3f355754 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/crash/CrashReporter.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/crash/CrashReporter.java @@ -20,6 +20,7 @@ import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter; import io.opentelemetry.rum.internal.instrumentation.InstrumentedApplication; + import java.util.List; /** Entrypoint for installing the crash reporting instrumentation. */ diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/crash/CrashReporterBuilder.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/crash/CrashReporterBuilder.java index 49e11921e..e25e0303d 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/crash/CrashReporterBuilder.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/crash/CrashReporterBuilder.java @@ -17,6 +17,7 @@ package io.opentelemetry.rum.internal.instrumentation.crash; import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; + import java.util.ArrayList; import java.util.List; diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/crash/CrashReportingExceptionHandler.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/crash/CrashReportingExceptionHandler.java index 709af643a..ac6a9b523 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/crash/CrashReportingExceptionHandler.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/crash/CrashReportingExceptionHandler.java @@ -17,10 +17,12 @@ package io.opentelemetry.rum.internal.instrumentation.crash; import androidx.annotation.NonNull; + import io.opentelemetry.context.Context; import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter; import io.opentelemetry.sdk.common.CompletableResultCode; import io.opentelemetry.sdk.trace.SdkTracerProvider; + import java.util.concurrent.TimeUnit; final class CrashReportingExceptionHandler implements Thread.UncaughtExceptionHandler { diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/fragment/FragmentTracer.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/fragment/FragmentTracer.java index aa494c4fc..447c37986 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/fragment/FragmentTracer.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/fragment/FragmentTracer.java @@ -19,6 +19,7 @@ import static io.opentelemetry.rum.internal.RumConstants.SCREEN_NAME_KEY; import androidx.fragment.app.Fragment; + import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.trace.Span; import io.opentelemetry.api.trace.Tracer; diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/fragment/RumFragmentLifecycleCallbacks.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/fragment/RumFragmentLifecycleCallbacks.java index a8c4184ff..7a080b296 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/fragment/RumFragmentLifecycleCallbacks.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/fragment/RumFragmentLifecycleCallbacks.java @@ -19,14 +19,17 @@ import android.content.Context; import android.os.Bundle; import android.view.View; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; + import io.opentelemetry.api.trace.Tracer; import io.opentelemetry.rum.internal.instrumentation.ScreenNameExtractor; import io.opentelemetry.rum.internal.instrumentation.activity.VisibleScreenTracker; import io.opentelemetry.rum.internal.util.ActiveSpan; + import java.util.HashMap; import java.util.Map; diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/lifecycle/AndroidLifecycleInstrumentation.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/lifecycle/AndroidLifecycleInstrumentation.java index 2440f252a..1fbe7071b 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/lifecycle/AndroidLifecycleInstrumentation.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/lifecycle/AndroidLifecycleInstrumentation.java @@ -18,7 +18,9 @@ import android.app.Application; import android.os.Build; + import androidx.annotation.NonNull; + import io.opentelemetry.api.trace.Tracer; import io.opentelemetry.rum.internal.instrumentation.InstrumentedApplication; import io.opentelemetry.rum.internal.instrumentation.ScreenNameExtractor; @@ -31,6 +33,7 @@ import io.opentelemetry.rum.internal.instrumentation.activity.VisibleScreenTracker; import io.opentelemetry.rum.internal.instrumentation.fragment.RumFragmentLifecycleCallbacks; import io.opentelemetry.rum.internal.instrumentation.startup.AppStartupTimer; + import java.util.function.Function; /** diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/lifecycle/AndroidLifecycleInstrumentationBuilder.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/lifecycle/AndroidLifecycleInstrumentationBuilder.java index d943b6bb6..e2506655e 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/lifecycle/AndroidLifecycleInstrumentationBuilder.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/lifecycle/AndroidLifecycleInstrumentationBuilder.java @@ -20,6 +20,7 @@ import io.opentelemetry.rum.internal.instrumentation.ScreenNameExtractor; import io.opentelemetry.rum.internal.instrumentation.activity.VisibleScreenTracker; import io.opentelemetry.rum.internal.instrumentation.startup.AppStartupTimer; + import java.util.function.Function; public class AndroidLifecycleInstrumentationBuilder { diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/Carrier.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/Carrier.java index a6f61d292..850c52245 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/Carrier.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/Carrier.java @@ -18,8 +18,10 @@ import android.os.Build; import android.telephony.TelephonyManager; + import androidx.annotation.Nullable; import androidx.annotation.RequiresApi; + import java.util.Objects; @RequiresApi(api = Build.VERSION_CODES.P) diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/CarrierFinder.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/CarrierFinder.java index 23ca02a88..e35759fb6 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/CarrierFinder.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/CarrierFinder.java @@ -18,6 +18,7 @@ import android.os.Build; import android.telephony.TelephonyManager; + import androidx.annotation.RequiresApi; @RequiresApi(api = Build.VERSION_CODES.P) diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/CurrentNetwork.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/CurrentNetwork.java index 4a7ab9d56..ca1b3c413 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/CurrentNetwork.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/CurrentNetwork.java @@ -17,7 +17,9 @@ package io.opentelemetry.rum.internal.instrumentation.network; import android.os.Build; + import androidx.annotation.Nullable; + import java.util.Objects; /** A value class representing the current network that the device is connected to. */ diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/CurrentNetworkAttributesExtractor.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/CurrentNetworkAttributesExtractor.java index 3662cb1ae..2a6835111 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/CurrentNetworkAttributesExtractor.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/CurrentNetworkAttributesExtractor.java @@ -24,6 +24,7 @@ import static io.opentelemetry.semconv.trace.attributes.SemanticAttributes.NET_HOST_CONNECTION_TYPE; import androidx.annotation.Nullable; + import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.common.AttributesBuilder; diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/CurrentNetworkProvider.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/CurrentNetworkProvider.java index 1c2675d0b..10a1f431b 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/CurrentNetworkProvider.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/CurrentNetworkProvider.java @@ -26,7 +26,9 @@ import android.net.NetworkRequest; import android.os.Build; import android.util.Log; + import androidx.annotation.NonNull; + import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; import java.util.function.Supplier; diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/NetworkApplicationListener.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/NetworkApplicationListener.java index 6cdd19919..7762f9079 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/NetworkApplicationListener.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/NetworkApplicationListener.java @@ -22,6 +22,7 @@ import io.opentelemetry.context.Context; import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter; import io.opentelemetry.rum.internal.instrumentation.ApplicationStateListener; + import java.util.concurrent.atomic.AtomicBoolean; class NetworkApplicationListener implements ApplicationStateListener { diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/NetworkChangeMonitor.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/NetworkChangeMonitor.java index 7cd12e03d..162ab7643 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/NetworkChangeMonitor.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/NetworkChangeMonitor.java @@ -20,6 +20,7 @@ import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter; import io.opentelemetry.rum.internal.instrumentation.InstrumentedApplication; + import java.util.ArrayList; import java.util.List; diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/NetworkChangeMonitorBuilder.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/NetworkChangeMonitorBuilder.java index 992562287..e4b927e43 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/NetworkChangeMonitorBuilder.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/NetworkChangeMonitorBuilder.java @@ -17,6 +17,7 @@ package io.opentelemetry.rum.internal.instrumentation.network; import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; + import java.util.ArrayList; import java.util.List; diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/PostApi28NetworkDetector.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/PostApi28NetworkDetector.java index 1bd9589a8..94494f6c9 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/PostApi28NetworkDetector.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/network/PostApi28NetworkDetector.java @@ -27,6 +27,7 @@ import android.net.NetworkCapabilities; import android.os.Build; import android.telephony.TelephonyManager; + import androidx.annotation.RequiresApi; import androidx.core.app.ActivityCompat; diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/slowrendering/SlowRenderListener.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/slowrendering/SlowRenderListener.java index fde4282d9..d0aa631ad 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/slowrendering/SlowRenderListener.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/slowrendering/SlowRenderListener.java @@ -18,6 +18,7 @@ import static android.view.FrameMetrics.DRAW_DURATION; import static android.view.FrameMetrics.FIRST_DRAW_FRAME; + import static io.opentelemetry.rum.internal.RumConstants.OTEL_RUM_LOG_TAG; import android.app.Activity; @@ -29,12 +30,15 @@ import android.util.SparseIntArray; import android.view.FrameMetrics; import android.view.Window; + import androidx.annotation.GuardedBy; import androidx.annotation.NonNull; import androidx.annotation.RequiresApi; + import io.opentelemetry.api.trace.Span; import io.opentelemetry.api.trace.Tracer; import io.opentelemetry.rum.internal.DefaultingActivityLifecycleCallbacks; + import java.time.Duration; import java.time.Instant; import java.util.concurrent.ConcurrentHashMap; diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/slowrendering/SlowRenderingDetector.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/slowrendering/SlowRenderingDetector.java index 7c4563d71..cec114f99 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/slowrendering/SlowRenderingDetector.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/slowrendering/SlowRenderingDetector.java @@ -20,7 +20,9 @@ import android.os.Build; import android.util.Log; + import io.opentelemetry.rum.internal.instrumentation.InstrumentedApplication; + import java.time.Duration; /** diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/slowrendering/SlowRenderingDetectorBuilder.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/slowrendering/SlowRenderingDetectorBuilder.java index bb1f3e169..9811ea095 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/slowrendering/SlowRenderingDetectorBuilder.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/slowrendering/SlowRenderingDetectorBuilder.java @@ -19,6 +19,7 @@ import static io.opentelemetry.rum.internal.RumConstants.OTEL_RUM_LOG_TAG; import android.util.Log; + import java.time.Duration; /** diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/startup/AppStartupTimer.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/startup/AppStartupTimer.java index f69dec02d..7044ee4e4 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/startup/AppStartupTimer.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/instrumentation/startup/AppStartupTimer.java @@ -24,13 +24,16 @@ import android.os.Bundle; import android.os.Handler; import android.util.Log; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; + import io.opentelemetry.api.trace.Span; import io.opentelemetry.api.trace.Tracer; import io.opentelemetry.rum.internal.DefaultingActivityLifecycleCallbacks; import io.opentelemetry.rum.internal.util.AnchoredClock; import io.opentelemetry.sdk.common.Clock; + import java.util.concurrent.TimeUnit; public class AppStartupTimer { diff --git a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/util/ActiveSpan.java b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/util/ActiveSpan.java index 2e4430bfc..3a10a70d0 100644 --- a/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/util/ActiveSpan.java +++ b/splunk-otel-android/src/main/java/io/opentelemetry/rum/internal/util/ActiveSpan.java @@ -19,8 +19,10 @@ import static io.opentelemetry.rum.internal.RumConstants.LAST_SCREEN_NAME_KEY; import androidx.annotation.Nullable; + import io.opentelemetry.api.trace.Span; import io.opentelemetry.context.Scope; + import java.util.function.Supplier; public class ActiveSpan { diff --git a/splunk-otel-android/src/test/java/com/splunk/rum/BandwidthTrackerTest.java b/splunk-otel-android/src/test/java/com/splunk/rum/BandwidthTrackerTest.java index 6156480f1..ef753692b 100644 --- a/splunk-otel-android/src/test/java/com/splunk/rum/BandwidthTrackerTest.java +++ b/splunk-otel-android/src/test/java/com/splunk/rum/BandwidthTrackerTest.java @@ -20,11 +20,12 @@ import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.mock; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + import java.time.Clock; import java.util.Collections; import java.util.concurrent.atomic.AtomicLong; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; class BandwidthTrackerTest { diff --git a/splunk-otel-android/src/test/java/com/splunk/rum/CrashComponentExtractorTest.java b/splunk-otel-android/src/test/java/com/splunk/rum/CrashComponentExtractorTest.java index 7885e367b..391b48024 100644 --- a/splunk-otel-android/src/test/java/com/splunk/rum/CrashComponentExtractorTest.java +++ b/splunk-otel-android/src/test/java/com/splunk/rum/CrashComponentExtractorTest.java @@ -17,10 +17,12 @@ package com.splunk.rum; import static com.splunk.rum.SplunkRum.COMPONENT_KEY; + import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat; import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.common.AttributesBuilder; + import org.junit.jupiter.api.Test; class CrashComponentExtractorTest { diff --git a/splunk-otel-android/src/test/java/com/splunk/rum/CustomZipkinEncoderTest.java b/splunk-otel-android/src/test/java/com/splunk/rum/CustomZipkinEncoderTest.java index ffafa0999..574d50b67 100644 --- a/splunk-otel-android/src/test/java/com/splunk/rum/CustomZipkinEncoderTest.java +++ b/splunk-otel-android/src/test/java/com/splunk/rum/CustomZipkinEncoderTest.java @@ -20,7 +20,9 @@ import io.opentelemetry.api.trace.SpanId; import io.opentelemetry.api.trace.TraceId; + import org.junit.jupiter.api.Test; + import zipkin2.Span; class CustomZipkinEncoderTest { diff --git a/splunk-otel-android/src/test/java/com/splunk/rum/DeviceSpanStorageLimiterTest.java b/splunk-otel-android/src/test/java/com/splunk/rum/DeviceSpanStorageLimiterTest.java index bcf150f27..8e9b31ad4 100644 --- a/splunk-otel-android/src/test/java/com/splunk/rum/DeviceSpanStorageLimiterTest.java +++ b/splunk-otel-android/src/test/java/com/splunk/rum/DeviceSpanStorageLimiterTest.java @@ -24,14 +24,15 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import java.io.File; -import java.util.stream.Stream; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; +import java.io.File; +import java.util.stream.Stream; + @ExtendWith(MockitoExtension.class) class DeviceSpanStorageLimiterTest { diff --git a/splunk-otel-android/src/test/java/com/splunk/rum/DiskToZipkinExporterTest.java b/splunk-otel-android/src/test/java/com/splunk/rum/DiskToZipkinExporterTest.java index f8cb4b222..25fac56ea 100644 --- a/splunk-otel-android/src/test/java/com/splunk/rum/DiskToZipkinExporterTest.java +++ b/splunk-otel-android/src/test/java/com/splunk/rum/DiskToZipkinExporterTest.java @@ -25,8 +25,7 @@ import io.opentelemetry.rum.internal.instrumentation.network.CurrentNetwork; import io.opentelemetry.rum.internal.instrumentation.network.CurrentNetworkProvider; -import java.io.File; -import java.util.stream.Stream; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -34,6 +33,9 @@ import org.mockito.Mockito; import org.mockito.junit.jupiter.MockitoExtension; +import java.io.File; +import java.util.stream.Stream; + @ExtendWith(MockitoExtension.class) class DiskToZipkinExporterTest { diff --git a/splunk-otel-android/src/test/java/com/splunk/rum/FileSenderTest.java b/splunk-otel-android/src/test/java/com/splunk/rum/FileSenderTest.java index a83499e5d..e59b976d8 100644 --- a/splunk-otel-android/src/test/java/com/splunk/rum/FileSenderTest.java +++ b/splunk-otel-android/src/test/java/com/splunk/rum/FileSenderTest.java @@ -16,7 +16,6 @@ package com.splunk.rum; -import static java.util.Collections.emptyList; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; @@ -25,21 +24,25 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; -import java.io.File; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.Arrays; -import java.util.List; -import java.util.function.Consumer; +import static java.util.Collections.emptyList; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.junit.jupiter.MockitoExtension; + import zipkin2.Call; import zipkin2.reporter.Sender; +import java.io.File; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; +import java.util.function.Consumer; + @ExtendWith(MockitoExtension.class) class FileSenderTest { diff --git a/splunk-otel-android/src/test/java/com/splunk/rum/MemoryBufferingExporterTest.java b/splunk-otel-android/src/test/java/com/splunk/rum/MemoryBufferingExporterTest.java index e8ebd73ad..99d32888b 100644 --- a/splunk-otel-android/src/test/java/com/splunk/rum/MemoryBufferingExporterTest.java +++ b/splunk-otel-android/src/test/java/com/splunk/rum/MemoryBufferingExporterTest.java @@ -31,14 +31,16 @@ import io.opentelemetry.sdk.common.CompletableResultCode; import io.opentelemetry.sdk.trace.data.SpanData; import io.opentelemetry.sdk.trace.export.SpanExporter; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; + import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.List; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; class MemoryBufferingExporterTest { private final CurrentNetworkProvider currentNetworkProvider = diff --git a/splunk-otel-android/src/test/java/com/splunk/rum/NoOpSplunkRumTest.java b/splunk-otel-android/src/test/java/com/splunk/rum/NoOpSplunkRumTest.java index 9d7263d22..b0323a0e6 100644 --- a/splunk-otel-android/src/test/java/com/splunk/rum/NoOpSplunkRumTest.java +++ b/splunk-otel-android/src/test/java/com/splunk/rum/NoOpSplunkRumTest.java @@ -22,9 +22,12 @@ import android.location.Location; import android.webkit.WebView; + import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.common.Attributes; + import okhttp3.OkHttpClient; + import org.junit.jupiter.api.Test; class NoOpSplunkRumTest { diff --git a/splunk-otel-android/src/test/java/com/splunk/rum/RumInitializerTest.java b/splunk-otel-android/src/test/java/com/splunk/rum/RumInitializerTest.java index 924f1afd1..f3c6f22fd 100644 --- a/splunk-otel-android/src/test/java/com/splunk/rum/RumInitializerTest.java +++ b/splunk-otel-android/src/test/java/com/splunk/rum/RumInitializerTest.java @@ -17,10 +17,9 @@ package com.splunk.rum; import static com.splunk.rum.SplunkRum.COMPONENT_KEY; + import static io.opentelemetry.api.common.AttributeKey.stringKey; -import static java.util.Collections.emptyList; -import static java.util.concurrent.TimeUnit.MILLISECONDS; -import static java.util.concurrent.TimeUnit.MINUTES; + import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -28,10 +27,16 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +import static java.util.Collections.emptyList; +import static java.util.concurrent.TimeUnit.MILLISECONDS; +import static java.util.concurrent.TimeUnit.MINUTES; + import android.app.Application; import android.content.Context; import android.os.Looper; + import com.google.common.base.Strings; + import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.trace.SpanKind; @@ -46,13 +51,15 @@ import io.opentelemetry.sdk.trace.data.StatusData; import io.opentelemetry.sdk.trace.export.SpanExporter; import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; -import java.util.ArrayList; -import java.util.List; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; +import java.util.ArrayList; +import java.util.List; + @ExtendWith(MockitoExtension.class) class RumInitializerTest { diff --git a/splunk-otel-android/src/test/java/com/splunk/rum/RumResponseAttributesExtractorTest.java b/splunk-otel-android/src/test/java/com/splunk/rum/RumResponseAttributesExtractorTest.java index 1ca693b2e..e67d40ee4 100644 --- a/splunk-otel-android/src/test/java/com/splunk/rum/RumResponseAttributesExtractorTest.java +++ b/splunk-otel-android/src/test/java/com/splunk/rum/RumResponseAttributesExtractorTest.java @@ -19,7 +19,9 @@ import static com.splunk.rum.SplunkRum.COMPONENT_KEY; import static com.splunk.rum.SplunkRum.LINK_SPAN_ID_KEY; import static com.splunk.rum.SplunkRum.LINK_TRACE_ID_KEY; + import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat; + import static org.assertj.core.api.Assertions.entry; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -27,9 +29,11 @@ import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.common.AttributesBuilder; import io.opentelemetry.context.Context; + import okhttp3.Protocol; import okhttp3.Request; import okhttp3.Response; + import org.junit.jupiter.api.Test; class RumResponseAttributesExtractorTest { diff --git a/splunk-otel-android/src/test/java/com/splunk/rum/RuntimeDetailsExtractorTest.java b/splunk-otel-android/src/test/java/com/splunk/rum/RuntimeDetailsExtractorTest.java index 3414fbc09..a6ba470da 100644 --- a/splunk-otel-android/src/test/java/com/splunk/rum/RuntimeDetailsExtractorTest.java +++ b/splunk-otel-android/src/test/java/com/splunk/rum/RuntimeDetailsExtractorTest.java @@ -18,19 +18,23 @@ import static io.opentelemetry.context.Context.root; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat; + import static org.mockito.Mockito.when; import android.content.Context; import android.content.Intent; import android.os.BatteryManager; + import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.common.AttributesBuilder; -import java.io.File; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; +import java.io.File; + @ExtendWith(MockitoExtension.class) class RuntimeDetailsExtractorTest { diff --git a/splunk-otel-android/src/test/java/com/splunk/rum/ScreenAttributesAppenderTest.java b/splunk-otel-android/src/test/java/com/splunk/rum/ScreenAttributesAppenderTest.java index 20c0ac651..f6094c99b 100644 --- a/splunk-otel-android/src/test/java/com/splunk/rum/ScreenAttributesAppenderTest.java +++ b/splunk-otel-android/src/test/java/com/splunk/rum/ScreenAttributesAppenderTest.java @@ -18,6 +18,7 @@ import static io.opentelemetry.rum.internal.RumConstants.LAST_SCREEN_NAME_KEY; import static io.opentelemetry.rum.internal.RumConstants.SCREEN_NAME_KEY; + import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; @@ -30,6 +31,7 @@ import io.opentelemetry.context.Context; import io.opentelemetry.rum.internal.instrumentation.activity.VisibleScreenTracker; import io.opentelemetry.sdk.trace.ReadWriteSpan; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/splunk-otel-android/src/test/java/com/splunk/rum/SplunkRumBuilderTest.java b/splunk-otel-android/src/test/java/com/splunk/rum/SplunkRumBuilderTest.java index 4a50abaf2..c31fcea63 100644 --- a/splunk-otel-android/src/test/java/com/splunk/rum/SplunkRumBuilderTest.java +++ b/splunk-otel-android/src/test/java/com/splunk/rum/SplunkRumBuilderTest.java @@ -24,7 +24,9 @@ import static org.mockito.Mockito.mock; import android.app.Application; + import io.opentelemetry.api.common.Attributes; + import org.junit.jupiter.api.Test; class SplunkRumBuilderTest { diff --git a/splunk-otel-android/src/test/java/com/splunk/rum/SplunkRumTest.java b/splunk-otel-android/src/test/java/com/splunk/rum/SplunkRumTest.java index 3000572c7..887d8b272 100644 --- a/splunk-otel-android/src/test/java/com/splunk/rum/SplunkRumTest.java +++ b/splunk-otel-android/src/test/java/com/splunk/rum/SplunkRumTest.java @@ -17,9 +17,11 @@ package com.splunk.rum; import static com.splunk.rum.SplunkRum.COMPONENT_KEY; + import static io.opentelemetry.api.common.AttributeKey.longKey; import static io.opentelemetry.api.common.AttributeKey.stringKey; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertSame; @@ -37,6 +39,7 @@ import android.content.Context; import android.location.Location; import android.webkit.WebView; + import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.common.AttributesBuilder; import io.opentelemetry.api.trace.Span; @@ -52,10 +55,7 @@ import io.opentelemetry.sdk.trace.SdkTracerProvider; import io.opentelemetry.sdk.trace.data.SpanData; import io.opentelemetry.sdk.trace.export.SimpleSpanProcessor; -import java.io.File; -import java.util.List; -import java.util.concurrent.atomic.AtomicReference; -import java.util.function.Consumer; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -63,6 +63,11 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; +import java.io.File; +import java.util.List; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Consumer; + @ExtendWith(MockitoExtension.class) public class SplunkRumTest { diff --git a/splunk-otel-android/src/test/java/com/splunk/rum/SplunkSpanDataModifierTest.java b/splunk-otel-android/src/test/java/com/splunk/rum/SplunkSpanDataModifierTest.java index 9068f1064..413f5cdce 100644 --- a/splunk-otel-android/src/test/java/com/splunk/rum/SplunkSpanDataModifierTest.java +++ b/splunk-otel-android/src/test/java/com/splunk/rum/SplunkSpanDataModifierTest.java @@ -19,12 +19,15 @@ import static com.splunk.rum.SplunkSpanDataModifier.REACT_NATIVE_SPAN_ID_KEY; import static com.splunk.rum.SplunkSpanDataModifier.REACT_NATIVE_TRACE_ID_KEY; import static com.splunk.rum.SplunkSpanDataModifier.SPLUNK_OPERATION_KEY; + import static io.opentelemetry.api.common.AttributeKey.stringKey; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo; + +import static org.mockito.Mockito.when; + import static java.util.Collections.singleton; import static java.util.Collections.singletonList; -import static org.mockito.Mockito.when; import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.trace.SpanContext; @@ -41,8 +44,7 @@ import io.opentelemetry.sdk.trace.export.SpanExporter; import io.opentelemetry.semconv.resource.attributes.ResourceAttributes; import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; -import java.util.Arrays; -import java.util.Collection; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentCaptor; @@ -50,6 +52,9 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; +import java.util.Arrays; +import java.util.Collection; + @ExtendWith(MockitoExtension.class) class SplunkSpanDataModifierTest { diff --git a/splunk-otel-android/src/test/java/com/splunk/rum/ThrottlingExporterTest.java b/splunk-otel-android/src/test/java/com/splunk/rum/ThrottlingExporterTest.java index 953eb092c..8e6c9f5b9 100644 --- a/splunk-otel-android/src/test/java/com/splunk/rum/ThrottlingExporterTest.java +++ b/splunk-otel-android/src/test/java/com/splunk/rum/ThrottlingExporterTest.java @@ -17,24 +17,28 @@ package com.splunk.rum; import static com.splunk.rum.SplunkRum.COMPONENT_KEY; -import static java.util.Arrays.asList; + import static org.mockito.Mockito.verify; +import static java.util.Arrays.asList; + import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.trace.SpanKind; import io.opentelemetry.sdk.testing.trace.TestSpanData; import io.opentelemetry.sdk.trace.data.SpanData; import io.opentelemetry.sdk.trace.data.StatusData; import io.opentelemetry.sdk.trace.export.SpanExporter; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + import java.time.Duration; import java.time.Instant; import java.time.temporal.ChronoUnit; import java.util.List; import java.util.concurrent.TimeUnit; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; @ExtendWith(MockitoExtension.class) class ThrottlingExporterTest { diff --git a/splunk-otel-android/src/test/java/com/splunk/rum/WorkflowTest.java b/splunk-otel-android/src/test/java/com/splunk/rum/WorkflowTest.java index eed355f60..ab075f897 100644 --- a/splunk-otel-android/src/test/java/com/splunk/rum/WorkflowTest.java +++ b/splunk-otel-android/src/test/java/com/splunk/rum/WorkflowTest.java @@ -24,11 +24,13 @@ import io.opentelemetry.context.Scope; import io.opentelemetry.sdk.testing.junit5.OpenTelemetryExtension; import io.opentelemetry.sdk.trace.data.SpanData; -import java.util.List; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; +import java.util.List; + class WorkflowTest { @RegisterExtension final OpenTelemetryExtension otelTesting = OpenTelemetryExtension.create(); diff --git a/splunk-otel-android/src/test/java/com/splunk/rum/ZipkinToDiskSenderTest.java b/splunk-otel-android/src/test/java/com/splunk/rum/ZipkinToDiskSenderTest.java index edb2971a7..6c75a8b5b 100644 --- a/splunk-otel-android/src/test/java/com/splunk/rum/ZipkinToDiskSenderTest.java +++ b/splunk-otel-android/src/test/java/com/splunk/rum/ZipkinToDiskSenderTest.java @@ -16,7 +16,6 @@ package com.splunk.rum; -import static java.util.Collections.emptyList; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.lenient; import static org.mockito.Mockito.verify; @@ -24,12 +23,10 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; +import static java.util.Collections.emptyList; + import io.opentelemetry.sdk.common.Clock; -import java.io.File; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.Arrays; -import java.util.List; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -37,6 +34,12 @@ import org.mockito.Mockito; import org.mockito.junit.jupiter.MockitoExtension; +import java.io.File; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; + @ExtendWith(MockitoExtension.class) class ZipkinToDiskSenderTest { diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/ApplicationStateWatcherTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/ApplicationStateWatcherTest.java index 618278a02..2e1828fd5 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/ApplicationStateWatcherTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/ApplicationStateWatcherTest.java @@ -19,7 +19,9 @@ import static org.mockito.Mockito.inOrder; import android.app.Activity; + import io.opentelemetry.rum.internal.instrumentation.ApplicationStateListener; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/GlobalAttributesSpanAppenderTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/GlobalAttributesSpanAppenderTest.java index 6660cc793..6405c5665 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/GlobalAttributesSpanAppenderTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/GlobalAttributesSpanAppenderTest.java @@ -18,6 +18,7 @@ import static io.opentelemetry.api.common.AttributeKey.longKey; import static io.opentelemetry.api.common.AttributeKey.stringKey; + import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.verify; @@ -25,6 +26,7 @@ import io.opentelemetry.api.common.Attributes; import io.opentelemetry.context.Context; import io.opentelemetry.sdk.trace.ReadWriteSpan; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/ModifiedSpanDataTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/ModifiedSpanDataTest.java index ef27fddf9..5c17193ea 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/ModifiedSpanDataTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/ModifiedSpanDataTest.java @@ -17,9 +17,11 @@ package io.opentelemetry.rum.internal; import static io.opentelemetry.api.common.AttributeKey.stringKey; -import static java.util.Collections.emptyList; + import static org.junit.jupiter.api.Assertions.assertEquals; +import static java.util.Collections.emptyList; + import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.trace.SpanContext; import io.opentelemetry.api.trace.SpanId; @@ -32,6 +34,7 @@ import io.opentelemetry.sdk.testing.trace.TestSpanData; import io.opentelemetry.sdk.trace.data.SpanData; import io.opentelemetry.sdk.trace.data.StatusData; + import org.junit.jupiter.api.Test; class ModifiedSpanDataTest { diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/OpenTelemetryRumBuilderTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/OpenTelemetryRumBuilderTest.java index ca9fa2ee3..1d1477d8d 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/OpenTelemetryRumBuilderTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/OpenTelemetryRumBuilderTest.java @@ -19,17 +19,19 @@ import static io.opentelemetry.rum.internal.RumConstants.SESSION_ID_KEY; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo; + import static org.mockito.ArgumentMatchers.isA; import static org.mockito.Mockito.verify; import android.app.Activity; import android.app.Application; + import io.opentelemetry.rum.internal.instrumentation.ApplicationStateListener; import io.opentelemetry.sdk.resources.Resource; import io.opentelemetry.sdk.testing.exporter.InMemorySpanExporter; import io.opentelemetry.sdk.trace.data.SpanData; import io.opentelemetry.sdk.trace.export.SimpleSpanProcessor; -import java.util.List; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentCaptor; @@ -37,6 +39,8 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; +import java.util.List; + @ExtendWith(MockitoExtension.class) class OpenTelemetryRumBuilderTest { diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/SessionIdChangeTracerTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/SessionIdChangeTracerTest.java index d5a4fb1f6..37dd7dea0 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/SessionIdChangeTracerTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/SessionIdChangeTracerTest.java @@ -17,17 +17,20 @@ package io.opentelemetry.rum.internal; import static io.opentelemetry.rum.internal.RumConstants.PREVIOUS_SESSION_ID_KEY; + import static org.junit.jupiter.api.Assertions.assertEquals; import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.trace.Tracer; import io.opentelemetry.sdk.testing.junit5.OpenTelemetryExtension; import io.opentelemetry.sdk.trace.data.SpanData; -import java.util.List; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; +import java.util.List; + class SessionIdChangeTracerTest { @RegisterExtension final OpenTelemetryExtension otelTesting = OpenTelemetryExtension.create(); diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/SessionIdRatioBasedSamplerTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/SessionIdRatioBasedSamplerTest.java index bef9749ff..21bec7fde 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/SessionIdRatioBasedSamplerTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/SessionIdRatioBasedSamplerTest.java @@ -28,13 +28,15 @@ import io.opentelemetry.sdk.trace.data.LinkData; import io.opentelemetry.sdk.trace.samplers.Sampler; import io.opentelemetry.sdk.trace.samplers.SamplingDecision; -import java.util.Collections; -import java.util.List; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; +import java.util.Collections; +import java.util.List; + @ExtendWith(MockitoExtension.class) class SessionIdRatioBasedSamplerTest { private static final String HIGH_ID = "00000000000000008fffffffffffffff"; diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/SessionIdSpanAppenderTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/SessionIdSpanAppenderTest.java index c065113b0..df33cfee1 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/SessionIdSpanAppenderTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/SessionIdSpanAppenderTest.java @@ -17,6 +17,7 @@ package io.opentelemetry.rum.internal; import static io.opentelemetry.rum.internal.RumConstants.SESSION_ID_KEY; + import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.verify; @@ -24,6 +25,7 @@ import io.opentelemetry.context.Context; import io.opentelemetry.sdk.trace.ReadWriteSpan; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/SessionIdTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/SessionIdTest.java index 0fa2facaa..8cab48510 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/SessionIdTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/SessionIdTest.java @@ -29,14 +29,16 @@ import static org.mockito.Mockito.when; import io.opentelemetry.sdk.testing.time.TestClock; -import java.util.concurrent.TimeUnit; -import java.util.regex.Pattern; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InOrder; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; +import java.util.concurrent.TimeUnit; +import java.util.regex.Pattern; + @ExtendWith(MockitoExtension.class) class SessionIdTest { diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/SessionIdTimeoutHandlerTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/SessionIdTimeoutHandlerTest.java index e0265ca73..71ca5d32f 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/SessionIdTimeoutHandlerTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/SessionIdTimeoutHandlerTest.java @@ -20,9 +20,11 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import io.opentelemetry.sdk.testing.time.TestClock; + +import org.junit.jupiter.api.Test; + import java.time.Duration; import java.util.concurrent.TimeUnit; -import org.junit.jupiter.api.Test; class SessionIdTimeoutHandlerTest { diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/SpanDataModifierTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/SpanDataModifierTest.java index 3fec041b1..0a61ddfb7 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/SpanDataModifierTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/SpanDataModifierTest.java @@ -19,13 +19,15 @@ import static io.opentelemetry.api.common.AttributeKey.longKey; import static io.opentelemetry.api.common.AttributeKey.stringKey; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat; -import static java.util.Arrays.asList; -import static java.util.Collections.singletonList; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertSame; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import static java.util.Arrays.asList; +import static java.util.Collections.singletonList; + import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.trace.SpanKind; @@ -34,9 +36,7 @@ import io.opentelemetry.sdk.trace.data.SpanData; import io.opentelemetry.sdk.trace.data.StatusData; import io.opentelemetry.sdk.trace.export.SpanExporter; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentCaptor; @@ -44,6 +44,10 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + @ExtendWith(MockitoExtension.class) class SpanDataModifierTest { static final AttributeKey ATTRIBUTE = stringKey("attribute"); diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/ActivityCallbacksTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/ActivityCallbacksTest.java index 4015ea71e..de1cd32ed 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/ActivityCallbacksTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/ActivityCallbacksTest.java @@ -19,6 +19,7 @@ import static io.opentelemetry.rum.internal.RumConstants.LAST_SCREEN_NAME_KEY; import static io.opentelemetry.rum.internal.RumConstants.SCREEN_NAME_KEY; import static io.opentelemetry.rum.internal.RumConstants.START_TYPE_KEY; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -27,18 +28,21 @@ import static org.mockito.Mockito.when; import android.app.Activity; + import io.opentelemetry.api.trace.Tracer; import io.opentelemetry.rum.internal.instrumentation.ScreenNameExtractor; import io.opentelemetry.rum.internal.instrumentation.startup.AppStartupTimer; import io.opentelemetry.sdk.testing.junit5.OpenTelemetryExtension; import io.opentelemetry.sdk.trace.data.EventData; import io.opentelemetry.sdk.trace.data.SpanData; -import java.util.List; -import java.util.Optional; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; +import java.util.List; +import java.util.Optional; + class ActivityCallbacksTest { @RegisterExtension final OpenTelemetryExtension otelTesting = OpenTelemetryExtension.create(); diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/ActivityTracerCacheTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/ActivityTracerCacheTest.java index 776be8946..2d6bf5871 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/ActivityTracerCacheTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/ActivityTracerCacheTest.java @@ -24,14 +24,16 @@ import static org.mockito.Mockito.when; import android.app.Activity; -import java.util.concurrent.atomic.AtomicReference; -import java.util.function.Function; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Function; + @ExtendWith(MockitoExtension.class) class ActivityTracerCacheTest { diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/ActivityTracerTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/ActivityTracerTest.java index 30096f1d9..13e31ac32 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/ActivityTracerTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/ActivityTracerTest.java @@ -19,22 +19,26 @@ import static io.opentelemetry.rum.internal.RumConstants.LAST_SCREEN_NAME_KEY; import static io.opentelemetry.rum.internal.RumConstants.SCREEN_NAME_KEY; import static io.opentelemetry.rum.internal.RumConstants.START_TYPE_KEY; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import android.app.Activity; + import io.opentelemetry.api.trace.Tracer; import io.opentelemetry.rum.internal.instrumentation.startup.AppStartupTimer; import io.opentelemetry.rum.internal.util.ActiveSpan; import io.opentelemetry.sdk.testing.junit5.OpenTelemetryExtension; import io.opentelemetry.sdk.trace.data.SpanData; -import java.util.List; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; +import java.util.List; + public class ActivityTracerTest { @RegisterExtension final OpenTelemetryExtension otelTesting = OpenTelemetryExtension.create(); diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/Pre29ActivityLifecycleCallbacksTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/Pre29ActivityLifecycleCallbacksTest.java index 8a5207858..bc5edac9a 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/Pre29ActivityLifecycleCallbacksTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/Pre29ActivityLifecycleCallbacksTest.java @@ -19,6 +19,7 @@ import static io.opentelemetry.rum.internal.RumConstants.LAST_SCREEN_NAME_KEY; import static io.opentelemetry.rum.internal.RumConstants.SCREEN_NAME_KEY; import static io.opentelemetry.rum.internal.RumConstants.START_TYPE_KEY; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -27,18 +28,21 @@ import static org.mockito.Mockito.when; import android.app.Activity; + import io.opentelemetry.api.trace.Tracer; import io.opentelemetry.rum.internal.instrumentation.ScreenNameExtractor; import io.opentelemetry.rum.internal.instrumentation.startup.AppStartupTimer; import io.opentelemetry.sdk.testing.junit5.OpenTelemetryExtension; import io.opentelemetry.sdk.trace.data.EventData; import io.opentelemetry.sdk.trace.data.SpanData; -import java.util.List; -import java.util.Optional; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; +import java.util.List; +import java.util.Optional; + class Pre29ActivityLifecycleCallbacksTest { @RegisterExtension final OpenTelemetryExtension otelTesting = OpenTelemetryExtension.create(); private ActivityTracerCache tracers; diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/Pre29VisibleScreenLifecycleBindingTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/Pre29VisibleScreenLifecycleBindingTest.java index 65a2ccea1..c37c6bd96 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/Pre29VisibleScreenLifecycleBindingTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/Pre29VisibleScreenLifecycleBindingTest.java @@ -20,6 +20,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; import android.app.Activity; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/RumFragmentActivityRegistererTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/RumFragmentActivityRegistererTest.java index fa141703c..b239f3b55 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/RumFragmentActivityRegistererTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/RumFragmentActivityRegistererTest.java @@ -22,8 +22,10 @@ import android.app.Activity; import android.app.Application; + import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentManager; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/VisibleScreenLifecycleBindingTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/VisibleScreenLifecycleBindingTest.java index d25864f53..fb0063e01 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/VisibleScreenLifecycleBindingTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/VisibleScreenLifecycleBindingTest.java @@ -20,6 +20,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; import android.app.Activity; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/VisibleScreenTrackerTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/VisibleScreenTrackerTest.java index efd3ff3ef..96468d36b 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/VisibleScreenTrackerTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/activity/VisibleScreenTrackerTest.java @@ -21,9 +21,11 @@ import static org.mockito.Mockito.mock; import android.app.Activity; + import androidx.fragment.app.DialogFragment; import androidx.fragment.app.Fragment; import androidx.navigation.fragment.NavHostFragment; + import org.junit.jupiter.api.Test; class VisibleScreenTrackerTest { diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/anr/AnrDetectorTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/anr/AnrDetectorTest.java index 15c103a70..c30af0044 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/anr/AnrDetectorTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/anr/AnrDetectorTest.java @@ -18,21 +18,25 @@ import static io.opentelemetry.api.common.AttributeKey.stringKey; import static io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor.constant; + import static org.mockito.ArgumentMatchers.eq; import static org.mockito.ArgumentMatchers.isA; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import android.os.Looper; + import io.opentelemetry.rum.internal.instrumentation.InstrumentedApplication; import io.opentelemetry.sdk.OpenTelemetrySdk; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; + @ExtendWith(MockitoExtension.class) class AnrDetectorTest { diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/anr/AnrDetectorTogglerTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/anr/AnrDetectorTogglerTest.java index ee6210b64..0524d20b7 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/anr/AnrDetectorTogglerTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/anr/AnrDetectorTogglerTest.java @@ -20,15 +20,16 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; + @ExtendWith(MockitoExtension.class) class AnrDetectorTogglerTest { diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/anr/AnrWatcherTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/anr/AnrWatcherTest.java index 3bf34b08a..f3eb96e8a 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/anr/AnrWatcherTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/anr/AnrWatcherTest.java @@ -27,8 +27,10 @@ import static org.mockito.Mockito.when; import android.os.Handler; + import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter; import io.opentelemetry.sdk.testing.junit5.OpenTelemetryExtension; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.RegisterExtension; diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/anr/StackTraceFormatterTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/anr/StackTraceFormatterTest.java index 4cc9e5161..288908da3 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/anr/StackTraceFormatterTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/anr/StackTraceFormatterTest.java @@ -22,6 +22,7 @@ import io.opentelemetry.api.common.AttributesBuilder; import io.opentelemetry.context.Context; import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; + import org.junit.jupiter.api.Test; class StackTraceFormatterTest { diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/crash/CrashReporterTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/crash/CrashReporterTest.java index 130048f7d..ff46caa75 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/crash/CrashReporterTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/crash/CrashReporterTest.java @@ -18,6 +18,7 @@ import static io.opentelemetry.api.common.AttributeKey.stringKey; import static io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor.constant; + import static org.awaitility.Awaitility.await; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -30,13 +31,15 @@ import io.opentelemetry.sdk.testing.junit5.OpenTelemetryExtension; import io.opentelemetry.sdk.trace.data.StatusData; import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; -import java.time.Duration; -import java.util.function.Consumer; + import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; +import java.time.Duration; +import java.util.function.Consumer; + class CrashReporterTest { @RegisterExtension diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/crash/CrashReportingExceptionHandlerTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/crash/CrashReportingExceptionHandlerTest.java index 46466db52..157955220 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/crash/CrashReportingExceptionHandlerTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/crash/CrashReportingExceptionHandlerTest.java @@ -26,13 +26,15 @@ import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter; import io.opentelemetry.sdk.common.CompletableResultCode; import io.opentelemetry.sdk.trace.SdkTracerProvider; -import java.util.concurrent.TimeUnit; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InOrder; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; +import java.util.concurrent.TimeUnit; + @ExtendWith(MockitoExtension.class) class CrashReportingExceptionHandlerTest { diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/fragment/FragmentCallbackTestHarness.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/fragment/FragmentCallbackTestHarness.java index 9101d2d31..cc309f0a8 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/fragment/FragmentCallbackTestHarness.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/fragment/FragmentCallbackTestHarness.java @@ -21,6 +21,7 @@ import android.content.Context; import android.os.Bundle; import android.view.View; + import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/fragment/FragmentTracerTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/fragment/FragmentTracerTest.java index 42dbf4231..34f6d55e4 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/fragment/FragmentTracerTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/fragment/FragmentTracerTest.java @@ -17,22 +17,26 @@ package io.opentelemetry.rum.internal.instrumentation.fragment; import static io.opentelemetry.rum.internal.RumConstants.LAST_SCREEN_NAME_KEY; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import androidx.fragment.app.Fragment; + import io.opentelemetry.api.trace.Tracer; import io.opentelemetry.rum.internal.instrumentation.activity.VisibleScreenTracker; import io.opentelemetry.rum.internal.util.ActiveSpan; import io.opentelemetry.sdk.testing.junit5.OpenTelemetryExtension; import io.opentelemetry.sdk.trace.data.SpanData; -import java.util.List; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; +import java.util.List; + class FragmentTracerTest { @RegisterExtension final OpenTelemetryExtension otelTesting = OpenTelemetryExtension.create(); private Tracer tracer; diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/fragment/RumFragmentLifecycleCallbacksTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/fragment/RumFragmentLifecycleCallbacksTest.java index 536c37f98..902a40e4c 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/fragment/RumFragmentLifecycleCallbacksTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/fragment/RumFragmentLifecycleCallbacksTest.java @@ -18,6 +18,7 @@ import static io.opentelemetry.rum.internal.RumConstants.LAST_SCREEN_NAME_KEY; import static io.opentelemetry.rum.internal.RumConstants.SCREEN_NAME_KEY; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; @@ -27,14 +28,14 @@ import static org.mockito.Mockito.when; import androidx.fragment.app.Fragment; + import io.opentelemetry.api.trace.Tracer; import io.opentelemetry.rum.internal.instrumentation.ScreenNameExtractor; import io.opentelemetry.rum.internal.instrumentation.activity.VisibleScreenTracker; import io.opentelemetry.sdk.testing.junit5.OpenTelemetryExtension; import io.opentelemetry.sdk.trace.data.EventData; import io.opentelemetry.sdk.trace.data.SpanData; -import java.util.List; -import java.util.Optional; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -42,6 +43,9 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; +import java.util.List; +import java.util.Optional; + @ExtendWith(MockitoExtension.class) class RumFragmentLifecycleCallbacksTest { @RegisterExtension final OpenTelemetryExtension otelTesting = OpenTelemetryExtension.create(); diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/fragment/ScreenNameExtractorTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/fragment/ScreenNameExtractorTest.java index e17b865a5..408849905 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/fragment/ScreenNameExtractorTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/fragment/ScreenNameExtractorTest.java @@ -19,9 +19,12 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import android.app.Activity; + import androidx.fragment.app.Fragment; + import io.opentelemetry.rum.internal.instrumentation.RumScreenName; import io.opentelemetry.rum.internal.instrumentation.ScreenNameExtractor; + import org.junit.jupiter.api.Test; class ScreenNameExtractorTest { diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/CarrierFinderTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/CarrierFinderTest.java index 805b98a06..ef5012410 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/CarrierFinderTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/CarrierFinderTest.java @@ -21,6 +21,7 @@ import static org.mockito.Mockito.when; import android.telephony.TelephonyManager; + import org.junit.jupiter.api.Test; class CarrierFinderTest { diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/CurrentNetworkAttributesExtractorTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/CurrentNetworkAttributesExtractorTest.java index 9df8d8819..dd7f0b72a 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/CurrentNetworkAttributesExtractorTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/CurrentNetworkAttributesExtractorTest.java @@ -17,10 +17,13 @@ package io.opentelemetry.rum.internal.instrumentation.network; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat; + import static org.assertj.core.api.Assertions.entry; import android.os.Build; + import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; + import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricTestRunner; diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/CurrentNetworkProviderTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/CurrentNetworkProviderTest.java index 435b0c1ec..7c0629ef0 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/CurrentNetworkProviderTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/CurrentNetworkProviderTest.java @@ -32,13 +32,15 @@ import android.net.Network; import android.net.NetworkRequest; import android.os.Build; -import java.util.concurrent.atomic.AtomicInteger; + import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; import org.robolectric.RobolectricTestRunner; import org.robolectric.annotation.Config; +import java.util.concurrent.atomic.AtomicInteger; + @RunWith(RobolectricTestRunner.class) @Config(maxSdk = Build.VERSION_CODES.S) public class CurrentNetworkProviderTest { diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/NetworkAttributesSpanAppenderTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/NetworkAttributesSpanAppenderTest.java index 4cb37f121..def23fb59 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/NetworkAttributesSpanAppenderTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/NetworkAttributesSpanAppenderTest.java @@ -25,6 +25,7 @@ import io.opentelemetry.context.Context; import io.opentelemetry.sdk.trace.ReadWriteSpan; import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/NetworkChangeMonitorTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/NetworkChangeMonitorTest.java index 037176342..f670de19e 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/NetworkChangeMonitorTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/NetworkChangeMonitorTest.java @@ -18,19 +18,21 @@ import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import android.os.Build; + import io.opentelemetry.rum.internal.instrumentation.ApplicationStateListener; import io.opentelemetry.rum.internal.instrumentation.InstrumentedApplication; import io.opentelemetry.sdk.OpenTelemetrySdk; import io.opentelemetry.sdk.testing.junit4.OpenTelemetryRule; import io.opentelemetry.sdk.trace.data.SpanData; import io.opentelemetry.semconv.trace.attributes.SemanticAttributes; -import java.util.List; + import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -43,6 +45,8 @@ import org.robolectric.RobolectricTestRunner; import org.robolectric.annotation.Config; +import java.util.List; + @Config(sdk = Build.VERSION_CODES.P) @RunWith(RobolectricTestRunner.class) public class NetworkChangeMonitorTest { diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/NetworkDetectorTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/NetworkDetectorTest.java index 28cb8b5f6..e5fe846c1 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/NetworkDetectorTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/NetworkDetectorTest.java @@ -20,7 +20,9 @@ import android.content.Context; import android.os.Build; + import androidx.test.core.app.ApplicationProvider; + import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricTestRunner; diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/PostApi28NetworkDetectorTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/PostApi28NetworkDetectorTest.java index d8f1528f8..2bf1798d4 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/PostApi28NetworkDetectorTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/PostApi28NetworkDetectorTest.java @@ -17,6 +17,7 @@ package io.opentelemetry.rum.internal.instrumentation.network; import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat; + import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -27,6 +28,7 @@ import android.net.NetworkCapabilities; import android.os.Build; import android.telephony.TelephonyManager; + import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/SimpleNetworkDetectorTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/SimpleNetworkDetectorTest.java index 04a9c5419..1cbbd2448 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/SimpleNetworkDetectorTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/network/SimpleNetworkDetectorTest.java @@ -24,7 +24,9 @@ import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.Build; + import androidx.test.core.app.ApplicationProvider; + import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricTestRunner; diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/slowrendering/SlowRenderListenerTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/slowrendering/SlowRenderListenerTest.java index f229f6fa9..e074c74a3 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/slowrendering/SlowRenderListenerTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/slowrendering/SlowRenderListenerTest.java @@ -18,7 +18,9 @@ import static android.view.FrameMetrics.DRAW_DURATION; import static android.view.FrameMetrics.FIRST_DRAW_FRAME; + import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat; + import static org.junit.Assert.assertEquals; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; @@ -35,16 +37,12 @@ import android.os.Build; import android.os.Handler; import android.view.FrameMetrics; + import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.trace.Tracer; import io.opentelemetry.sdk.testing.junit4.OpenTelemetryRule; import io.opentelemetry.sdk.trace.data.SpanData; -import java.time.Duration; -import java.util.List; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; -import java.util.stream.Collectors; -import java.util.stream.Stream; + import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -58,6 +56,13 @@ import org.robolectric.RobolectricTestRunner; import org.robolectric.annotation.Config; +import java.time.Duration; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import java.util.stream.Stream; + @RunWith(RobolectricTestRunner.class) @Config(sdk = Build.VERSION_CODES.N) public class SlowRenderListenerTest { diff --git a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/startup/AppStartupTimerTest.java b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/startup/AppStartupTimerTest.java index a6b8108d2..70a1a73b8 100644 --- a/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/startup/AppStartupTimerTest.java +++ b/splunk-otel-android/src/test/java/io/opentelemetry/rum/internal/instrumentation/startup/AppStartupTimerTest.java @@ -17,6 +17,7 @@ package io.opentelemetry.rum.internal.instrumentation.startup; import static io.opentelemetry.rum.internal.RumConstants.START_TYPE_KEY; + import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertSame; @@ -25,11 +26,13 @@ import io.opentelemetry.api.trace.Tracer; import io.opentelemetry.sdk.testing.junit5.OpenTelemetryExtension; import io.opentelemetry.sdk.trace.data.SpanData; -import java.util.List; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; +import java.util.List; + class AppStartupTimerTest { @RegisterExtension final OpenTelemetryExtension otelTesting = OpenTelemetryExtension.create(); private Tracer tracer;