diff options
author | 2021-07-15 09:18:37 +0100 | |
---|---|---|
committer | 2021-08-06 17:22:20 +0100 | |
commit | 47bcc63a9daff1f310125fed006f27c93656fa83 (patch) | |
tree | 3c61670b039c0e63d14880f909e6047d54776492 /catalog-be/src/test/java/org/openecomp/sdc/be/components/validation | |
parent | 0ed125f98ae8ea9e80c855a640c328654660d081 (diff) |
Retrieve data types based on component model
Issue-ID: SDC-3660
Signed-off-by: aribeiro <anderson.ribeiro@est.tech>
Change-Id: I09c533eb39277532b29e581e4dd57e9df952e8e6
Diffstat (limited to 'catalog-be/src/test/java/org/openecomp/sdc/be/components/validation')
-rw-r--r-- | catalog-be/src/test/java/org/openecomp/sdc/be/components/validation/AnnotationValidatorTest.java | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/validation/AnnotationValidatorTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/validation/AnnotationValidatorTest.java index 4b33e2d2be..9577bc6a11 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/validation/AnnotationValidatorTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/validation/AnnotationValidatorTest.java @@ -19,7 +19,14 @@ */ package org.openecomp.sdc.be.components.validation; +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; + import fj.data.Either; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -36,14 +43,6 @@ import org.openecomp.sdc.be.model.DataTypeDefinition; import org.openecomp.sdc.be.model.PropertyDefinition; import org.openecomp.sdc.be.model.cache.ApplicationDataTypeCache; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; - @RunWith(MockitoJUnitRunner.class) public class AnnotationValidatorTest { @@ -62,7 +61,7 @@ public class AnnotationValidatorTest { @Mock private ComponentsUtils componentsUtils; @Mock - private ApplicationDataTypeCache dataTypeCache; + private ApplicationDataTypeCache applicationDataTypeCache; @Mock private PropertyValidator propertyValidator; @Mock @@ -70,10 +69,10 @@ public class AnnotationValidatorTest { @Before public void setUp() throws Exception { - annotationValidator = new AnnotationValidator(propertyValidator, exceptionUtils, dataTypeCache, componentsUtils); + annotationValidator = new AnnotationValidator(propertyValidator, exceptionUtils, applicationDataTypeCache, componentsUtils); allData = Collections.emptyMap(); Either<Map<String, DataTypeDefinition>, JanusGraphOperationStatus> cacheResponse = Either.left(allData); - Mockito.when(dataTypeCache.getAll()).thenReturn(cacheResponse); + Mockito.when(applicationDataTypeCache.getAll(null)).thenReturn(cacheResponse); annotationTypeProperties = Collections.emptyList(); propertyDataDefinitions = new ArrayList<>(); } @@ -85,8 +84,7 @@ public class AnnotationValidatorTest { List<PropertyDefinition> properties = new ArrayList<>(); properties.add(new PropertyDefinition(propertyDataDefinition)); - List<Annotation> annotations = annotationValidator - .validateAnnotationsProperties(annotation, annotationTypeDefinition); + List<Annotation> annotations = annotationValidator.validateAnnotationsProperties(annotation, annotationTypeDefinition, null); Mockito.verify(propertyValidator).thinPropertiesValidator(properties, annotationTypeProperties, allData); assertThat(annotations.get(0), is(annotation)); |