Polishing
This commit is contained in:
@@ -27,13 +27,13 @@ import jakarta.jms.MessageConsumer;
|
||||
import jakarta.jms.Session;
|
||||
import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
|
||||
import org.apache.activemq.artemis.junit.EmbeddedActiveMQExtension;
|
||||
import org.assertj.core.api.Assertions;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||
|
||||
import static io.micrometer.observation.tck.TestObservationRegistryAssert.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* Tests for Observability related {@link JmsTemplate}.
|
||||
@@ -127,7 +127,7 @@ class JmsTemplateObservationTests {
|
||||
});
|
||||
|
||||
String responseBody = response.getBody(String.class);
|
||||
Assertions.assertThat(responseBody).isEqualTo("response content");
|
||||
assertThat(responseBody).isEqualTo("response content");
|
||||
|
||||
assertThat(registry).hasNumberOfObservationsWithNameEqualTo("jms.message.publish", 2);
|
||||
assertThat(registry).hasObservationWithNameEqualTo("jms.message.process").that()
|
||||
|
||||
@@ -26,7 +26,6 @@ import io.micrometer.observation.tck.TestObservationRegistry;
|
||||
import jakarta.jms.MessageListener;
|
||||
import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
|
||||
import org.apache.activemq.artemis.junit.EmbeddedActiveMQExtension;
|
||||
import org.assertj.core.api.Assertions;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||
@@ -37,6 +36,7 @@ import org.junit.jupiter.params.provider.MethodSource;
|
||||
import org.springframework.jms.core.JmsTemplate;
|
||||
|
||||
import static io.micrometer.observation.tck.TestObservationRegistryAssert.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.junit.jupiter.api.Named.named;
|
||||
import static org.junit.jupiter.params.provider.Arguments.arguments;
|
||||
|
||||
@@ -101,7 +101,7 @@ class MessageListenerContainerObservationTests {
|
||||
JmsTemplate jmsTemplate = new JmsTemplate(connectionFactory);
|
||||
jmsTemplate.convertAndSend("spring.test.observation", "message content");
|
||||
latch.await(2, TimeUnit.SECONDS);
|
||||
Assertions.assertThat(observationInErrorHandler.get()).isNotNull();
|
||||
assertThat(observationInErrorHandler.get()).isNotNull();
|
||||
assertThat(registry).hasObservationWithNameEqualTo("jms.message.process")
|
||||
.that()
|
||||
.hasHighCardinalityKeyValue("messaging.destination.name", "spring.test.observation")
|
||||
|
||||
Reference in New Issue
Block a user