Skip to content

Commit edcda98

Browse files
authored
chore(dependencies) - Update jackson dependencies (#409)
1 parent aa1b211 commit edcda98

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

.github/workflows/pr-ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
AWS_REGION: us-east-1
1515
strategy:
1616
matrix:
17-
python: [3.6, 3.7, 3.8]
17+
python: [3.7, 3.8, 3.9]
1818
java: [8, 11]
1919
runs-on: ubuntu-latest
2020
steps:

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<awssdk.version>2.15.19</awssdk.version>
4141
<checkstyle.version>8.36.2</checkstyle.version>
4242
<commons-io.version>2.8.0</commons-io.version>
43-
<jackson.version>2.11.4</jackson.version>
43+
<jackson.version>2.14.1</jackson.version>
4444
<maven-checkstyle-plugin.version>3.1.1</maven-checkstyle-plugin.version>
4545
<mockito.version>3.6.0</mockito.version>
4646
<spotbugs.version>4.1.4</spotbugs.version>

src/main/java/software/amazon/cloudformation/resource/Serializer.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import com.fasterxml.jackson.databind.MapperFeature;
2323
import com.fasterxml.jackson.databind.ObjectMapper;
2424
import com.fasterxml.jackson.databind.SerializationFeature;
25+
import com.fasterxml.jackson.databind.json.JsonMapper;
2526
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
2627
import java.io.ByteArrayInputStream;
2728
import java.io.ByteArrayOutputStream;
@@ -51,10 +52,9 @@ public class Serializer {
5152
* @param objectMapper ObjectMapper instance to configure
5253
*/
5354
static {
54-
STRICT_OBJECT_MAPPER = new ObjectMapper();
55-
STRICT_OBJECT_MAPPER.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, true);
56-
STRICT_OBJECT_MAPPER.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true);
57-
STRICT_OBJECT_MAPPER.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true);
55+
STRICT_OBJECT_MAPPER = JsonMapper.builder().configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, true)
56+
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true)
57+
.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true).build();
5858
STRICT_OBJECT_MAPPER.setSerializationInclusion(JsonInclude.Include.NON_ABSENT);
5959
STRICT_OBJECT_MAPPER.setSerializationInclusion(JsonInclude.Include.NON_DEFAULT);
6060
STRICT_OBJECT_MAPPER.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);
@@ -73,10 +73,9 @@ public class Serializer {
7373
* @param objectMapper ObjectMapper instance to configure
7474
*/
7575
static {
76-
OBJECT_MAPPER = new ObjectMapper();
77-
OBJECT_MAPPER.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, true);
78-
OBJECT_MAPPER.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
79-
OBJECT_MAPPER.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true);
76+
OBJECT_MAPPER = JsonMapper.builder().configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, true)
77+
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
78+
.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true).build();
8079
OBJECT_MAPPER.setSerializationInclusion(JsonInclude.Include.NON_ABSENT);
8180
OBJECT_MAPPER.setSerializationInclusion(JsonInclude.Include.NON_DEFAULT);
8281
OBJECT_MAPPER.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);

src/test/java/software/amazon/cloudformation/proxy/StdCallackContextTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
import static org.assertj.core.api.AssertionsForClassTypes.*;
1818
import static org.junit.jupiter.api.Assertions.*;
19-
import com.fasterxml.jackson.core.JsonGenerationException;
2019
import com.fasterxml.jackson.core.JsonParseException;
2120
import com.fasterxml.jackson.core.type.TypeReference;
2221
import com.fasterxml.jackson.databind.JsonMappingException;
@@ -175,7 +174,7 @@ public void testListOfMixed() throws Exception {
175174

176175
@Test
177176
public void testIncorrectMapType() {
178-
assertThrows(JsonGenerationException.class, () -> {
177+
assertThrows(JsonMappingException.class, () -> {
179178
LinkedHashMap<String, Object> callGraphs = new LinkedHashMap<>();
180179
Map<Integer, String> wrong = new HashMap<>();
181180
wrong.put(1, "");

0 commit comments

Comments
 (0)