Search in sources :

Example 1 with EntityCache

use of org.hypertrace.traceenricher.enrichment.enrichers.cache.EntityCache in project hypertrace-ingester by hypertrace.

the class BackendEntityEnricherTest method setup.

@BeforeEach
public void setup() {
    enricher = new BackendEntityEnricher();
    entityCache = new EntityCache(edsClient, Runnable::run);
    when(clientRegistry.getEdsCacheClient()).thenReturn(edsClient);
    when(clientRegistry.getEntityCache()).thenReturn(entityCache);
    enricher.init(getEntityServiceConfig(), clientRegistry);
}
Also used : EntityCache(org.hypertrace.traceenricher.enrichment.enrichers.cache.EntityCache) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with EntityCache

use of org.hypertrace.traceenricher.enrichment.enrichers.cache.EntityCache in project hypertrace-ingester by hypertrace.

the class DefaultServiceEntityEnricherTest method setup.

@BeforeEach
public void setup() {
    enricher = new DefaultServiceEntityEnricher();
    entityCache = new EntityCache(this.edsClient, Runnable::run);
    when(clientRegistry.getEdsCacheClient()).thenReturn(edsClient);
    when(clientRegistry.getEntityCache()).thenReturn(entityCache);
    enricher.init(getEntityServiceConfig(), clientRegistry);
}
Also used : EntityCache(org.hypertrace.traceenricher.enrichment.enrichers.cache.EntityCache) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 3 with EntityCache

use of org.hypertrace.traceenricher.enrichment.enrichers.cache.EntityCache in project hypertrace-ingester by hypertrace.

the class StructuredTracesEnrichmentTest method setup.

@BeforeEach
public void setup() {
    // Clear any stale entries in the entities cache.
    String configFilePath = Thread.currentThread().getContextClassLoader().getResource(ENRICHER_CONFIG_FILE_NAME).getPath();
    if (configFilePath == null) {
        throw new RuntimeException("Cannot find enricher config file" + ENRICHER_CONFIG_FILE_NAME + "in the classpath");
    }
    Config fileConfig = ConfigFactory.parseFile(new File(configFilePath));
    Config configs = ConfigFactory.load(fileConfig);
    // Not passing the Entity Data Service configuration, unless the container id
    // in the span data in inside EDS
    when(clientRegistry.getEdsCacheClient()).thenReturn(edsClient);
    entityCache = new EntityCache(edsClient, Runnable::run);
    when(clientRegistry.getEntityCache()).thenReturn(entityCache);
    enrichmentProcessor = createEnricherProcessor(configs);
    mockGetServiceEntityMethod();
}
Also used : EntityCache(org.hypertrace.traceenricher.enrichment.enrichers.cache.EntityCache) Config(com.typesafe.config.Config) File(java.io.File) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

EntityCache (org.hypertrace.traceenricher.enrichment.enrichers.cache.EntityCache)3 BeforeEach (org.junit.jupiter.api.BeforeEach)3 Config (com.typesafe.config.Config)1 File (java.io.File)1