use of org.hypertrace.semantic.convention.utils.SemanticConventionTestUtil.buildAttributes in project hypertrace-ingester by hypertrace.
the class MessagingSemanticConventionUtilsTest method testGetRabbitmqOperation.
@Test
public void testGetRabbitmqOperation() {
Event e = mock(Event.class);
Attributes attributes = SemanticConventionTestUtil.buildAttributes(Map.of(OtelMessagingSemanticConventions.MESSAGING_OPERATION.getValue(), SemanticConventionTestUtil.buildAttributeValue("publish")));
when(e.getAttributes()).thenReturn(attributes);
Optional<String> v = MessagingSemanticConventionUtils.getMessagingOperation(e);
assertEquals("publish", v.get());
}
use of org.hypertrace.semantic.convention.utils.SemanticConventionTestUtil.buildAttributes in project hypertrace-ingester by hypertrace.
the class MessagingSemanticConventionUtilsTest method testGetKafkaDestination.
@Test
public void testGetKafkaDestination() {
Event e = mock(Event.class);
Attributes attributes = SemanticConventionTestUtil.buildAttributes(Map.of(OtelMessagingSemanticConventions.MESSAGING_DESTINATION.getValue(), SemanticConventionTestUtil.buildAttributeValue("queueName"), OtelMessagingSemanticConventions.MESSAGING_KAFKA_CONSUMER_GROUP.getValue(), SemanticConventionTestUtil.buildAttributeValue("test")));
when(e.getAttributes()).thenReturn(attributes);
Optional<String> v = MessagingSemanticConventionUtils.getMessagingDestinationForKafka(e);
assertEquals("test.queueName", v.get());
}
use of org.hypertrace.semantic.convention.utils.SemanticConventionTestUtil.buildAttributes in project hypertrace-ingester by hypertrace.
the class MessagingSemanticConventionUtilsTest method testGetRabbitmqDestination.
@Test
public void testGetRabbitmqDestination() {
Event e = mock(Event.class);
Attributes attributes = SemanticConventionTestUtil.buildAttributes(Map.of(OtelMessagingSemanticConventions.MESSAGING_DESTINATION.getValue(), SemanticConventionTestUtil.buildAttributeValue("queueName"), OtelMessagingSemanticConventions.RABBITMQ_ROUTING_KEY.getValue(), SemanticConventionTestUtil.buildAttributeValue("test-key")));
when(e.getAttributes()).thenReturn(attributes);
Optional<String> v = MessagingSemanticConventionUtils.getMessagingDestinationForRabbitmq(e);
assertEquals("test-key.queueName", v.get());
}
use of org.hypertrace.semantic.convention.utils.SemanticConventionTestUtil.buildAttributes in project hypertrace-ingester by hypertrace.
the class MessagingSemanticConventionUtilsTest method testGetSqsOperation.
@Test
public void testGetSqsOperation() {
Event e = mock(Event.class);
Attributes attributes = SemanticConventionTestUtil.buildAttributes(Map.of(OtelMessagingSemanticConventions.MESSAGING_OPERATION.getValue(), SemanticConventionTestUtil.buildAttributeValue("publish")));
when(e.getAttributes()).thenReturn(attributes);
Optional<String> v = MessagingSemanticConventionUtils.getMessagingOperation(e);
assertEquals("publish", v.get());
}
use of org.hypertrace.semantic.convention.utils.SemanticConventionTestUtil.buildAttributes in project hypertrace-ingester by hypertrace.
the class MessagingSemanticConventionUtilsTest method testGetSqsDestination.
@Test
public void testGetSqsDestination() {
Event e = mock(Event.class);
Attributes attributes = SemanticConventionTestUtil.buildAttributes(Map.of(OtelMessagingSemanticConventions.MESSAGING_DESTINATION.getValue(), SemanticConventionTestUtil.buildAttributeValue("queueName")));
when(e.getAttributes()).thenReturn(attributes);
Optional<String> v = MessagingSemanticConventionUtils.getMessagingDestination(e);
assertEquals("queueName", v.get());
}
Aggregations