2 * Copyright © 2016-2019 European Support Limited
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.openecomp.sdc.be.components.property;
19 import static org.assertj.core.api.Assertions.assertThat;
20 import static org.mockito.ArgumentMatchers.any;
21 import static org.mockito.ArgumentMatchers.eq;
22 import static org.mockito.Mockito.verifyZeroInteractions;
23 import static org.mockito.Mockito.when;
24 import static org.openecomp.sdc.be.components.property.CapabilityTestUtils.createCapabilityDefinition;
25 import static org.openecomp.sdc.be.components.property.CapabilityTestUtils.createProperties;
27 import fj.data.Either;
28 import java.util.ArrayList;
29 import java.util.Arrays;
30 import java.util.Collections;
31 import java.util.HashMap;
32 import java.util.LinkedList;
33 import java.util.List;
35 import java.util.stream.Collectors;
36 import java.util.stream.Stream;
37 import org.junit.Assert;
38 import org.junit.Test;
39 import org.junit.runner.RunWith;
40 import org.mockito.ArgumentCaptor;
41 import org.mockito.Captor;
42 import org.mockito.InjectMocks;
43 import org.mockito.Mock;
44 import org.mockito.junit.MockitoJUnitRunner;
45 import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
46 import org.openecomp.sdc.be.components.utils.InputsBuilder;
47 import org.openecomp.sdc.be.components.utils.PropertyDataDefinitionBuilder;
48 import org.openecomp.sdc.be.components.utils.ResourceBuilder;
49 import org.openecomp.sdc.be.components.utils.ServiceBuilder;
50 import org.openecomp.sdc.be.dao.utils.MapUtil;
51 import org.openecomp.sdc.be.datatypes.elements.GetInputValueDataDefinition;
52 import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
53 import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
54 import org.openecomp.sdc.be.model.CapabilityDefinition;
55 import org.openecomp.sdc.be.model.Component;
56 import org.openecomp.sdc.be.model.ComponentInstancePropInput;
57 import org.openecomp.sdc.be.model.ComponentInstanceProperty;
58 import org.openecomp.sdc.be.model.InputDefinition;
59 import org.openecomp.sdc.be.model.PropertyDefinition;
60 import org.openecomp.sdc.be.model.Resource;
61 import org.openecomp.sdc.be.model.Service;
62 import org.openecomp.sdc.be.model.jsonjanusgraph.operations.ToscaOperationFacade;
63 import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
64 import org.openecomp.sdc.be.model.operations.impl.PropertyOperation;
65 import org.openecomp.sdc.be.model.operations.impl.UniqueIdBuilder;
68 @RunWith(MockitoJUnitRunner.class)
69 public class ComponentInstancePropertyDeclaratorTest extends PropertyDeclaratorTestBase {
72 private ComponentInstancePropertyDeclarator testInstance;
74 private ToscaOperationFacade toscaOperationFacade;
76 private ComponentInstanceBusinessLogic componentInstanceBusinessLogic;
78 private PropertyOperation propertyOperation;
81 private ArgumentCaptor<Map<String, List<ComponentInstanceProperty>>> instancePropertiesCaptor;
83 private static final String PROPERTY_ID = "propertyUid";
84 private static final String PROEPRTY_NAME = "propertyName";
85 private static final String SERVICE_ID = "serviceUid";
86 private static final String SERVICE_NAME = "serviceName";
89 public void declarePropertiesAsInputs_componentInstanceNotExist() {
90 Component cmpt = new Resource();
91 Either<List<InputDefinition>, StorageOperationStatus> createdInputs = testInstance.declarePropertiesAsInputs(cmpt, "someCmptInstId", Collections.emptyList());
92 assertThat(createdInputs.right().value()).isEqualTo(StorageOperationStatus.NOT_FOUND);
93 verifyZeroInteractions(toscaOperationFacade);
97 public void declarePropertiesAsInputs_singleNonComplexProperty() {
98 List<PropertyDataDefinition> properties = Collections.singletonList(prop1);
99 List<ComponentInstancePropInput> propsToDeclare = createInstancePropInputList(properties);
100 when(toscaOperationFacade.addComponentInstancePropertiesToComponent(eq(resource), instancePropertiesCaptor.capture())).thenReturn(Either.left(Collections.emptyMap()));
101 Either<List<InputDefinition>, StorageOperationStatus> createdInputs = testInstance.declarePropertiesAsInputs(resource, "inst1", propsToDeclare);
102 List<InputDefinition> inputs = createdInputs.left().value();
103 List<ComponentInstanceProperty> capturedInstanceProperties = instancePropertiesCaptor.getValue().get(INSTANCE_ID);
104 verifyCreatedInputs(properties, capturedInstanceProperties, inputs);
105 verifyUpdatedProperties(properties, capturedInstanceProperties, inputs);
109 public void declareCapabilitiesPropertiesAsInputs() {
110 prop1.setParentUniqueId("capUniqueId");
111 List<PropertyDataDefinition> properties = Collections.singletonList(prop1);
112 List<ComponentInstancePropInput> propsToDeclare = createInstancePropInputList(properties);
113 when(toscaOperationFacade.addComponentInstancePropertiesToComponent(eq(resource), instancePropertiesCaptor
114 .capture())).thenReturn(Either.left(Collections.emptyMap()));
116 CapabilityDefinition capabilityDefinition = createCapabilityDefinition();
118 List<ComponentInstanceProperty> capPropList = new ArrayList<>();
119 ComponentInstanceProperty instanceProperty = createProperties();
120 capPropList.add(instanceProperty);
121 capabilityDefinition.setProperties(capPropList);
123 capabilityDefinition.setPath(Collections.singletonList("path"));
124 Map<String, List<CapabilityDefinition>> capabilityMap = new HashMap<>();
125 capabilityMap.put(capabilityDefinition.getType(), Collections.singletonList(capabilityDefinition));
126 resource.setCapabilities(capabilityMap);
128 Either<List<InputDefinition>, StorageOperationStatus> createdInputs = testInstance
129 .declarePropertiesAsInputs(resource, "inst1", propsToDeclare);
130 Assert.assertTrue(createdInputs.isLeft());
134 public void testUnDeclarePropertiesAsInputs() throws Exception {
135 Component component = new ResourceBuilder().setComponentType(ComponentTypeEnum.RESOURCE).setUniqueId("resourceId")
136 .setName("resourceName").build();
137 InputDefinition input = new InputDefinition();
138 input.setUniqueId("ComponentInput1_uniqueId");
139 input.setPropertyId("ComponentInput1_uniqueId");
141 CapabilityDefinition capabilityDefinition = createCapabilityDefinition();
143 List<ComponentInstanceProperty> properties = new ArrayList<>();
144 ComponentInstanceProperty instanceProperty = createProperties();
146 List<GetInputValueDataDefinition> valueDataDefinitionList = new ArrayList<>();
147 GetInputValueDataDefinition getInputValueDataDefinition = new GetInputValueDataDefinition();
148 getInputValueDataDefinition.setInputId("ComponentInput1_uniqueId");
149 getInputValueDataDefinition.setPropName("prop_name");
150 valueDataDefinitionList.add(getInputValueDataDefinition);
152 instanceProperty.setGetInputValues(valueDataDefinitionList);
153 properties.add(instanceProperty);
154 capabilityDefinition.setProperties(properties);
155 Map<String, List<CapabilityDefinition>> capabilityMap = new HashMap<>();
156 capabilityMap.put(capabilityDefinition.getType(), Collections.singletonList(capabilityDefinition));
157 component.setCapabilities(capabilityMap);
158 component.setInputs(Collections.singletonList(input));
159 when(toscaOperationFacade.updateInstanceCapabilityProperty(any(Resource.class), any(),
160 any(ComponentInstanceProperty.class), any(CapabilityDefinition.class))).thenReturn(StorageOperationStatus.OK);
162 StorageOperationStatus result = testInstance.unDeclarePropertiesAsInputs(component, input);
163 Assert.assertEquals(StorageOperationStatus.OK, result);
167 public void declarePropertiesAsInputs_multipleNonComplexProperty() {
168 List<PropertyDataDefinition> properties = Arrays.asList(prop1, prop2);
169 List<ComponentInstancePropInput> propsToDeclare = createInstancePropInputList(properties);
170 when(toscaOperationFacade.addComponentInstancePropertiesToComponent(eq(resource), instancePropertiesCaptor.capture())).thenReturn(Either.left(Collections.emptyMap()));
171 Either<List<InputDefinition>, StorageOperationStatus> createdInputs = testInstance.declarePropertiesAsInputs(resource, "inst1", propsToDeclare);
173 List<InputDefinition> inputs = createdInputs.left().value();
174 List<ComponentInstanceProperty> capturedInstanceProperties = instancePropertiesCaptor.getValue().get(INSTANCE_ID);
175 verifyCreatedInputs(properties, capturedInstanceProperties, inputs);
176 verifyUpdatedProperties(properties, capturedInstanceProperties, inputs);
180 public void declarePropertiesAsInputs_singleComplexProperty() {
181 PropertyDefinition innerProp1 = new PropertyDataDefinitionBuilder()
182 .setName(INNER_PROP1)
185 .setUniqueId(complexProperty.getType() + ".datatype.ecomp_generated_naming")
187 PropertyDefinition innerProp2 = new PropertyDataDefinitionBuilder()
188 .setName(INNER_PROP2)
191 .setUniqueId(complexProperty.getType() + ".datatype.ecomp_generated_naming")
193 List<ComponentInstancePropInput> propsToDeclare = createComplexPropInputList(innerProp1, innerProp2);
194 when(toscaOperationFacade.addComponentInstancePropertiesToComponent(eq(resource), instancePropertiesCaptor.capture())).thenReturn(Either.left(Collections.emptyMap()));
195 Either<List<InputDefinition>, StorageOperationStatus> createdInputs = testInstance.declarePropertiesAsInputs(resource, "inst1", propsToDeclare);
197 List<InputDefinition> inputs = createdInputs.left().value();
198 List<ComponentInstanceProperty> capturedInstanceProperties = instancePropertiesCaptor.getValue().get(INSTANCE_ID);
200 verifyCreatedInputsFromComplexProperty(propsToDeclare, capturedInstanceProperties, inputs);
201 verifyUpdatedComplexProperty(capturedInstanceProperties, inputs);
205 public void testCreateDeclaredProperty() {
206 PropertyDefinition propertyDefinition = getPropertyForDeclaration();
207 ComponentInstanceProperty declaredProperty = testInstance.createDeclaredProperty(propertyDefinition);
209 assertThat(declaredProperty).isNotNull();
210 assertThat(declaredProperty.getUniqueId()).isEqualTo(propertyDefinition.getUniqueId());
214 public void testUndeclareProperty() {
215 Service service = new ServiceBuilder()
216 .setUniqueId(SERVICE_ID)
217 .setName(SERVICE_NAME)
222 InputDefinition inputToDelete = InputsBuilder
224 .setPropertyId(PROPERTY_ID)
225 .setName(PROEPRTY_NAME)
228 inputToDelete.setGetInputValues(getGetInputListForDeclaration());
230 ComponentInstanceProperty componentInstanceProperty = new ComponentInstanceProperty(getPropertyForDeclaration());
231 List<ComponentInstanceProperty> componentInstanceProperties = new ArrayList<>();
232 componentInstanceProperties.add(componentInstanceProperty);
234 when(componentInstanceBusinessLogic.getComponentInstancePropertiesByInputId(any(), any())).thenReturn(new LinkedList<>());
236 StorageOperationStatus undeclareStatus =
237 testInstance.unDeclarePropertiesAsInputs(service, inputToDelete);
239 assertThat(undeclareStatus).isEqualTo(StorageOperationStatus.OK);
242 private List<GetInputValueDataDefinition> getGetInputListForDeclaration() {
243 GetInputValueDataDefinition getInput = new GetInputValueDataDefinition();
244 getInput.setInputId(PROPERTY_ID);
245 getInput.setInputName(PROEPRTY_NAME);
246 getInput.setPropName(PROEPRTY_NAME);
247 List<GetInputValueDataDefinition> getInputList = new ArrayList<>();
248 getInputList.add(getInput);
252 private PropertyDefinition getPropertyForDeclaration() {
253 return new PropertyDataDefinitionBuilder()
254 .setUniqueId(PROPERTY_ID)
259 public void declarePropertiesAsListInput() {
260 // construct arguments
261 List<PropertyDataDefinition> properties = Arrays.asList(prop1, prop2);
262 List<ComponentInstancePropInput> propsToDeclare = createInstancePropInputList(properties);
263 InputDefinition input = new InputDefinition(new PropertyDataDefinitionBuilder()
264 .setName("listinput")
266 .setDescription("description")
267 .setSchemaType("org.onap.datatype.listinput")
270 when(toscaOperationFacade.addComponentInstancePropertiesToComponent(eq(resource), instancePropertiesCaptor.capture())).thenReturn(Either.left(Collections.emptyMap()));
271 Either<InputDefinition, StorageOperationStatus> result = testInstance.declarePropertiesAsListInput(resource, "inst1", propsToDeclare, input);
273 assertThat(result.isLeft()).isTrue();
274 List<ComponentInstanceProperty> capturedInstanceProperties = instancePropertiesCaptor.getValue().get(INSTANCE_ID);
275 assertThat(capturedInstanceProperties.size()).isEqualTo(2);
276 Map<String, PropertyDataDefinition> propertiesMap =
277 properties.stream().collect(Collectors.toMap(PropertyDataDefinition::getName, e->e));
278 for(ComponentInstanceProperty instanceProperty: capturedInstanceProperties) {
279 assertThat(propertiesMap.containsKey(instanceProperty.getName())).isTrue();
280 PropertyDataDefinition property = propertiesMap.get(instanceProperty.getName());
281 assertThat(instanceProperty.getType()).isEqualTo(property.getType());
282 assertThat(instanceProperty.isGetInputProperty()).isTrue();
287 public void declarePropertiesAsListInput_propertyOwnerNotFound() {
288 // construct arguments
289 List<PropertyDataDefinition> properties = Arrays.asList(prop1, prop2);
290 List<ComponentInstancePropInput> propsToDeclare = createInstancePropInputList(properties);
291 InputDefinition input = new InputDefinition(new PropertyDataDefinitionBuilder()
292 .setName("listinput")
294 .setDescription("description")
295 .setSchemaType("org.onap.datatype.listinput")
297 Either<InputDefinition, StorageOperationStatus> result = testInstance.declarePropertiesAsListInput(resource, "inst2", propsToDeclare, input);
299 assertThat(result.isRight()).isTrue();
300 assertThat(result.right().value()).isEqualTo(StorageOperationStatus.NOT_FOUND);
304 public void unDeclarePropertiesAsListInputsTest() {
305 InputDefinition inputToDelete = new InputDefinition();
306 inputToDelete.setUniqueId(INPUT_ID);
307 inputToDelete.setName(INPUT_ID);
308 inputToDelete.setIsDeclaredListInput(true);
310 Component component = createComponentWithListInput(INPUT_ID, "innerPropName");
311 PropertyDefinition prop = new PropertyDataDefinitionBuilder()
313 .setValue(generateGetInputValueAsListInput(INPUT_ID, "innerPropName"))
315 .setUniqueId("propName")
316 .addGetInputValue(INPUT_ID)
318 component.setProperties(Collections.singletonList(prop));
320 List<ComponentInstanceProperty> ciPropList = new ArrayList<>();
321 ComponentInstanceProperty ciProp = new ComponentInstanceProperty();
322 List<String> pathOfComponentInstances = new ArrayList<>();
323 pathOfComponentInstances.add("pathOfComponentInstances");
324 ciProp.setPath(pathOfComponentInstances);
325 ciProp.setUniqueId("componentInstanceId");
326 ciProp.setDefaultValue("default value");
327 ciProp.setComponentInstanceId("componentInstanceId");
328 ciProp.setComponentInstanceName("componentInstanceName");
329 ciProp.setValue(generateGetInputValueAsListInput(INPUT_ID, "innerPropName"));
330 ciPropList.add(ciProp);
332 when(componentInstanceBusinessLogic.getComponentInstancePropertiesByInputId(eq(component), eq(INPUT_ID))).thenReturn(ciPropList);
333 when(propertyOperation.findDefaultValueFromSecondPosition(eq(pathOfComponentInstances), eq(ciProp.getUniqueId()), eq(ciProp.getDefaultValue()))).thenReturn(Either.left(ciProp.getDefaultValue()));
334 when(toscaOperationFacade.updateComponentInstanceProperties(eq(component), eq(ciProp.getComponentInstanceId()), eq(ciPropList))).thenReturn(StorageOperationStatus.OK);
335 StorageOperationStatus storageOperationStatus = testInstance.unDeclarePropertiesAsListInputs(component, inputToDelete);
337 assertThat(storageOperationStatus).isEqualTo(StorageOperationStatus.OK);
341 public void unDeclarePropertiesAsListInputsTest_whenNoListInput_returnOk() {
342 InputDefinition input = new InputDefinition();
343 input.setUniqueId(INPUT_ID);
344 input.setName(INPUT_ID);
345 input.setValue("value");
346 List<ComponentInstanceProperty> resList = new ArrayList<>();
347 when(componentInstanceBusinessLogic.getComponentInstancePropertiesByInputId(eq(resource), eq(INPUT_ID))).thenReturn(resList);
348 StorageOperationStatus status = testInstance.unDeclarePropertiesAsListInputs(resource, input);
349 Assert.assertEquals(status, StorageOperationStatus.OK);
352 private void verifyUpdatedProperties(List<PropertyDataDefinition> properties, List<ComponentInstanceProperty> capturedInstanceProperties, List<InputDefinition> inputs) {
353 assertThat(capturedInstanceProperties).hasSize(properties.size());
354 Map<String, ComponentInstanceProperty> updatedPropertiesByName = MapUtil.toMap(capturedInstanceProperties, ComponentInstanceProperty::getName);
355 properties.forEach(prop -> verifyUpdatedInstanceProperty(prop, updatedPropertiesByName.get(prop.getName()), inputs));
358 private void verifyUpdatedComplexProperty(List<ComponentInstanceProperty> capturedInstanceProperties, List<InputDefinition> inputs) {
359 assertThat(capturedInstanceProperties).hasSize(1);
360 verifyUpdatedInstanceComplexProperty(capturedInstanceProperties.get(0), inputs);
363 private void verifyCreatedInputs(List<PropertyDataDefinition> originalPropsToDeclare, List<ComponentInstanceProperty> capturedUpdatedProperties, List<InputDefinition> inputs) {
364 assertThat(inputs).hasSize(originalPropsToDeclare.size());
365 Map<String, InputDefinition> propertyIdToCreatedInput = MapUtil.toMap(inputs, InputDefinition::getPropertyId);
366 originalPropsToDeclare.forEach(propToDeclare -> verifyCreatedInput(propToDeclare, propertyIdToCreatedInput.get(propToDeclare.getUniqueId())));
367 capturedUpdatedProperties.forEach(updatedProperty -> verifyInputPropertiesList(updatedProperty, propertyIdToCreatedInput.get(updatedProperty.getUniqueId())));
370 private void verifyCreatedInputsFromComplexProperty(List<ComponentInstancePropInput> propsToDeclare, List<ComponentInstanceProperty> capturedInstanceProperties, List<InputDefinition> inputs) {
371 assertThat(inputs).hasSize(propsToDeclare.size());
372 Map<String, InputDefinition> inputsByName = MapUtil.toMap(inputs, InputDefinition::getName);
373 propsToDeclare.forEach(propToDeclare -> verifyCreatedInputFromComplexProperty(propToDeclare, inputsByName));
374 Map<String, List<InputDefinition>> propertyIdToCreatedInput = MapUtil.groupListBy(inputs, InputDefinition::getPropertyId);
375 capturedInstanceProperties.forEach(updatedProperty -> verifyInputPropertiesListFromComplexProperty(updatedProperty, propertyIdToCreatedInput.get(updatedProperty.getUniqueId())));
378 private void verifyInputPropertiesListFromComplexProperty(ComponentInstanceProperty updatedProperty, List<InputDefinition> inputs) {
379 inputs.forEach(input -> verifyInputPropertiesList(updatedProperty, input));
382 private void verifyCreatedInputFromComplexProperty(ComponentInstancePropInput parentProperty, Map<String, InputDefinition> inputsByName) {
383 PropertyDefinition innerProperty = parentProperty.getInput();
384 String expectedInputName = generateExpectedInputName(parentProperty, innerProperty);
385 InputDefinition input = inputsByName.get(expectedInputName);
386 assertThat(input.getType()).isEqualTo(innerProperty.getType());
387 assertThat(input.getValue()).isEqualTo(innerProperty.getValue());
388 // assertThat(input.getDefaultValue()).isEqualTo(innerProperty.getValue());//bug
389 assertThat(input.getUniqueId()).isEqualTo(UniqueIdBuilder.buildPropertyUniqueId(RESOURCE_ID, input.getName()));
390 assertThat(input.getPropertyId()).isEqualTo(parentProperty.getUniqueId());
391 assertThat(input.getInstanceUniqueId()).isEqualTo(INSTANCE_ID);
395 private void verifyInputPropertiesList(ComponentInstanceProperty updatedProperty, InputDefinition input) {
396 assertThat(input.getProperties()).hasSize(1);
397 assertThat(updatedProperty).isEqualTo(input.getProperties().get(0));
401 private List<ComponentInstancePropInput> createComplexPropInputList(PropertyDefinition ... innerProperties) {
402 return Stream.of(innerProperties).map(this::createComplexPropInput).collect(Collectors.toList());
405 private ComponentInstancePropInput createComplexPropInput(PropertyDefinition innerProp) {
406 ComponentInstancePropInput componentInstancePropInput = new ComponentInstancePropInput(new ComponentInstanceProperty(complexProperty));
407 componentInstancePropInput.setInput(innerProp);
408 componentInstancePropInput.setPropertiesName(complexProperty.getName() + "#" + innerProp.getName());
409 return componentInstancePropInput;
412 private void verifyUpdatedInstanceProperty(PropertyDataDefinition originalProperty, ComponentInstanceProperty updatedProperty, List<InputDefinition> inputs) {
413 assertThat(updatedProperty.getValue()).isEqualTo(generateGetInputValue(generateExpectedInputName(originalProperty)));
414 assertThat(updatedProperty.isGetInputProperty()).isTrue();
415 assertThat(updatedProperty.getName()).isEqualTo(originalProperty.getName());
416 List<GetInputValueDataDefinition> getInputValues = updatedProperty.getGetInputValues();
417 verifyGetInputValues(getInputValues, inputs);
420 private void verifyUpdatedInstanceComplexProperty(ComponentInstanceProperty updatedComplexProperty, List<InputDefinition> inputs) {
421 assertThat(updatedComplexProperty.getValue()).isEqualTo(generateComplexGetInputValue(inputs));
422 assertThat(updatedComplexProperty.isGetInputProperty()).isTrue();
423 assertThat(updatedComplexProperty.getName()).isEqualTo(complexProperty.getName());
424 List<GetInputValueDataDefinition> getInputValues = updatedComplexProperty.getGetInputValues();
425 verifyGetInputValues(getInputValues, inputs);
428 private void verifyGetInputValues(List<GetInputValueDataDefinition> getInputValues, List<InputDefinition> inputs) {
429 Map<String, InputDefinition> inputsByName = MapUtil.toMap(inputs, InputDefinition::getName);
430 getInputValues.forEach(getInputVal -> {
431 InputDefinition input = inputsByName.get(getInputVal.getInputName());
432 assertThat(input.getUniqueId()).isEqualTo(getInputVal.getInputId());
436 private String generateComplexGetInputValue(List<InputDefinition> createdInputs) {
437 return String.format("{\"%s\":%s,\"%s\":%s}", INNER_PROP1, generateGetInputValue(createdInputs.get(0).getName()), INNER_PROP2, generateGetInputValue(createdInputs.get(1).getName()));
440 private String generateExpectedInputName(PropertyDataDefinition prop) {
441 return INSTANCE_ID + "_" + prop.getName();
444 private String generateExpectedInputName(PropertyDefinition parentProp, PropertyDefinition innerProperty) {
445 return INSTANCE_ID + "_" + parentProp.getName()+ "_" + innerProperty.getName();
448 private void verifyCreatedInput(PropertyDataDefinition property, InputDefinition input) {
449 assertThat(input.getType()).isEqualTo(property.getType());
450 assertThat(input.getName()).isEqualTo(generateExpectedInputName(property));
451 assertThat(input.getValue()).isEqualTo(property.getValue());
452 assertThat(input.getDefaultValue()).isEqualTo(property.getValue());
453 assertThat(input.getUniqueId()).isEqualTo(UniqueIdBuilder.buildPropertyUniqueId(RESOURCE_ID, input.getName()));
454 assertThat(input.getPropertyId()).isEqualTo(property.getUniqueId());
455 assertThat(input.getInstanceUniqueId()).isEqualTo(INSTANCE_ID);
458 private Component createComponentWithListInput(String inputName, String propName) {
459 InputDefinition input = InputsBuilder.create()
463 input.setUniqueId(INPUT_ID);
464 input.setName(INPUT_ID);
465 input.setDefaultValue("defaultValue");
466 input.setValue(generateGetInputValueAsListInput(inputName, propName));
468 return new ResourceBuilder()
469 .setUniqueId(RESOURCE_ID)