use of org.hypertrace.core.datamodel.Event in project hypertrace-ingester by hypertrace.
the class EnrichedSpanUtilsTest method testGetBackendDestination_empty.
@Test
public void testGetBackendDestination_empty() {
Event e = mock(Event.class);
String backend_destination = EnrichedSpanUtils.getBackendDestination(e);
assertNull(backend_destination);
}
use of org.hypertrace.core.datamodel.Event in project hypertrace-ingester by hypertrace.
the class EnrichedSpanUtilsTest method testGetSpaceIds_empty.
@Test
public void testGetSpaceIds_empty() {
Event e = mock(Event.class);
List<String> spaceIds = EnrichedSpanUtils.getSpaceIds(e);
assertEquals(emptyList(), spaceIds);
}
use of org.hypertrace.core.datamodel.Event in project hypertrace-ingester by hypertrace.
the class EnrichedSpanUtilsTest method testGetEnrichedAttributesForPrefixAttributeKey.
@Test
public void testGetEnrichedAttributesForPrefixAttributeKey() {
Event event = createMockEventWithEnrichedAttribute("prefix.hello", "world");
Map<String, AttributeValue> filteredMap = SpanAttributeUtils.getAttributesWithPrefixKey(event, "prefix");
assertEquals("world", filteredMap.get("prefix.hello").getValue());
}
use of org.hypertrace.core.datamodel.Event in project hypertrace-ingester by hypertrace.
the class EnrichedSpanUtilsTest method createMockEventWithNoAttributes.
private Event createMockEventWithNoAttributes() {
Event e = mock(Event.class);
when(e.getAttributes()).thenReturn(null);
when(e.getEnrichedAttributes()).thenReturn(null);
return e;
}
use of org.hypertrace.core.datamodel.Event in project hypertrace-ingester by hypertrace.
the class EnrichedSpanUtilsTest method getRequestSize_httpProtocol_noSize.
@Test
public void getRequestSize_httpProtocol_noSize() {
Event e = createMockEventWithEnrichedAttribute("PROTOCOL", "HTTP");
when(e.getAttributes()).thenReturn(Attributes.newBuilder().setAttributeMap(new HashMap<>()).build());
Optional<Integer> requestSize = EnrichedSpanUtils.getRequestSize(e);
assertTrue(requestSize.isEmpty());
}
Aggregations