Improve test error report (#11664)
This commit is contained in:
parent
866e8e8817
commit
ec02fb5c97
|
@ -26,6 +26,7 @@ import io.opentelemetry.semconv.incubating.CodeIncubatingAttributes;
|
||||||
import io.opentelemetry.semconv.incubating.DbIncubatingAttributes;
|
import io.opentelemetry.semconv.incubating.DbIncubatingAttributes;
|
||||||
import io.opentelemetry.semconv.incubating.ServiceIncubatingAttributes;
|
import io.opentelemetry.semconv.incubating.ServiceIncubatingAttributes;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
import org.assertj.core.api.AbstractCharSequenceAssert;
|
import org.assertj.core.api.AbstractCharSequenceAssert;
|
||||||
import org.assertj.core.api.AbstractIterableAssert;
|
import org.assertj.core.api.AbstractIterableAssert;
|
||||||
import org.junit.jupiter.api.MethodOrderer;
|
import org.junit.jupiter.api.MethodOrderer;
|
||||||
|
@ -165,7 +166,9 @@ class AbstractOtelSpringStarterSmokeTest extends AbstractSpringStarterSmokeTest
|
||||||
AbstractIterableAssert::isNotEmpty);
|
AbstractIterableAssert::isNotEmpty);
|
||||||
|
|
||||||
// Log
|
// 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())
|
assertThat(firstLog.getBody().asString())
|
||||||
.as("Should instrument logs")
|
.as("Should instrument logs")
|
||||||
.startsWith("Starting ")
|
.startsWith("Starting ")
|
||||||
|
|
Loading…
Reference in New Issue