diff --git a/README.md b/README.md index b099d0545612..3abe2c6d7aab 100644 --- a/README.md +++ b/README.md @@ -154,7 +154,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md). Triagers ([@open-telemetry/java-instrumentation-triagers](https://github.com/orgs/open-telemetry/teams/java-instrumentation-triagers)): -- [Jay Deluca](https://github.com/jaydeluca) +- [Jay DeLuca](https://github.com/jaydeluca) - [Jonas Kunz](https://github.com/JonasKunz), Elastic - [Steve Rao](https://github.com/steverao), Alibaba - [Sylvain Juge](https://github.com/SylvainJuge), Elastic diff --git a/instrumentation/cdi-testing/src/test/groovy/CDIContainerTest.groovy b/instrumentation/cdi-testing/src/test/groovy/CDIContainerTest.groovy deleted file mode 100644 index 3a34b98a9d26..000000000000 --- a/instrumentation/cdi-testing/src/test/groovy/CDIContainerTest.groovy +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright The OpenTelemetry Authors - * SPDX-License-Identifier: Apache-2.0 - */ - -import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification -import org.jboss.weld.environment.se.Weld -import org.jboss.weld.environment.se.WeldContainer -import org.jboss.weld.environment.se.threading.RunnableDecorator - -class CDIContainerTest extends AgentInstrumentationSpecification { - - def "CDI container starts with agent"() { - given: - Weld builder = new Weld() - .disableDiscovery() - .addDecorator(RunnableDecorator) - .addBeanClass(TestBean) - - when: - WeldContainer container = builder.initialize() - - then: - container.isRunning() - - cleanup: - container?.shutdown() - } -} diff --git a/instrumentation/cdi-testing/src/test/java/io/opentelemetry/test/cdi/CdiContainerTest.java b/instrumentation/cdi-testing/src/test/java/io/opentelemetry/test/cdi/CdiContainerTest.java new file mode 100644 index 000000000000..6d6596745021 --- /dev/null +++ b/instrumentation/cdi-testing/src/test/java/io/opentelemetry/test/cdi/CdiContainerTest.java @@ -0,0 +1,36 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.test.cdi; + +import static org.assertj.core.api.Assertions.assertThat; + +import io.opentelemetry.instrumentation.testing.junit.AgentInstrumentationExtension; +import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension; +import org.jboss.weld.environment.se.Weld; +import org.jboss.weld.environment.se.WeldContainer; +import org.jboss.weld.environment.se.threading.RunnableDecorator; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; + +class CdiContainerTest { + @RegisterExtension + static final InstrumentationExtension testing = AgentInstrumentationExtension.create(); + + @Test + public void cdiContainerStartsWithAgent() { + Weld builder = + new Weld() + .disableDiscovery() + .addDecorator(RunnableDecorator.class) + .addBeanClass(TestBean.class); + WeldContainer container = builder.initialize(); + + assertThat(container.isRunning()).isTrue(); + if (container != null) { + container.shutdown(); + } + } +} diff --git a/instrumentation/cdi-testing/src/test/java/TestBean.java b/instrumentation/cdi-testing/src/test/java/io/opentelemetry/test/cdi/TestBean.java similarity index 88% rename from instrumentation/cdi-testing/src/test/java/TestBean.java rename to instrumentation/cdi-testing/src/test/java/io/opentelemetry/test/cdi/TestBean.java index d7fba0156045..31ef6736f14b 100644 --- a/instrumentation/cdi-testing/src/test/java/TestBean.java +++ b/instrumentation/cdi-testing/src/test/java/io/opentelemetry/test/cdi/TestBean.java @@ -3,6 +3,8 @@ * SPDX-License-Identifier: Apache-2.0 */ +package io.opentelemetry.test.cdi; + public class TestBean { private String someField;