+ @Test
+ public void testCreateDeclaredProperty() {
+ PropertyDefinition propertyDefinition = getPropertyForDeclaration();
+ ComponentInstanceProperty declaredProperty = testInstance.createDeclaredProperty(propertyDefinition);
+
+ assertThat(declaredProperty).isNotNull();
+ assertThat(declaredProperty.getUniqueId()).isEqualTo(propertyDefinition.getUniqueId());
+ }
+
+ @Test
+ public void testUndeclareProperty() {
+ Service service = new ServiceBuilder()
+ .setUniqueId(SERVICE_ID)
+ .setName(SERVICE_NAME)
+ .build();
+
+
+
+ InputDefinition inputToDelete = InputsBuilder
+ .create()
+ .setPropertyId(PROPERTY_ID)
+ .setName(PROEPRTY_NAME)
+ .build();
+
+ inputToDelete.setGetInputValues(getGetInputListForDeclaration());
+
+ ComponentInstanceProperty componentInstanceProperty = new ComponentInstanceProperty(getPropertyForDeclaration());
+ List<ComponentInstanceProperty> componentInstanceProperties = new ArrayList<>();
+ componentInstanceProperties.add(componentInstanceProperty);
+
+ when(componentInstanceBusinessLogic.getComponentInstancePropertiesByInputId(any(), any())).thenReturn(new LinkedList<>());
+
+ StorageOperationStatus undeclareStatus =
+ testInstance.unDeclarePropertiesAsInputs(service, inputToDelete);
+
+ assertThat(undeclareStatus).isEqualTo(StorageOperationStatus.OK);
+ }
+
+ private List<GetInputValueDataDefinition> getGetInputListForDeclaration() {
+ GetInputValueDataDefinition getInput = new GetInputValueDataDefinition();
+ getInput.setInputId(PROPERTY_ID);
+ getInput.setInputName(PROEPRTY_NAME);
+ getInput.setPropName(PROEPRTY_NAME);
+ List<GetInputValueDataDefinition> getInputList = new ArrayList<>();
+ getInputList.add(getInput);
+ return getInputList;
+ }
+
+ private PropertyDefinition getPropertyForDeclaration() {
+ return new PropertyDataDefinitionBuilder()
+ .setUniqueId(PROPERTY_ID)
+ .build();
+ }
+