Skip to content

move spring-jms-2.0 tests to java#11195

Merged
laurit merged 6 commits into
open-telemetry:mainfrom
aschugunov:spring-jms-2.0-tests-to-java
Apr 29, 2024
Merged

move spring-jms-2.0 tests to java#11195
laurit merged 6 commits into
open-telemetry:mainfrom
aschugunov:spring-jms-2.0-tests-to-java

Conversation

@aschugunov

Copy link
Copy Markdown
Contributor

No description provided.

@aschugunov aschugunov requested a review from a team April 21, 2024 05:00
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.jms.core.JmsTemplate;

public class SpringListenerTest {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public class SpringListenerTest {
class SpringListenerTest {

AtomicReference<SpanData> producerSpan = new AtomicReference<>();
testing.waitAndAssertSortedTraces(
orderByRootSpanKind(PRODUCER, CONSUMER),
trace -> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and other places in this PR, you can extract a public method, and then simplify the code together with the following verification logic. Can refer to

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that in the original groovy test the assertions were copied from some other test file. If needed you can move the assertions for produce/receive/process spans to helper methods and share these assertions between tests (if that makes sense), see https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/instrumentation/spring/spring-kafka-2.7/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/spring/kafka/v2_7/SpringKafkaTest.java for ideas.

@aschugunov aschugunov force-pushed the spring-jms-2.0-tests-to-java branch from 237304c to c5f791c Compare April 24, 2024 08:17
import org.springframework.jms.config.DefaultJmsListenerContainerFactory;
import org.springframework.jms.config.JmsListenerContainerFactory;

class AbstractConfig {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class AbstractConfig {
abstract class AbstractConfig {

@laurit laurit merged commit acef37c into open-telemetry:main Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants