assertNull(logEntry.getSpanId()); assertFalse(logEntry.getTraceSampled()); assertNull(logEntry.getSourceLocation()); logEntry = LogEntry.of(LOG_NAME, RESOURCE, STRING_PAYLOAD); assertEquals(STRING_PAYLOAD, logEntry.getPayload()); assertNull(logEntry.getSpanId()); assertFalse(logEntry.getTraceSampled()); assertNull(logEntry.getSourceLocation());
private void compareLogEntry(LogEntry expected, LogEntry value) { assertEquals(expected, value); assertEquals(expected.getLogName(), value.getLogName()); assertEquals(expected.getResource(), value.getResource()); assertEquals(expected.getTimestamp(), value.getTimestamp()); assertEquals(expected.getReceiveTimestamp(), value.getReceiveTimestamp()); assertEquals(expected.getSeverity(), value.getSeverity()); assertEquals(expected.getInsertId(), value.getInsertId()); assertEquals(expected.getHttpRequest(), value.getHttpRequest()); assertEquals(expected.getLabels(), value.getLabels()); assertEquals(expected.getOperation(), value.getOperation()); assertEquals(expected.getTrace(), value.getTrace()); assertEquals(expected.getSpanId(), value.getSpanId()); assertEquals(expected.getTraceSampled(), value.getTraceSampled()); assertEquals(expected.getSourceLocation(), value.getSourceLocation()); assertEquals(expected.getPayload(), value.getPayload()); assertEquals(expected.hashCode(), value.hashCode()); } }
assertEquals(SPAN_ID, STRING_ENTRY.getSpanId()); assertEquals(TRACE_SAMPLED, STRING_ENTRY.getTraceSampled()); assertEquals(SOURCE_LOCATION, STRING_ENTRY.getSourceLocation()); assertEquals(STRING_PAYLOAD, STRING_ENTRY.getPayload()); assertEquals(LOG_NAME, JSON_ENTRY.getLogName()); assertEquals(SPAN_ID, JSON_ENTRY.getSpanId()); assertEquals(TRACE_SAMPLED, JSON_ENTRY.getTraceSampled()); assertEquals(SOURCE_LOCATION, JSON_ENTRY.getSourceLocation()); assertEquals(JSON_PAYLOAD, JSON_ENTRY.getPayload()); assertEquals(LOG_NAME, PROTO_ENTRY.getLogName()); assertEquals(SPAN_ID, PROTO_ENTRY.getSpanId()); assertEquals(TRACE_SAMPLED, PROTO_ENTRY.getTraceSampled()); assertEquals(SOURCE_LOCATION, PROTO_ENTRY.getSourceLocation()); assertEquals(PROTO_PAYLOAD, PROTO_ENTRY.getPayload()); LogEntry logEntry = assertEquals(SPAN_ID, logEntry.getSpanId()); assertEquals(TRACE_SAMPLED, logEntry.getTraceSampled()); assertEquals(SOURCE_LOCATION, logEntry.getSourceLocation()); assertEquals(StringPayload.of("otherPayload"), logEntry.getPayload());
assertFalse(logEntry.getTraceSampled()); assertEquals( new SourceLocation.Builder().setFile("hey.java").build(), logEntry.getSourceLocation()); assertEquals(StringPayload.of("otherPayload"), logEntry.getPayload()); logEntry =