2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2022 AT&T Intellectual Property. All rights reserved.
4 * Modifications Copyright (C) 2024 Nordix Foundation
5 * ================================================================================
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 * ============LICENSE_END=========================================================
20 package org.onap.policy.controlloop.actor.cds.properties;
22 import static org.junit.jupiter.api.Assertions.assertEquals;
24 import java.util.HashMap;
26 import org.junit.jupiter.api.Test;
27 import org.onap.policy.controlloop.actorserviceprovider.TargetType;
28 import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams;
30 class GrpcOperationPropertiesTest {
34 ControlLoopOperationParams params = ControlLoopOperationParams.builder().targetType(TargetType.VNF).build();
35 assertEquals(GrpcOperationTargetVnfProperties.VNF_PROPERTY_NAMES,
36 GrpcOperationProperties.build(params).getPropertyNames());
38 Map<String, String> targetEntityIds = new HashMap<>();
39 targetEntityIds.put(ControlLoopOperationParams.PARAMS_ENTITY_RESOURCEID, "R");
41 params = ControlLoopOperationParams.builder()
42 .targetType(TargetType.VNF)
43 .targetEntityIds(targetEntityIds)
45 assertEquals(GrcpOperationResourceVnfProperties.VNF_PROPERTY_NAMES,
46 GrpcOperationProperties.build(params).getPropertyNames());
48 params = ControlLoopOperationParams.builder().targetType(TargetType.PNF).build();
49 assertEquals(GrpcOperationPnfProperties.PNF_PROPERTY_NAMES,
50 GrpcOperationProperties.build(params).getPropertyNames());
52 params = ControlLoopOperationParams.builder()
53 .targetType(TargetType.VFC)
54 .targetEntityIds(targetEntityIds)
56 assertEquals(GrcpOperationResourceVnfProperties.VNF_PROPERTY_NAMES,
57 GrpcOperationProperties.build(params).getPropertyNames());