diff options
Diffstat (limited to 'models/src/test/java')
-rw-r--r-- | models/src/test/java/org/onap/policy/clamp/models/acm/persistence/provider/AutomationCompositionProviderTest.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/provider/AutomationCompositionProviderTest.java b/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/provider/AutomationCompositionProviderTest.java index 515dfaa83..c2368fe10 100644 --- a/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/provider/AutomationCompositionProviderTest.java +++ b/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/provider/AutomationCompositionProviderTest.java @@ -56,6 +56,7 @@ class AutomationCompositionProviderTest { private static final String AC_IS_NULL = "automationComposition is marked non-null but is null"; private static final String ACELEMENT_IS_NULL = "element is marked non-null but is null"; + private static final String ACELEMENT_ID_IS_NULL = "elementId is marked non-null but is null"; private static final Coder CODER = new StandardCoder(); private static final String AUTOMATION_COMPOSITION_JSON = @@ -241,6 +242,18 @@ class AutomationCompositionProviderTest { } @Test + void testDeleteElementById() { + var acElementRepository = mock(AutomationCompositionElementRepository.class); + var automationCompositionProvider = new AutomationCompositionProvider( + mock(AutomationCompositionRepository.class), acElementRepository); + assertThatThrownBy(() -> automationCompositionProvider.deleteAutomationCompositionElement(null)) + .hasMessageMatching(ACELEMENT_ID_IS_NULL); + var elementId = UUID.randomUUID(); + automationCompositionProvider.deleteAutomationCompositionElement(elementId); + verify(acElementRepository).deleteById(elementId.toString()); + } + + @Test void testValidateElementIds() { var acElementRepository = mock(AutomationCompositionElementRepository.class); var automationCompositionProvider = new AutomationCompositionProvider( |