summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-be/src/test')
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogicTest.java8
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogicTest.java2
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/components/validation/PropertyValidatorTest.java18
3 files changed, 6 insertions, 22 deletions
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogicTest.java
index 548ef1ace9..308d272a79 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogicTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogicTest.java
@@ -469,7 +469,7 @@ public class InputsBusinessLogicTest {
// for BaseOperation.getAllDataTypes:
when(applicationDataTypeCache.getAll()).thenReturn(Either.left(new HashMap<>())); // don't use Collections.emptyMap
// for BaseOperation.validatePropertyDefaultValue:
- when(propertyOperation.isPropertyTypeValid(any())).thenReturn(true);
+ when(propertyOperation.isPropertyTypeValid(any(), any())).thenReturn(true);
when(propertyOperation.isPropertyInnerTypeValid(any(),any())).thenReturn(new ImmutablePair<>(listInput.getSchemaType(), true));
when(propertyOperation.isPropertyDefaultValueValid(any(), any())).thenReturn(true);
// for createListInputsInGraph:
@@ -565,12 +565,12 @@ public class InputsBusinessLogicTest {
when(propertyDeclarationOrchestrator.getPropOwnerId(componentInstInputsMap)).thenReturn(COMPONENT_INSTANCE_ID);
when(applicationDataTypeCache.getAll()).thenReturn(Either.left(new HashMap<>())); // don't use Collections.emptyMap
// for BaseOperation.validatePropertyDefaultValue:
- when(propertyOperation.isPropertyTypeValid(any())).thenReturn(false);
+ when(propertyOperation.isPropertyTypeValid(any(), any())).thenReturn(false);
Either<List<InputDefinition>, ResponseFormat> result =
testInstance.createListInput(USER_ID, COMPONENT_ID, ComponentTypeEnum.SERVICE, createListInputParams, true, false);
assertThat(result.isRight()).isTrue();
- verify(propertyOperation, times(1)).isPropertyTypeValid(any());
+ verify(propertyOperation, times(1)).isPropertyTypeValid(any(), any());
}
@Test
@@ -585,7 +585,7 @@ public class InputsBusinessLogicTest {
when(propertyDeclarationOrchestrator.getPropOwnerId(componentInstInputsMap)).thenReturn(COMPONENT_INSTANCE_ID);
when(applicationDataTypeCache.getAll()).thenReturn(Either.left(new HashMap<>())); // don't use Collections.emptyMap
// for BaseOperation.validatePropertyDefaultValue:
- when(propertyOperation.isPropertyTypeValid(any())).thenReturn(true);
+ when(propertyOperation.isPropertyTypeValid(any(), any())).thenReturn(true);
when(propertyOperation.isPropertyInnerTypeValid(any(),any())).thenReturn(new ImmutablePair<>(listInput.getSchemaType(), true));
when(propertyOperation.isPropertyDefaultValueValid(any(), any())).thenReturn(true);
when(toscaOperationFacadeMock.addInputsToComponent(anyMap(), eq(COMPONENT_ID))).thenReturn(Either.right(StorageOperationStatus.NOT_FOUND));
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogicTest.java
index 09f4ac72de..17078bcb75 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogicTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogicTest.java
@@ -1720,7 +1720,7 @@ public class ResourceBusinessLogicTest {
List<PropertyDefinition> properties = new ArrayList<>();
properties.add(property);
basic.setProperties(properties);
- when(propertyOperation.isPropertyTypeValid(property)).thenReturn(true);
+ when(propertyOperation.isPropertyTypeValid(property, null)).thenReturn(true);
when(propertyOperation.isPropertyDefaultValueValid(property, emptyDataTypes)).thenReturn(true);
Boolean validatePropertiesDefaultValues = bl.validatePropertiesDefaultValues(basic);
assertTrue(validatePropertiesDefaultValues);
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/validation/PropertyValidatorTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/validation/PropertyValidatorTest.java
index 9a9e9578b6..f85ec2953a 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/validation/PropertyValidatorTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/validation/PropertyValidatorTest.java
@@ -59,8 +59,7 @@ public class PropertyValidatorTest {
Mockito.when(propertyOperation.validateAndUpdatePropertyValue(
Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(Either.left(""));
- PropertyValidator propertyValidator = new PropertyValidator(propertyOperation, componentsUtils,
- applicationDataTypeCache, exceptionUtils);
+ PropertyValidator propertyValidator = new PropertyValidator(propertyOperation, componentsUtils, exceptionUtils);
List<PropertyDefinition> props = new ArrayList<>();
List<PropertyDefinition> dbProps = new ArrayList<>();
PropertyDefinition prop = new PropertyDefinition();
@@ -73,19 +72,4 @@ public class PropertyValidatorTest {
Mockito.verify(propertyOperation).validateAndUpdatePropertyValue(TYPE, VALUE, null, Collections.emptyMap());
}
-
- @Test
- public void shouldIterateOverPropertiesOnInvalidType() {
- PropertyValidator propertyValidator = new PropertyValidator(propertyOperation, componentsUtils,
- applicationDataTypeCache, exceptionUtils);
- List<PropertyDefinition> props = new ArrayList<>();
- PropertyDefinition prop = new PropertyDefinition();
- prop.setName(TEST);
- prop.setValue(VALUE);
- prop.setType(TYPE);
- props.add(prop);
- Either<Boolean, ResponseFormat> booleanResponseFormatEither = propertyValidator.iterateOverProperties(props);
-
- assertTrue(booleanResponseFormatEither.isRight());
- }
} \ No newline at end of file