Skip to content

Commit

Permalink
Convert lettuce 5.1 SyncClientTest from groovy to java (#9697)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaydeluca authored Nov 9, 2023
1 parent ff97f6c commit 976ca64
Show file tree
Hide file tree
Showing 10 changed files with 647 additions and 559 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/

package io.opentelemetry.javaagent.instrumentation.lettuce.v5_1;

import io.lettuce.core.RedisClient;
import io.opentelemetry.instrumentation.lettuce.v5_1.AbstractLettuceSyncClientTest;
import io.opentelemetry.instrumentation.testing.junit.AgentInstrumentationExtension;
import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension;
import org.junit.jupiter.api.extension.RegisterExtension;

class LettuceSyncClientTest extends AbstractLettuceSyncClientTest {
@RegisterExtension
static final InstrumentationExtension testing = AgentInstrumentationExtension.create();

@Override
public InstrumentationExtension getInstrumentationExtension() {
return testing;
}

@Override
protected RedisClient createClient(String uri) {
return RedisClient.create(uri);
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/

package io.opentelemetry.instrumentation.lettuce.v5_1;

import io.lettuce.core.RedisClient;
import io.lettuce.core.resource.ClientResources;
import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension;
import io.opentelemetry.instrumentation.testing.junit.LibraryInstrumentationExtension;
import org.junit.jupiter.api.extension.RegisterExtension;

class LettuceSyncClientTest extends AbstractLettuceSyncClientTest {
@RegisterExtension
static final InstrumentationExtension testing = LibraryInstrumentationExtension.create();

@Override
public InstrumentationExtension getInstrumentationExtension() {
return testing;
}

@Override
protected RedisClient createClient(String uri) {
return RedisClient.create(
ClientResources.builder()
.tracing(
LettuceTelemetry.create(getInstrumentationExtension().getOpenTelemetry())
.newTracing())
.build(),
uri);
}
}
3 changes: 2 additions & 1 deletion instrumentation/lettuce/lettuce-5.1/testing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ plugins {
dependencies {
api(project(":testing-common"))

api("io.lettuce:lettuce-core:5.1.0.RELEASE")
// 6.0+ added protocolVersion access which allows forcing RESP2 for consistency in tests
compileOnly("io.lettuce:lettuce-core:6.0.0.RELEASE")

implementation("org.testcontainers:testcontainers")
implementation("com.google.guava:guava")
Expand Down
Loading

0 comments on commit 976ca64

Please sign in to comment.