Skip to content

Commit dffdc51

Browse files
committed
debug: add test name to log
1 parent 9bee828 commit dffdc51

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/test/java/io/weaviate/client6/v1/api/collections/batch/BatchContextTest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
import org.assertj.core.api.Assertions;
2121
import org.junit.After;
2222
import org.junit.Before;
23+
import org.junit.Rule;
2324
import org.junit.Test;
25+
import org.junit.rules.TestName;
2426
import org.slf4j.Logger;
2527
import org.slf4j.LoggerFactory;
2628

@@ -34,6 +36,9 @@
3436
public class BatchContextTest {
3537
private static final Logger log = LoggerFactory.getLogger(BatchContextTest.class);
3638

39+
@Rule
40+
public TestName currentTest = new TestName();
41+
3742
private static final CollectionDescriptor<Map<String, Object>> DESCRIPTOR = CollectionDescriptor
3843
.ofMap("BatchContextTest");
3944
private static final CollectionHandleDefaults DEFAULTS = new CollectionHandleDefaults(
@@ -101,7 +106,7 @@ private StreamObserver<Message> createStream(StreamObserver<Event> recv) {
101106
*/
102107
@Before
103108
public void startContext() throws InterruptedException {
104-
log.debug("===================startContext==================");
109+
log.atDebug().addKeyValue("test", currentTest.getMethodName()).log("===================startContext==================");
105110

106111
assert !Thread.currentThread().isInterrupted() : "main thread interrupted";
107112
assert REQUEST_QUEUE.isEmpty() : "stream contains incoming message " + REQUEST_QUEUE.peek();

0 commit comments

Comments
 (0)