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.sdnc.SdncRequest;
 
  31 public class BandwidthOnDemandOperationTest extends BasicSdncOperation {
 
  33     private BandwidthOnDemandOperation oper;
 
  35     public BandwidthOnDemandOperationTest() {
 
  36         super(DEFAULT_ACTOR, BandwidthOnDemandOperation.NAME);
 
  43     public void setUp() throws Exception {
 
  45         oper = new BandwidthOnDemandOperation(params, operator);
 
  49     public void testBandwidthOnDemandOperator() {
 
  50         assertEquals(DEFAULT_ACTOR, oper.getActorName());
 
  51         assertEquals(BandwidthOnDemandOperation.NAME, oper.getName());
 
  55     public void testMakeRequest() throws Exception {
 
  56         SdncRequest request = oper.makeRequest(1);
 
  57         assertEquals("my-service", request.getNsInstanceId());
 
  58         assertEquals(REQ_ID, request.getRequestId());
 
  59         assertEquals(BandwidthOnDemandOperation.URI, request.getUrl());
 
  60         assertNotNull(request.getHealRequest().getRequestHeaderInfo().getSvcRequestId());
 
  62         verifyRequest("bod.json", request, IGNORE_FIELDS);
 
  64         verifyMissing(BandwidthOnDemandOperation.SERVICE_ID_KEY, "service", BandwidthOnDemandOperation::new);
 
  66         // perform the operation
 
  68         verifyRequest("bod.json", verifyOperation(oper), IGNORE_FIELDS);
 
  72     protected Map<String, String> makeEnrichment() {
 
  73         return Map.of(BandwidthOnDemandOperation.SERVICE_ID_KEY, "my-service", BandwidthOnDemandOperation.VNF_ID,