diff options
author | lapentafd <francesco.lapenta@est.tech> | 2022-12-08 12:12:10 +0000 |
---|---|---|
committer | Francesco Davide Lapenta <francesco.lapenta@est.tech> | 2022-12-08 12:20:57 +0000 |
commit | 014f80c5af3f31d5baca9182576f63d0bebfa368 (patch) | |
tree | c9013b350942f31586271cde365f3094f5c13573 /models/src/test | |
parent | 2d3c8c987001ac176acb2feaadd885ceb1f7d234 (diff) |
Clamp models code coverage
Issue-ID: POLICY-4476
Change-Id: Ie34f278cf999dd2046ccdff6b97936b42ad19355
Signed-off-by: lapentafd <francesco.lapenta@est.tech>
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); |