Skip to content

Commit

Permalink
uf
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamv108 committed Apr 8, 2024
1 parent 90cd6c2 commit 8770716
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ public String get(String key) {

@Override
public String apiKey() {
return MicrometerConfiguration.this.newRelicApiKey; // for production
// purposes take it
// from config file
return MicrometerConfiguration.this.newRelicApiKey;
}

@Override
Expand All @@ -56,14 +54,7 @@ public Duration step() {

@Override
public String serviceName() {
return MicrometerConfiguration.this.serviceName + "." + MicrometerConfiguration.this.serviceModule; // for
// production
// purposes
// take
// it
// from
// config
// file
return MicrometerConfiguration.this.serviceName + "." + MicrometerConfiguration.this.serviceModule;
}

};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
import code.shubham.test.AbstractSpringBootTest;
import org.junit.jupiter.api.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.TestPropertySource;

import static org.junit.jupiter.api.Assertions.*;

@TestPropertySource(properties = "newrelic.config.agent_enabled=false")
class CountryTest extends AbstractSpringBootTest {

@Autowired
Expand Down
4 changes: 3 additions & 1 deletion src/test/java/code/shubham/test/AbstractSpringBootTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
import code.shubham.commons.kafka.KafkaPublisher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.TestPropertySource;

import java.util.Arrays;
import java.util.Set;

@SpringBootTest(classes = TemplateServiceJavaSpringBootApplication.class)
@SpringBootTest(classes = TemplateServiceJavaSpringBootApplication.class,
properties = { "newrelic.config.agent_enabled", "false", "NEWRELIC_API_KEY", "TEST_KEY" })
public abstract class AbstractSpringBootTest extends AbstractTest {

protected TestKafkaConsumer kafkaConsumer;
Expand Down

0 comments on commit 8770716

Please sign in to comment.