Skip to content

Commit 197c468

Browse files
committed
minor test cleanup
1 parent c33ae98 commit 197c468

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/test-jdk14/java/com/fasterxml/jackson/databind/RecordTest.java

+10-11
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22

33
import com.fasterxml.jackson.annotation.JsonIgnore;
44
import com.fasterxml.jackson.annotation.JsonProperty;
5-
import com.fasterxml.jackson.core.JsonProcessingException;
5+
66
import com.fasterxml.jackson.databind.json.JsonMapper;
77
import com.fasterxml.jackson.databind.util.ClassUtil;
88

9-
import java.io.IOException;
109
import java.util.Collections;
1110
import java.util.LinkedHashMap;
1211
import java.util.Map;
@@ -65,20 +64,20 @@ public void testRecordJavaType() {
6564
/**********************************************************************
6665
*/
6766

68-
public void testSerializeSimpleRecord() throws JsonProcessingException {
67+
public void testSerializeSimpleRecord() throws Exception {
6968
SimpleRecord record = new SimpleRecord(123, "Bob");
7069

7170
String json = MAPPER.writeValueAsString(record);
7271
final Object EXP = map("id", Integer.valueOf(123), "name", "Bob");
7372
assertEquals(EXP, MAPPER.readValue(json, Object.class));
7473
}
7574

76-
public void testDeserializeSimpleRecord() throws IOException {
75+
public void testDeserializeSimpleRecord() throws Exception {
7776
SimpleRecord value = MAPPER.readValue("{\"id\":123,\"name\":\"Bob\"}", SimpleRecord.class);
7877
assertEquals(new SimpleRecord(123, "Bob"), value);
7978
}
8079

81-
public void testSerializeRecordOfRecord() throws JsonProcessingException {
80+
public void testSerializeRecordOfRecord() throws Exception {
8281
RecordOfRecord record = new RecordOfRecord(new SimpleRecord(123, "Bob"));
8382
String json = MAPPER.writeValueAsString(record);
8483
final Object EXP = Collections.singletonMap("record",
@@ -92,7 +91,7 @@ public void testSerializeRecordOfRecord() throws JsonProcessingException {
9291
/**********************************************************************
9392
*/
9493

95-
public void testSerializeSimpleRecord_DisableAnnotationIntrospector() throws JsonProcessingException {
94+
public void testSerializeSimpleRecord_DisableAnnotationIntrospector() throws Exception {
9695
SimpleRecord record = new SimpleRecord(123, "Bob");
9796

9897
JsonMapper mapper = JsonMapper.builder()
@@ -103,7 +102,7 @@ public void testSerializeSimpleRecord_DisableAnnotationIntrospector() throws Jso
103102
assertEquals("{\"id\":123,\"name\":\"Bob\"}", json);
104103
}
105104

106-
public void testDeserializeSimpleRecord_DisableAnnotationIntrospector() throws IOException {
105+
public void testDeserializeSimpleRecord_DisableAnnotationIntrospector() throws Exception {
107106
JsonMapper mapper = JsonMapper.builder()
108107
.configure(MapperFeature.USE_ANNOTATIONS, false)
109108
.build();
@@ -118,29 +117,29 @@ public void testDeserializeSimpleRecord_DisableAnnotationIntrospector() throws I
118117
/**********************************************************************
119118
*/
120119

121-
public void testSerializeJsonIgnoreRecord() throws JsonProcessingException {
120+
public void testSerializeJsonIgnoreRecord() throws Exception {
122121
JsonIgnoreRecord record = new JsonIgnoreRecord(123, "Bob");
123122

124123
String json = MAPPER.writeValueAsString(record);
125124

126125
assertEquals("{\"id\":123}", json);
127126
}
128127

129-
public void testDeserializeRecordWithConstructor() throws IOException {
128+
public void testDeserializeRecordWithConstructor() throws Exception {
130129
RecordWithConstructor value = MAPPER.readValue("{\"id\":123,\"name\":\"Bob\"}",
131130
RecordWithConstructor.class);
132131
assertEquals(new RecordWithConstructor(123, "Bob"), value);
133132
}
134133

135-
public void testSerializeJsonRenameRecord() throws JsonProcessingException {
134+
public void testSerializeJsonRenameRecord() throws Exception {
136135
JsonPropertyRenameRecord record = new JsonPropertyRenameRecord(123, "Bob");
137136

138137
String json = MAPPER.writeValueAsString(record);
139138
final Object EXP = map("id", Integer.valueOf(123), "rename", "Bob");
140139
assertEquals(EXP, MAPPER.readValue(json, Object.class));
141140
}
142141

143-
public void testDeserializeJsonRenameRecord() throws IOException {
142+
public void testDeserializeJsonRenameRecord() throws Exception {
144143
JsonPropertyRenameRecord value = MAPPER.readValue("{\"id\":123,\"rename\":\"Bob\"}",
145144
JsonPropertyRenameRecord.class);
146145
assertEquals(new JsonPropertyRenameRecord(123, "Bob"), value);

0 commit comments

Comments
 (0)