From 8b8a77e21676bf412106af281e93555298fd4167 Mon Sep 17 00:00:00 2001 From: mynecker Date: Thu, 17 Oct 2024 15:16:40 +0200 Subject: [PATCH] added unit test --- .../management/agent/service/ScanServiceTests.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/service/application/src/test/java/com/solace/maas/ep/event/management/agent/service/ScanServiceTests.java b/service/application/src/test/java/com/solace/maas/ep/event/management/agent/service/ScanServiceTests.java index 8820a09f..2cd71e3a 100644 --- a/service/application/src/test/java/com/solace/maas/ep/event/management/agent/service/ScanServiceTests.java +++ b/service/application/src/test/java/com/solace/maas/ep/event/management/agent/service/ScanServiceTests.java @@ -372,6 +372,19 @@ public void testIsScanCompleteIsNotComplete(String scanStatus) { Assertions.assertFalse(scanService.isScanComplete("scan1")); } + @Test + @SneakyThrows + public void testIsScanCompleteIsNotCompleteEmptyScanTypeList() { + ScanStatusEntity scanStatusA = scanServiceHelper.buildScanStatusEntity("status1", "COMPLETE"); + + when(scanTypeRepository.findAllByScanId(any(String.class))) + .thenReturn(List.of()); + when(scanStatusRepository.findByScanType(any(ScanTypeEntity.class))) + .thenReturn(scanStatusA); + + Assertions.assertFalse(scanService.isScanComplete("scan1")); + } + @Test @SneakyThrows public void testIsScanCompleteIsCompleteScans() {