1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.imaging;
18
19 import static org.junit.jupiter.api.Assertions.assertEquals;
20 import static org.junit.jupiter.api.Assertions.assertNotNull;
21 import static org.junit.jupiter.api.Assertions.assertNull;
22
23 import org.junit.jupiter.api.Test;
24
25
26
27
28 public class TestImageReadException {
29
30 @Test
31 public void testCreateExceptionWithMessage() {
32 final ImagingException exception = new ImagingException("imaging");
33 assertEquals("imaging", exception.getMessage());
34 assertNull(exception.getCause());
35 }
36
37 @Test
38 public void testCreateExceptionWithMessageAndCause() {
39 final ImagingException exception = new ImagingException("imaging", new Exception("cause"));
40 assertEquals("imaging", exception.getMessage());
41 assertNotNull(exception.getCause());
42 }
43 }