Skip to content

Commit 635acee

Browse files
committed
Update to avaje-json-core 3.0
1 parent cb0f668 commit 635acee

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/test/java/io/avaje/logback/encoder/JsonEncoderTest.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import ch.qos.logback.classic.spi.ILoggingEvent;
44
import ch.qos.logback.classic.spi.LoggingEvent;
5-
import io.avaje.json.simple.SimpleMapper;
5+
import io.avaje.json.mapper.JsonMapper;
66
import io.avaje.logback.encoder.abbreviator.TrimPackageAbbreviator;
77
import org.junit.jupiter.api.Test;
88
import ch.qos.logback.classic.Logger;
@@ -34,8 +34,8 @@ void encode() {
3434
encoder.start();
3535
byte[] bytes = encoder.encode(event);
3636

37-
SimpleMapper simpleMapper = SimpleMapper.builder().build();
38-
Map<String, Object> asMap = simpleMapper.map().fromJson(bytes);
37+
JsonMapper mapper = JsonMapper.builder().build();
38+
Map<String, Object> asMap = mapper.map().fromJson(bytes);
3939

4040
assertThat((String)asMap.get("component")).isNull();
4141
assertThat((String)asMap.get("env")).isNull();
@@ -55,8 +55,8 @@ void encode_component() {
5555

5656
byte[] bytes = encoder.encode(createLogEvent());
5757

58-
SimpleMapper simpleMapper = SimpleMapper.builder().build();
59-
Map<String, Object> asMap = simpleMapper.map().fromJson(bytes);
58+
JsonMapper mapper = JsonMapper.builder().build();
59+
Map<String, Object> asMap = mapper.map().fromJson(bytes);
6060

6161
assertThat((String)asMap.get("component")).isEqualTo("my-component");
6262
assertThat((String)asMap.get("env")).isEqualTo("dev");
@@ -75,7 +75,7 @@ void customFieldsEval() {
7575
encoder.start();
7676

7777
byte[] bytes = encoder.encode(createLogEvent(createThrowable()));
78-
SimpleMapper simpleMapper = SimpleMapper.builder().build();
78+
JsonMapper simpleMapper = JsonMapper.builder().build();
7979
Map<String, Object> asMap = simpleMapper.map().fromJson(bytes);
8080

8181
assertThat((String)asMap.get("my-custom")).isEqualTo("Hi!");
@@ -89,7 +89,7 @@ void throwable_usingDefault() {
8989
encoder.start();
9090

9191
byte[] bytes = encoder.encode(createLogEvent(createThrowable()));
92-
SimpleMapper simpleMapper = SimpleMapper.builder().build();
92+
JsonMapper simpleMapper = JsonMapper.builder().build();
9393
Map<String, Object> asMap = simpleMapper.map().fromJson(bytes);
9494

9595
assertThat((String)asMap.get("stacktrace")).startsWith("java.lang.NullPointerException: ");
@@ -110,7 +110,7 @@ void throwable_usingConverter() {
110110
encoder.start();
111111

112112
byte[] bytes = encoder.encode(createLogEvent(createThrowable()));
113-
SimpleMapper simpleMapper = SimpleMapper.builder().build();
113+
JsonMapper simpleMapper = JsonMapper.builder().build();
114114
Map<String, Object> asMap = simpleMapper.map().fromJson(bytes);
115115

116116
assertThat((String)asMap.get("stacktrace")).startsWith("j.l.NullPointerException: ");
@@ -132,7 +132,7 @@ void throwable_usingConverter_includeStackHash() {
132132
encoder.start();
133133

134134
byte[] bytes = encoder.encode(createLogEvent(createThrowable()));
135-
SimpleMapper simpleMapper = SimpleMapper.builder().build();
135+
JsonMapper simpleMapper = JsonMapper.builder().build();
136136
Map<String, Object> asMap = simpleMapper.map().fromJson(bytes);
137137

138138
assertThat((String)asMap.get("stacktrace")).startsWith("j.l.NullPointerException: ");

0 commit comments

Comments
 (0)