File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
api/src/test/java/marquez/service/exceptions Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2018-2023 contributors to the Marquez project
3+ * SPDX-License-Identifier: Apache-2.0
4+ */
5+
6+ package marquez .service .exceptions ;
7+
8+ import static org .junit .jupiter .api .Assertions .assertEquals ;
9+ import static org .junit .jupiter .api .Assertions .assertNotNull ;
10+
11+ import org .junit .jupiter .api .Test ;
12+
13+ class NodeIdNotFoundExceptionTest {
14+
15+ @ Test
16+ void testConstructorWithMessage () {
17+ String message = "Node not found" ;
18+ NodeIdNotFoundException exception = new NodeIdNotFoundException (message );
19+
20+ assertNotNull (exception );
21+ assertEquals (message , exception .getMessage ());
22+ }
23+
24+ @ Test
25+ void testConstructorWithMessageAndCause () {
26+ String message = "Node not found" ;
27+ Throwable cause = new RuntimeException ("Original error" );
28+ NodeIdNotFoundException exception = new NodeIdNotFoundException (message , cause );
29+
30+ assertNotNull (exception );
31+ assertEquals (message , exception .getMessage ());
32+ assertEquals (cause , exception .getCause ());
33+ }
34+ }
You can’t perform that action at this time.
0 commit comments