diff options
author | Liam Fallon <liam.fallon@est.tech> | 2022-12-09 10:41:35 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2022-12-09 10:41:35 +0000 |
commit | 4290f3f573dc430588965ebfe9f2b84d7840fbcb (patch) | |
tree | de8a6c8d01920a9cd6efefc12daba7b61ff592ab /models/src/test | |
parent | 7da3227a9090ece82343eee6f8133dbefbeee30a (diff) | |
parent | 014f80c5af3f31d5baca9182576f63d0bebfa368 (diff) |
Merge "Clamp models code coverage"
Diffstat (limited to 'models/src/test')
-rw-r--r-- | models/src/test/java/org/onap/policy/clamp/models/acm/persistence/provider/AcDefinitionProviderTest.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/provider/AcDefinitionProviderTest.java b/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/provider/AcDefinitionProviderTest.java index a2d6d69c2..50953d692 100644 --- a/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/provider/AcDefinitionProviderTest.java +++ b/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/provider/AcDefinitionProviderTest.java @@ -22,6 +22,7 @@ package org.onap.policy.clamp.models.acm.persistence.provider; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; @@ -46,6 +47,8 @@ import org.springframework.data.domain.Example; class AcDefinitionProviderTest { private static final String TOSCA_SERVICE_TEMPLATE_YAML = "clamp/acm/pmsh/funtional-pmsh-usecase.yaml"; + private static final String TOSCA_SERVICE_TEMPLATE_YAML_PROP = + "clamp/acm/test/tosca-template-additional-properties.yaml"; private static final StandardYamlCoder YAML_TRANSLATOR = new StandardYamlCoder(); @@ -57,6 +60,24 @@ class AcDefinitionProviderTest { } @Test + void testDocCopyCompare() { + + var inputServiceTemplateProperties = getToscaServiceTemplate(TOSCA_SERVICE_TEMPLATE_YAML_PROP); + var docServiceTemplate = new DocToscaServiceTemplate(inputServiceTemplateProperties); + var docServiceTemplateCopy = new DocToscaServiceTemplate(docServiceTemplate); + + assertTrue(docServiceTemplate.compareTo(docServiceTemplateCopy) < -1); + assertThat(docServiceTemplate.compareToWithoutEntities(docServiceTemplateCopy)).isZero(); + + var acmDefinition = getAcDefinition(docServiceTemplate); + var acmDefinitionCopy = getAcDefinition(docServiceTemplateCopy); + + assertThat(acmDefinition.getServiceTemplate().getName()).isEqualTo( + acmDefinitionCopy.getServiceTemplate().getName()); + + } + + @Test void testCreateServiceTemplate() { var docServiceTemplate = new DocToscaServiceTemplate(inputServiceTemplate); var acmDefinition = getAcDefinition(docServiceTemplate); |