2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdc.be.components.validation;
23 import static org.junit.jupiter.api.Assertions.assertEquals;
24 import static org.junit.jupiter.api.Assertions.assertTrue;
25 import static org.mockito.ArgumentMatchers.any;
26 import static org.mockito.ArgumentMatchers.eq;
27 import static org.mockito.Mockito.when;
29 import fj.data.Either;
30 import java.util.Arrays;
31 import java.util.Collections;
32 import java.util.HashMap;
33 import java.util.LinkedList;
34 import java.util.List;
36 import org.junit.jupiter.api.BeforeEach;
37 import org.junit.jupiter.api.Test;
38 import org.mockito.InjectMocks;
39 import org.mockito.Mock;
40 import org.mockito.Mockito;
41 import org.mockito.MockitoAnnotations;
42 import org.openecomp.sdc.be.config.ConfigurationManager;
43 import org.openecomp.sdc.be.dao.api.ActionStatus;
44 import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
45 import org.openecomp.sdc.be.datatypes.elements.SchemaDefinition;
46 import org.openecomp.sdc.be.datatypes.elements.ToscaGetFunctionDataDefinition;
47 import org.openecomp.sdc.be.datatypes.enums.ConstraintType;
48 import org.openecomp.sdc.be.datatypes.enums.FilterValueType;
49 import org.openecomp.sdc.be.datatypes.enums.PropertyFilterTargetType;
50 import org.openecomp.sdc.be.datatypes.enums.PropertySource;
51 import org.openecomp.sdc.be.datatypes.tosca.ToscaGetFunctionType;
52 import org.openecomp.sdc.be.impl.ComponentsUtils;
53 import org.openecomp.sdc.be.model.ComponentInstance;
54 import org.openecomp.sdc.be.model.ComponentInstanceProperty;
55 import org.openecomp.sdc.be.model.PropertyDefinition;
56 import org.openecomp.sdc.be.model.Service;
57 import org.openecomp.sdc.be.model.cache.ApplicationDataTypeCache;
58 import org.openecomp.sdc.be.model.dto.FilterConstraintDto;
59 import org.openecomp.sdc.be.model.tosca.ToscaPropertyType;
60 import org.openecomp.sdc.be.model.validation.FilterConstraintValidator;
61 import org.openecomp.sdc.common.impl.ExternalConfiguration;
62 import org.openecomp.sdc.common.impl.FSConfigurationSource;
63 import org.openecomp.sdc.exception.ResponseFormat;
65 class NodeFilterValidatorTest {
67 private static final String INNER_SERVICE = "innerService";
68 private static final String PROPERTY_NAME = "Prop1";
69 private static final String COMPONENT1_ID = "component1";
70 private static final String PARENTSERVICE_ID = "parentservice";
71 private static final String COMPONENT2_ID = "component2";
72 private ComponentsUtils componentsUtils;
75 ApplicationDataTypeCache applicationDataTypeCache;
77 private FilterConstraintValidator filterConstraintValidator;
79 private NodeFilterValidator nodeFilterValidator;
80 private FilterConstraintDto baseFilterConstraintDto;
84 componentsUtils = Mockito.mock(ComponentsUtils.class);
85 MockitoAnnotations.openMocks(this);
86 baseFilterConstraintDto = new FilterConstraintDto();
87 baseFilterConstraintDto.setPropertyName(PROPERTY_NAME);
88 baseFilterConstraintDto.setValueType(FilterValueType.STATIC);
89 baseFilterConstraintDto.setOperator(ConstraintType.EQUAL);
90 baseFilterConstraintDto.setTargetType(PropertyFilterTargetType.PROPERTY);
91 baseFilterConstraintDto.setValue("value");
92 when(applicationDataTypeCache.getAll(any())).thenReturn(Either.left(Map.of()));
93 new ConfigurationManager(new FSConfigurationSource(ExternalConfiguration.getChangeListener(), "src/test/resources/config/catalog-be"));
97 void testValidateComponentInstanceExist() {
98 final ResponseFormat expectedResponse = new ResponseFormat();
99 when(componentsUtils.getResponseFormat(ActionStatus.COMPONENT_INSTANCE_NOT_FOUND, "?", INNER_SERVICE)).thenReturn(expectedResponse);
100 Either<Boolean, ResponseFormat> either =
101 nodeFilterValidator.validateComponentInstanceExist(null, INNER_SERVICE);
102 assertTrue(either.isRight());
103 assertEquals(expectedResponse, either.right().value());
105 Service service = createService("booleanIncorrect");
106 when(componentsUtils.getResponseFormat(ActionStatus.COMPONENT_INSTANCE_NOT_FOUND, service.getName(), INNER_SERVICE))
107 .thenReturn(expectedResponse);
108 either = nodeFilterValidator.validateComponentInstanceExist(service, INNER_SERVICE);
109 assertTrue(either.isRight());
110 assertEquals(expectedResponse, either.right().value());
112 List<ComponentInstance> list = new LinkedList<>();
113 ComponentInstance instance = new ComponentInstance();
114 instance.setUniqueId("uniqueId");
116 service.setComponentInstances(list);
117 either = nodeFilterValidator.validateComponentInstanceExist(service, "uniqueId");
118 assertTrue(either.isLeft());
122 void testValidateNodeFilterStaticIncorrectPropertyTypeProvided() {
123 final Service service = createService("booleanIncorrect");
124 final FilterConstraintDto filterConstraintDto = buildFilterConstraintDto(PROPERTY_NAME, FilterValueType.STATIC, ConstraintType.EQUAL,
125 PropertyFilterTargetType.PROPERTY, "true");
126 Either<Boolean, ResponseFormat> either =
127 nodeFilterValidator.validateFilter(service, INNER_SERVICE, filterConstraintDto);
128 assertTrue(either.isRight());
129 filterConstraintDto.setTargetType(PropertyFilterTargetType.CAPABILITY);
130 either = nodeFilterValidator.validateFilter(service, INNER_SERVICE, filterConstraintDto);
131 assertTrue(either.isRight());
135 void testValidateComponentFilter() {
136 Service service = createService("integer");
137 final var filterConstraint1 = buildFilterConstraintDto(
139 FilterValueType.GET_PROPERTY,
140 ConstraintType.EQUAL,
141 PropertyFilterTargetType.PROPERTY,
142 createToscaGetFunction("test", PropertySource.INSTANCE, ToscaGetFunctionType.GET_PROPERTY, List.of("test2"))
144 Either<Boolean, ResponseFormat> actualValidationResult =
145 nodeFilterValidator.validateSubstitutionFilter(service, Collections.singletonList(filterConstraint1));
146 assertTrue(actualValidationResult.isRight());
148 final var filterConstraint2 = buildFilterConstraintDto(
150 FilterValueType.GET_PROPERTY,
151 ConstraintType.EQUAL,
152 PropertyFilterTargetType.PROPERTY,
153 createToscaGetFunction(PARENTSERVICE_ID, PropertySource.SELF, ToscaGetFunctionType.GET_PROPERTY, List.of("Prop1"))
155 actualValidationResult =
156 nodeFilterValidator.validateSubstitutionFilter(service, Collections.singletonList(filterConstraint2));
157 assertTrue(actualValidationResult.isLeft());
159 final var staticFilter1 = buildFilterConstraintDto(
161 FilterValueType.STATIC,
162 ConstraintType.EQUAL,
163 PropertyFilterTargetType.PROPERTY,
166 actualValidationResult = nodeFilterValidator.validateSubstitutionFilter(service, List.of(staticFilter1));
167 assertTrue(actualValidationResult.isLeft());
168 assertTrue(actualValidationResult.left().value());
170 final var staticFilter2 = buildFilterConstraintDto(
172 FilterValueType.STATIC,
173 ConstraintType.EQUAL,
174 PropertyFilterTargetType.PROPERTY,
177 actualValidationResult = nodeFilterValidator.validateSubstitutionFilter(service, List.of(staticFilter2));
178 assertTrue(actualValidationResult.isRight());
180 service = createService(ToscaPropertyType.BOOLEAN.getType());
181 final var staticFilter3 = buildFilterConstraintDto(
183 FilterValueType.STATIC,
184 ConstraintType.GREATER_THAN,
185 PropertyFilterTargetType.PROPERTY,
188 actualValidationResult = nodeFilterValidator.validateSubstitutionFilter(service, List.of(staticFilter3));
189 assertTrue(actualValidationResult.isRight());
191 final var staticFilter4 = buildFilterConstraintDto(
193 FilterValueType.STATIC,
194 ConstraintType.GREATER_THAN,
195 PropertyFilterTargetType.PROPERTY,
198 actualValidationResult = nodeFilterValidator.validateSubstitutionFilter(service, Collections.singletonList(staticFilter4));
199 assertTrue(actualValidationResult.isRight());
203 void testValidateNodeFilterStaticIncorrectOperatorProvidedBoolean() {
204 Service service = createService(ToscaPropertyType.BOOLEAN.getType());
205 final FilterConstraintDto filterConstraintDto = buildFilterConstraintDto(
207 FilterValueType.STATIC,
208 ConstraintType.GREATER_THAN,
209 PropertyFilterTargetType.PROPERTY,
212 final ResponseFormat expectedResponse = new ResponseFormat();
213 when(componentsUtils.getResponseFormat(ActionStatus.UNSUPPORTED_OPERATOR_PROVIDED, filterConstraintDto.getPropertyName(),
214 filterConstraintDto.getOperator().getType())
215 ).thenReturn(expectedResponse);
216 final Either<Boolean, ResponseFormat> validationResult =
217 nodeFilterValidator.validateFilter(service, INNER_SERVICE, List.of(filterConstraintDto));
218 assertTrue(validationResult.isRight());
219 assertEquals(expectedResponse, validationResult.right().value());
223 void testValidateNodeFilterStaticIncorrectValueProvidedBoolean() {
224 final Service service = createService(ToscaPropertyType.BOOLEAN.getType());
225 baseFilterConstraintDto.setValue("trues");
227 final ResponseFormat responseFormat = new ResponseFormat();
229 .getResponseFormat(eq(ActionStatus.UNSUPPORTED_VALUE_PROVIDED), eq(ToscaPropertyType.BOOLEAN.getType()), eq(PROPERTY_NAME), any())
230 ).thenReturn(responseFormat);
231 final Either<Boolean, ResponseFormat> validationResult =
232 nodeFilterValidator.validateFilter(service, INNER_SERVICE, List.of(baseFilterConstraintDto));
234 assertTrue(validationResult.isRight());
235 assertEquals(responseFormat, validationResult.right().value());
239 void testValidateNodeFilterStaticIncorrectOperatorProvidedString() {
240 Service service = createService(ToscaPropertyType.STRING.getType());
241 baseFilterConstraintDto.setValue("true");
242 baseFilterConstraintDto.setOperator(ConstraintType.GREATER_THAN);
243 Either<Boolean, ResponseFormat> either =
244 nodeFilterValidator.validateFilter(service, INNER_SERVICE, List.of(baseFilterConstraintDto));
246 assertTrue(either.isLeft());
250 void testValidateNodeFilterIntegerValueSuccess() {
251 Service service = createService(ToscaPropertyType.INTEGER.getType());
252 baseFilterConstraintDto.setValue(1);
253 Either<Boolean, ResponseFormat> validationResult =
254 nodeFilterValidator.validateFilter(service, INNER_SERVICE, List.of(baseFilterConstraintDto));
256 assertTrue(validationResult.isLeft());
260 void testValidateNodeFilterIntegerValueFail() {
261 Service service = createService(ToscaPropertyType.INTEGER.getType());
263 baseFilterConstraintDto.setValue(1.0);
265 final ResponseFormat expectedResponse = new ResponseFormat();
266 when(componentsUtils.getResponseFormat(ActionStatus.UNSUPPORTED_VALUE_PROVIDED, ToscaPropertyType.INTEGER.getType(),
267 baseFilterConstraintDto.getPropertyName(), "1.0")
268 ).thenReturn(expectedResponse);
269 Either<Boolean, ResponseFormat> validationResult =
270 nodeFilterValidator.validateFilter(service, INNER_SERVICE, List.of(baseFilterConstraintDto));
272 assertTrue(validationResult.isRight());
273 assertEquals(expectedResponse, validationResult.right().value());
277 void testValidateNodeFilterFloatValueSuccess() {
278 final Service service = createService(ToscaPropertyType.FLOAT.getType());
279 baseFilterConstraintDto.setValue(1.0);
280 final Either<Boolean, ResponseFormat> validationResult =
281 nodeFilterValidator.validateFilter(service, INNER_SERVICE, List.of(baseFilterConstraintDto));
283 assertTrue(validationResult.isLeft());
284 assertTrue(validationResult.left().value());
288 void testValidateNodeFilterFloatValueFail() {
289 Service service = createService(ToscaPropertyType.FLOAT.getType());
291 when(componentsUtils.getResponseFormat(ActionStatus.UNSUPPORTED_VALUE_PROVIDED, "param1")).thenReturn(new ResponseFormat());
293 Either<Boolean, ResponseFormat> either =
294 nodeFilterValidator.validateFilter(service, INNER_SERVICE, List.of(baseFilterConstraintDto));
296 assertTrue(either.isRight());
300 void testValidateNodeFilterStringValueSuccess() {
301 Service service = createService(ToscaPropertyType.STRING.getType());
302 Either<Boolean, ResponseFormat> either =
303 nodeFilterValidator.validateFilter(service, INNER_SERVICE, List.of(baseFilterConstraintDto));
305 assertTrue(either.isLeft());
309 void testValidatePropertyConstraintBrotherSuccess() {
310 Service service = createService(ToscaPropertyType.STRING.getType());
311 final ToscaGetFunctionDataDefinition toscaGetFunction =
312 createToscaGetFunction(COMPONENT2_ID, PropertySource.INSTANCE, ToscaGetFunctionType.GET_PROPERTY, List.of(PROPERTY_NAME));
313 final var filterConstraintDto = buildFilterConstraintDto(
315 FilterValueType.GET_PROPERTY,
316 ConstraintType.EQUAL,
317 PropertyFilterTargetType.PROPERTY,
320 Either<Boolean, ResponseFormat> either =
321 nodeFilterValidator.validateFilter(service, COMPONENT1_ID, List.of(filterConstraintDto));
323 assertTrue(either.isLeft());
324 assertTrue(either.left().value());
328 void testValidatePropertyConstraintParentSuccess() {
329 final var service = createService(ToscaPropertyType.STRING.getType());
330 final ToscaGetFunctionDataDefinition toscaGetFunction =
331 createToscaGetFunction(PARENTSERVICE_ID, PropertySource.SELF, ToscaGetFunctionType.GET_PROPERTY, List.of(PROPERTY_NAME));
332 final var filterConstraintDto = buildFilterConstraintDto(
334 FilterValueType.GET_PROPERTY,
335 ConstraintType.EQUAL,
336 PropertyFilterTargetType.PROPERTY,
339 final Either<Boolean, ResponseFormat> validationResult =
340 nodeFilterValidator.validateFilter(service, COMPONENT1_ID, List.of(filterConstraintDto));
342 assertTrue(validationResult.isLeft());
343 assertTrue(validationResult.left().value());
347 void testValidatePropertyConstraintBrotherPropertyTypeMismatch() {
348 final Service service = createService(ToscaPropertyType.STRING.getType());
349 service.getComponentInstancesProperties().get(COMPONENT2_ID).get(0).setType(ToscaPropertyType.INTEGER.getType());
350 final ToscaGetFunctionDataDefinition toscaGetFunction =
351 createToscaGetFunction(COMPONENT2_ID, PropertySource.INSTANCE, ToscaGetFunctionType.GET_PROPERTY, List.of(PROPERTY_NAME));
352 final var filterConstraintDto = buildFilterConstraintDto(
354 FilterValueType.GET_PROPERTY,
355 ConstraintType.EQUAL,
356 PropertyFilterTargetType.PROPERTY,
360 final ResponseFormat expectedResponse = new ResponseFormat();
361 when(componentsUtils.getResponseFormat(ActionStatus.SOURCE_TARGET_PROPERTY_TYPE_MISMATCH,
362 PROPERTY_NAME, ToscaPropertyType.INTEGER.getType(), PROPERTY_NAME, ToscaPropertyType.STRING.getType())
363 ).thenReturn(expectedResponse);
365 final Either<Boolean, ResponseFormat> either =
366 nodeFilterValidator.validateFilter(service, COMPONENT1_ID, List.of(filterConstraintDto));
368 assertTrue(either.isRight());
369 assertEquals(expectedResponse, either.right().value());
373 void testValidatePropertyConstraintParentPropertyTypeMismatch() {
374 final Service service = createService(ToscaPropertyType.STRING.getType());
375 service.getComponentInstancesProperties().get(COMPONENT1_ID).get(0).setType(ToscaPropertyType.INTEGER.getType());
376 final ToscaGetFunctionDataDefinition toscaGetFunction =
377 createToscaGetFunction(PARENTSERVICE_ID, PropertySource.SELF, ToscaGetFunctionType.GET_PROPERTY, List.of(PROPERTY_NAME));
378 final var filterConstraintDto = buildFilterConstraintDto(
380 FilterValueType.GET_PROPERTY,
381 ConstraintType.EQUAL,
382 PropertyFilterTargetType.PROPERTY,
386 final ResponseFormat expectedResponse = new ResponseFormat();
387 when(componentsUtils.getResponseFormat(ActionStatus.SOURCE_TARGET_PROPERTY_TYPE_MISMATCH,
388 PROPERTY_NAME, ToscaPropertyType.STRING.getType(), PROPERTY_NAME, ToscaPropertyType.INTEGER.getType())
389 ).thenReturn(expectedResponse);
391 Either<Boolean, ResponseFormat> either =
392 nodeFilterValidator.validateFilter(service, COMPONENT1_ID, List.of(filterConstraintDto));
394 assertTrue(either.isRight());
395 assertEquals(expectedResponse, either.right().value());
399 void testValidatePropertyConstraintParentPropertyNotFound() {
400 final Service service = createService(ToscaPropertyType.STRING.getType());
401 service.getComponentInstancesProperties().get(COMPONENT1_ID).get(0).setName("Prop2");
403 final ResponseFormat expectedResponse = new ResponseFormat();
404 when(componentsUtils.getResponseFormat(eq(ActionStatus.FILTER_PROPERTY_NOT_FOUND), any(), any()))
405 .thenReturn(expectedResponse);
407 final ToscaGetFunctionDataDefinition toscaGetFunction =
408 createToscaGetFunction(PARENTSERVICE_ID, PropertySource.SELF, ToscaGetFunctionType.GET_PROPERTY, List.of(PROPERTY_NAME));
409 final var filterConstraintDto = buildFilterConstraintDto(
411 FilterValueType.GET_PROPERTY,
412 ConstraintType.EQUAL,
413 PropertyFilterTargetType.PROPERTY,
416 final Either<Boolean, ResponseFormat> validationResult =
417 nodeFilterValidator.validateFilter(service, COMPONENT1_ID, List.of(filterConstraintDto));
419 assertTrue(validationResult.isRight());
420 assertEquals(expectedResponse, validationResult.right().value());
424 void testValidatePropertyConstraintBrotherPropertyNotFound() {
425 Service service = createService(ToscaPropertyType.STRING.getType());
426 service.getComponentInstancesProperties().get(COMPONENT1_ID).get(0).setName("Prop2");
427 final ToscaGetFunctionDataDefinition toscaGetFunction =
428 createToscaGetFunction(PARENTSERVICE_ID, PropertySource.SELF, ToscaGetFunctionType.GET_PROPERTY, List.of(PROPERTY_NAME));
429 final var filterConstraintDto = buildFilterConstraintDto(
431 FilterValueType.GET_PROPERTY,
432 ConstraintType.EQUAL,
433 PropertyFilterTargetType.PROPERTY,
436 final ResponseFormat expectedResponse = new ResponseFormat();
437 when(componentsUtils.getResponseFormat(ActionStatus.FILTER_PROPERTY_NOT_FOUND, "Target", PROPERTY_NAME))
438 .thenReturn(expectedResponse);
439 Either<Boolean, ResponseFormat> either =
440 nodeFilterValidator.validateFilter(service, COMPONENT1_ID, List.of(filterConstraintDto));
442 assertTrue(either.isRight());
443 assertEquals(expectedResponse, either.right().value());
446 protected static ToscaGetFunctionDataDefinition createToscaGetFunction(final String sourceName,
447 final PropertySource propertySource,
448 final ToscaGetFunctionType toscaGetFunctionType,
449 final List<String> propertyPathFromSource) {
450 final var toscaGetFunction = new ToscaGetFunctionDataDefinition();
451 toscaGetFunction.setFunctionType(toscaGetFunctionType);
452 toscaGetFunction.setPropertyPathFromSource(propertyPathFromSource);
453 toscaGetFunction.setSourceName(sourceName);
454 toscaGetFunction.setPropertySource(propertySource);
455 toscaGetFunction.setPropertyName(propertyPathFromSource.get(0));
456 return toscaGetFunction;
460 void testValidatePropertyConstraintParentPropertySchemaMismatch() {
461 final Service service = createService(ToscaPropertyType.LIST.getType(), ToscaPropertyType.STRING.getType());
462 service.getComponentInstancesProperties().get(COMPONENT1_ID).get(0).setType(ToscaPropertyType.LIST.getType());
463 final var schemaProperty = new PropertyDataDefinition();
464 schemaProperty.setType(ToscaPropertyType.INTEGER.getType());
465 final var schemaDefinition = new SchemaDefinition();
466 schemaDefinition.setProperty(schemaProperty);
467 service.getComponentInstancesProperties().get(COMPONENT1_ID).get(0).setSchema(schemaDefinition);
469 final ToscaGetFunctionDataDefinition toscaGetFunction =
470 createToscaGetFunction(PARENTSERVICE_ID, PropertySource.SELF, ToscaGetFunctionType.GET_PROPERTY, List.of(PROPERTY_NAME));
471 final var filterConstraintDto = buildFilterConstraintDto(
473 FilterValueType.GET_PROPERTY,
474 ConstraintType.EQUAL,
475 PropertyFilterTargetType.PROPERTY,
479 final ResponseFormat expectedResponse = new ResponseFormat();
480 when(componentsUtils.getResponseFormat(ActionStatus.SOURCE_TARGET_SCHEMA_MISMATCH, PROPERTY_NAME, ToscaPropertyType.INTEGER.getType(),
481 PROPERTY_NAME, ToscaPropertyType.STRING.getType())
482 ).thenReturn(expectedResponse);
484 Either<Boolean, ResponseFormat> either =
485 nodeFilterValidator.validateFilter(service, COMPONENT1_ID, List.of(filterConstraintDto));
487 assertTrue(either.isRight());
488 assertEquals(expectedResponse, either.right().value());
491 private Service createService(String type) {
492 return createService(type, null);
495 private Service createService(String type, String schemaType) {
496 Service service = new Service();
497 service.setName(PARENTSERVICE_ID);
499 PropertyDefinition propertyDefinition = new PropertyDefinition();
500 propertyDefinition.setName(PROPERTY_NAME);
501 propertyDefinition.setType(type);
502 if (schemaType != null){
503 SchemaDefinition schemaDefinition = new SchemaDefinition();
504 PropertyDataDefinition schemaProperty = new PropertyDataDefinition();
505 schemaProperty.setType(schemaType);
506 schemaDefinition.setProperty(schemaProperty);
507 propertyDefinition.setSchema(schemaDefinition);
509 service.setProperties(Collections.singletonList(propertyDefinition));
511 ComponentInstance componentInstance = new ComponentInstance();
512 componentInstance.setUniqueId(COMPONENT1_ID);
513 componentInstance.setName(COMPONENT1_ID);
515 ComponentInstance componentInstance2 = new ComponentInstance();
516 componentInstance2.setUniqueId(COMPONENT2_ID);
517 componentInstance2.setName(COMPONENT2_ID);
519 service.setComponentInstances(Arrays.asList(componentInstance, componentInstance2));
521 ComponentInstanceProperty componentInstanceProperty = new ComponentInstanceProperty();
522 componentInstanceProperty.setName(PROPERTY_NAME);
523 componentInstanceProperty.setType(type);
525 ComponentInstanceProperty componentInstanceProperty2 = new ComponentInstanceProperty();
526 componentInstanceProperty2.setName(PROPERTY_NAME);
527 componentInstanceProperty2.setType(type);
529 Map<String, List<ComponentInstanceProperty>> componentInstancePropertyMap = new HashMap<>();
530 componentInstancePropertyMap.put(componentInstance.getUniqueId(),
531 Collections.singletonList(componentInstanceProperty));
532 componentInstancePropertyMap.put(componentInstance2.getUniqueId(),
533 Collections.singletonList(componentInstanceProperty2));
534 componentInstancePropertyMap.put(INNER_SERVICE, Collections.singletonList(componentInstanceProperty));
536 service.setComponentInstancesProperties(componentInstancePropertyMap);
541 private static FilterConstraintDto buildFilterConstraintDto(final String propertyName, final FilterValueType valueType,
542 final ConstraintType constraintType,
543 final PropertyFilterTargetType targetType, Object value) {
544 final var filterConstraintDto = new FilterConstraintDto();
545 filterConstraintDto.setPropertyName(propertyName);
546 filterConstraintDto.setValueType(valueType);
547 filterConstraintDto.setOperator(constraintType);
548 filterConstraintDto.setTargetType(targetType);
549 filterConstraintDto.setValue(value);
550 return filterConstraintDto;