Skip to content

Commit

Permalink
Convert cdi-testing test from groovy to java (#11982)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaydeluca authored Aug 9, 2024
1 parent 067879b commit ea30409
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 30 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* SPDX-License-Identifier: Apache-2.0
*/

package io.opentelemetry.test.cdi;

public class TestBean {

private String someField;
Expand Down

0 comments on commit ea30409

Please sign in to comment.