Skip to content

Commit

Permalink
Fix build warnings (#621)
Browse files Browse the repository at this point in the history
* remove parens

* make mock server chill out a bit

* add missing proguard files

* test deprecation warnings

* gradle 9 incompat warning

* spotless

* add final
  • Loading branch information
breedx-splk authored Oct 3, 2024
1 parent ea575b3 commit 29da6ba
Show file tree
Hide file tree
Showing 16 changed files with 12 additions and 7 deletions.
Empty file added buildSrc/empty-rules.pro
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ dependencies {
testImplementation(libs.findLibrary("assertj-core").get())
testImplementation(libs.findBundle("mocking").get())
testImplementation(libs.findBundle("junit").get())
testRuntimeOnly(libs.findLibrary("junit-platform-launcher").get())
testImplementation(libs.findLibrary("opentelemetry-sdk-testing").get())
testImplementation(libs.findLibrary("androidx-junit").get())
coreLibraryDesugaring(libs.findLibrary("desugarJdkLibs").get())
Expand Down
Empty file added core/consumer-rules.pro
Empty file.
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ mockk = "io.mockk:mockk:1.13.12"
junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit" }
junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit" }
junit-vintage-engine = { module = "org.junit.vintage:junit-vintage-engine", version.ref = "junit" }
junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher", version = "1.11.1" }
robolectric = "org.robolectric:robolectric:4.13"
assertj-core = "org.assertj:assertj-core:3.26.3"
awaitility = "org.awaitility:awaitility:4.2.2"
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,10 @@ static void reportIdleConnectionsOlderThan(long timeInterval) {
}

private static class HttpURLConnectionInfo {
private final Context context;
private long lastSeenTime;
private boolean reported;
private boolean harvestable;
private Context context;

private HttpURLConnectionInfo(Context context) {
this.context = context;
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* any time.
*/
public final class OkHttp3Singletons {
private static final Interceptor NOOP_INTERCEPTOR = (chain -> chain.proceed(chain.request()));
private static final Interceptor NOOP_INTERCEPTOR = chain -> chain.proceed(chain.request());
public static Interceptor CONNECTION_ERROR_INTERCEPTOR = NOOP_INTERCEPTOR;
public static Interceptor TRACING_INTERCEPTOR = NOOP_INTERCEPTOR;

Expand Down
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import io.mockk.verify
import io.opentelemetry.android.common.RumConstants
import io.opentelemetry.api.common.AttributeKey.stringKey
import io.opentelemetry.api.common.Attributes
import io.opentelemetry.api.common.Value
import io.opentelemetry.sdk.OpenTelemetrySdk
import io.opentelemetry.sdk.logs.LogRecordProcessor
import io.opentelemetry.sdk.logs.ReadWriteLogRecord
import io.opentelemetry.sdk.logs.SdkLoggerProvider
import io.opentelemetry.sdk.logs.data.Body
import io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat
import io.opentelemetry.sdk.trace.export.SpanExporter
import org.junit.jupiter.api.Test
Expand Down Expand Up @@ -86,17 +86,17 @@ class SdkInitializationEventsTest {

class EventAssert(val timeNs: Long) : Consumer<ReadWriteLogRecord> {
lateinit var name: String
var body: Body? = null
var body: Value<*>? = null
var attrs: Attributes? = null

override fun accept(log: ReadWriteLogRecord) {
val logData = log.toLogRecordData()
assertThat(logData.timestampEpochNanos).isEqualTo(timeNs)
assertThat(logData.attributes.get(stringKey("event.name"))).isEqualTo(name)
if (body == null) {
assertThat(logData.body.type).isEqualTo(Body.Type.EMPTY)
assertThat(logData.bodyValue).isNull()
} else {
assertThat(logData.body.type).isNotEqualTo(Body.Type.EMPTY)
assertThat(logData.bodyValue).isNotNull()
}
if (attrs != null) {
assertThat(logData.attributes).isEqualTo(attrs)
Expand All @@ -108,7 +108,7 @@ class SdkInitializationEventsTest {
return this
}

fun withBody(body: Body): EventAssert {
fun withBody(body: Value<*>): EventAssert {
this.body = body
return this
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
Expand All @@ -61,6 +63,7 @@ public void setup() {
testQueue = TestRequestQueue.create(tracingHurlStack);
stuckTestHelper = StuckTestHelper.start();

Logger.getLogger(MockWebServer.class.getName()).setLevel(Level.WARNING);
// setup test server
server = new MockWebServer();
}
Expand Down

0 comments on commit 29da6ba

Please sign in to comment.