Skip to content

Commit

Permalink
Getting codesservice to 100%
Browse files Browse the repository at this point in the history
  • Loading branch information
agordon-vivid committed Dec 1, 2024
1 parent 6646bd6 commit 5fe972c
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,19 @@ void testGetAllForestAreaCodes_Success() throws ServiceException {
assertNotNull(result);
}

@Test
void testGetAllForestAreaCodes_Exception() {
// Arrange
when(forestAreaCodeRepository.findAll()).thenThrow(new RuntimeException("Error fetching forest area codes"));

// Act & Assert
ServiceException exception = assertThrows(
ServiceException.class,
() -> codesService.getAllForestAreaCodes()
);
assertEquals("Error fetching forest area codes",exception.getMessage());
}

@Test
void testGetForestAreaCodeById_Success() throws ServiceException {
// Arrange
Expand Down

0 comments on commit 5fe972c

Please sign in to comment.