Made the tests better
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
package org.springframework.cloud.sleuth.brave.instrument.redis;
|
||||
|
||||
import brave.sampler.Sampler;
|
||||
import io.lettuce.core.tracing.BraveTracing;
|
||||
import io.lettuce.core.tracing.Tracing;
|
||||
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.cloud.sleuth.brave.BraveTestSpanHandler;
|
||||
@@ -30,6 +32,11 @@ import org.springframework.test.context.ContextConfiguration;
|
||||
public class BraveLettuceIntegrationTests
|
||||
extends org.springframework.cloud.sleuth.instrument.redis.LettuceIntegrationTests {
|
||||
|
||||
@Override
|
||||
protected Class<? extends Tracing> tracing() {
|
||||
return BraveTracing.class;
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
static class Config {
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package org.springframework.cloud.sleuth.instrument.redis;
|
||||
|
||||
import io.lettuce.core.resource.ClientResources;
|
||||
import io.lettuce.core.tracing.BraveTracing;
|
||||
import io.lettuce.core.tracing.Tracing;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -42,15 +42,18 @@ public abstract class LettuceIntegrationTests {
|
||||
TraceLettuceClientResourcesBuilderCustomizer customizer;
|
||||
|
||||
@Autowired
|
||||
BraveTracing braveTracing;
|
||||
Tracing tracing;
|
||||
|
||||
@Test
|
||||
void tracing_should_be_set() {
|
||||
then(this.clientResources).isNull();
|
||||
then(this.customizer).isNotNull();
|
||||
then(this.braveTracing.isEnabled()).isTrue();
|
||||
then(this.tracing.isEnabled()).isTrue();
|
||||
then(this.tracing).isInstanceOf(tracing());
|
||||
}
|
||||
|
||||
protected abstract Class<? extends Tracing> tracing();
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableAutoConfiguration
|
||||
protected static class TestConfig {
|
||||
|
||||
Reference in New Issue
Block a user