Improve test error report (#11664)

This commit is contained in:
Jean Bisutti 2024-06-25 08:46:54 +02:00 committed by GitHub
parent 866e8e8817
commit ec02fb5c97
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -26,6 +26,7 @@ import io.opentelemetry.semconv.incubating.CodeIncubatingAttributes;
import io.opentelemetry.semconv.incubating.DbIncubatingAttributes;
import io.opentelemetry.semconv.incubating.ServiceIncubatingAttributes;
import java.util.Collections;
import java.util.List;
import org.assertj.core.api.AbstractCharSequenceAssert;
import org.assertj.core.api.AbstractIterableAssert;
import org.junit.jupiter.api.MethodOrderer;
@ -165,7 +166,9 @@ class AbstractOtelSpringStarterSmokeTest extends AbstractSpringStarterSmokeTest
AbstractIterableAssert::isNotEmpty);
// Log
LogRecordData firstLog = testing.getExportedLogRecords().get(0);
List<LogRecordData> exportedLogRecords = testing.getExportedLogRecords();
assertThat(exportedLogRecords).as("No log record exported.").isNotEmpty();
LogRecordData firstLog = exportedLogRecords.get(0);
assertThat(firstLog.getBody().asString())
.as("Should instrument logs")
.startsWith("Starting ")