Skip to content

Commit 116daaa

Browse files
committed
Fix test relying on injection of Constants class
1 parent 87f7d42 commit 116daaa

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

testing-common/integration-tests/src/test/groovy/AgentInstrumentationSpecificationTest.groovy

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,19 @@ import java.util.concurrent.TimeoutException
1717
class AgentInstrumentationSpecificationTest extends AgentInstrumentationSpecification {
1818
private static final ClassLoader BOOTSTRAP_CLASSLOADER = null
1919

20+
/**
21+
* Copy of Constants#BOOTSTRAP_PACKAGE_PREFIXES because the Constants class
22+
* is not accessible from here
23+
*/
24+
public static final List<String> BOOTSTRAP_PACKAGE_PREFIXES =
25+
Arrays.asList("io.opentelemetry.javaagent.bootstrap", "io.opentelemetry.javaagent.shaded")
26+
2027
def "classpath setup"() {
2128
setup:
2229
final List<String> bootstrapClassesIncorrectlyLoaded = []
2330
for (ClassPath.ClassInfo info : getTestClasspath().getAllClasses()) {
24-
for (int i = 0; i < Constants.BOOTSTRAP_PACKAGE_PREFIXES.size(); ++i) {
25-
if (info.getName().startsWith(Constants.BOOTSTRAP_PACKAGE_PREFIXES[i])) {
31+
for (int i = 0; i < BOOTSTRAP_PACKAGE_PREFIXES.size(); ++i) {
32+
if (info.getName().startsWith(BOOTSTRAP_PACKAGE_PREFIXES[i])) {
2633
Class<?> bootstrapClass = Class.forName(info.getName())
2734
def loader
2835
try {

0 commit comments

Comments
 (0)