2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2020 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.onap.policy.controlloop.actor.sdnc;
23 import static org.junit.Assert.assertEquals;
24 import static org.junit.Assert.assertNotNull;
27 import org.junit.Before;
28 import org.junit.Test;
29 import org.onap.policy.common.utils.coder.CoderException;
30 import org.onap.policy.sdnc.SdncRequest;
32 public class BandwidthOnDemandOperatorTest extends BasicOperator {
34 private BandwidthOnDemandOperator oper;
43 oper = new BandwidthOnDemandOperator(ACTOR);
47 public void testBandwidthOnDemandOperator() {
48 assertEquals(ACTOR, oper.getActorName());
49 assertEquals(BandwidthOnDemandOperator.NAME, oper.getName());
53 public void testConstructRequest() throws CoderException {
54 SdncRequest request = oper.constructRequest(context);
55 assertEquals("my-service", request.getNsInstanceId());
56 assertEquals(REQ_ID, request.getRequestId());
57 assertEquals(BandwidthOnDemandOperator.URI, request.getUrl());
58 assertNotNull(request.getHealRequest().getRequestHeaderInfo().getSvcRequestId());
60 verifyRequest("bod.json", request);
62 verifyMissing(oper, BandwidthOnDemandOperator.SERVICE_ID_KEY, "service");
66 protected Map<String, String> makeEnrichment() {
67 return Map.of(BandwidthOnDemandOperator.SERVICE_ID_KEY, "my-service", BandwidthOnDemandOperator.VNF_ID,