Skip to content

Commit 6d72f54

Browse files
committed
Refactor JacksonAnnotationTest
1 parent b58cc8c commit 6d72f54

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

‎jackson/src/test/java/com/baeldung/jackson/test/JacksonAnnotationTest.java‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public void whenSerializingUsingJsonRootName_thenCorrect() throws JsonProcessing
8585
}
8686

8787
@Test
88-
public void whenSerializingUsingJsonValue_thenCorrect() throws IOException {
88+
public void whenSerializingUsingJsonValue_thenCorrect() throws JsonProcessingException {
8989
final String enumAsString = new ObjectMapper().writeValueAsString(TypeEnumWithValue.TYPE1);
9090

9191
assertThat(enumAsString, is("\"Type A\""));
@@ -153,7 +153,7 @@ public void whenDeserializingUsingJsonDeserialize_thenCorrect() throws IOExcepti
153153
// ========================= Inclusion annotations ============================
154154

155155
@Test
156-
public void whenSerializingUsingJsonIgnoreProperties_thenCorrect() throws IOException {
156+
public void whenSerializingUsingJsonIgnoreProperties_thenCorrect() throws JsonProcessingException {
157157
final BeanWithIgnore bean = new BeanWithIgnore(1, "My bean");
158158

159159
final String result = new ObjectMapper().writeValueAsString(bean);
@@ -162,7 +162,7 @@ public void whenSerializingUsingJsonIgnoreProperties_thenCorrect() throws IOExce
162162
}
163163

164164
@Test
165-
public void whenSerializingUsingJsonIgnore_thenCorrect() throws IOException {
165+
public void whenSerializingUsingJsonIgnore_thenCorrect() throws JsonProcessingException {
166166
final BeanWithIgnore bean = new BeanWithIgnore(1, "My bean");
167167

168168
final String result = new ObjectMapper().writeValueAsString(bean);
@@ -183,7 +183,7 @@ public void whenSerializingUsingJsonIgnoreType_thenCorrect() throws JsonProcessi
183183
}
184184

185185
@Test
186-
public void whenSerializingUsingJsonInclude_thenCorrect() throws IOException {
186+
public void whenSerializingUsingJsonInclude_thenCorrect() throws JsonProcessingException {
187187
final MyBean bean = new MyBean(1, null);
188188

189189
final String result = new ObjectMapper().writeValueAsString(bean);
@@ -192,7 +192,7 @@ public void whenSerializingUsingJsonInclude_thenCorrect() throws IOException {
192192
}
193193

194194
@Test
195-
public void whenSerializingUsingJsonAutoDetect_thenCorrect() throws IOException {
195+
public void whenSerializingUsingJsonAutoDetect_thenCorrect() throws JsonProcessingException {
196196
final PrivateBean bean = new PrivateBean(1, "My bean");
197197

198198
final String result = new ObjectMapper().writeValueAsString(bean);
@@ -203,7 +203,7 @@ public void whenSerializingUsingJsonAutoDetect_thenCorrect() throws IOException
203203
// ========================= Polymorphic annotations ============================
204204

205205
@Test
206-
public void whenSerializingPolymorphic_thenCorrect() throws IOException {
206+
public void whenSerializingPolymorphic_thenCorrect() throws JsonProcessingException {
207207
final Zoo.Dog dog = new Zoo.Dog("lacy");
208208
final Zoo zoo = new Zoo(dog);
209209

@@ -260,7 +260,7 @@ public void whenSerializingUsingJsonUnwrapped_thenCorrect() throws JsonProcessin
260260
}
261261

262262
@Test
263-
public void whenSerializingUsingJsonView_thenCorrect() throws JsonProcessingException {
263+
public void whenSerializingUsingJsonView_thenCorrect() throws JsonProcessingException, JsonProcessingException {
264264
final Item item = new Item(2, "book", "John");
265265

266266
final String result = new ObjectMapper().writerWithView(Views.Public.class).writeValueAsString(item);
@@ -336,7 +336,7 @@ public void whenSerializingUsingMixInAnnotation_thenCorrect() throws JsonProcess
336336
}
337337

338338
@Test
339-
public void whenDisablingAllAnnotations_thenAllDisabled() throws IOException {
339+
public void whenDisablingAllAnnotations_thenAllDisabled() throws JsonProcessingException {
340340
final MyBean bean = new MyBean(1, null);
341341

342342
final ObjectMapper mapper = new ObjectMapper();

0 commit comments

Comments
 (0)