1
2
3
4
5
6
7
8
9
10
11
12
13
14 package ch.qos.logback.classic.pattern;
15
16 import ch.qos.logback.classic.spi.LoggingEvent;
17 import org.junit.jupiter.api.Test;
18
19 import java.time.Instant;
20
21 import static org.junit.jupiter.api.Assertions.assertEquals;
22
23 public class MicrosecondConverterTest {
24
25 MicrosecondConverter mc = new MicrosecondConverter();
26 public long timeStamp;
27 public int nanoseconds;
28
29 @Test
30 public void smoke() {
31 LoggingEvent le = new LoggingEvent();
32 Instant instant = Instant.parse("2011-12-03T10:15:30Z");
33 instant = instant.plusNanos(123_456_789);
34 le.setInstant(instant);
35
36 String result = mc.convert(le);
37 assertEquals("456", result);
38 }
39
40 }