Skip to content

Commit c5a223a

Browse files
committed
test: add test coverage for NodeIdNotFoundException
Signed-off-by: swar00pduthks <[email protected]>
1 parent 6b49335 commit c5a223a

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
}

0 commit comments

Comments
 (0)