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.assertFalse;
 
  25 import static org.junit.Assert.assertTrue;
 
  28 import java.util.TreeMap;
 
  29 import org.junit.Before;
 
  30 import org.junit.Test;
 
  31 import org.onap.policy.sdnc.SdncRequest;
 
  33 public class SdncOperationTest extends BasicSdncOperation {
 
  35     private SdncRequest request;
 
  36     private SdncOperation oper;
 
  42     public void setUp() throws Exception {
 
  45         oper = new SdncOperation(params, operator) {
 
  47             protected SdncRequest makeRequest(int attempt) {
 
  54     public void testSdncOperator() {
 
  55         assertEquals(DEFAULT_ACTOR, oper.getActorName());
 
  56         assertEquals(DEFAULT_OPERATION, oper.getName());
 
  60     public void testStartOperationAsync_testStartRequestAsync() throws Exception {
 
  61         verifyOperation(oper);
 
  65     public void testIsSuccess() {
 
  67         response.getResponseOutput().setResponseCode("200");
 
  68         assertTrue(oper.isSuccess(null, response));
 
  71         response.getResponseOutput().setResponseCode("555");
 
  72         assertFalse(oper.isSuccess(null, response));
 
  75         response.getResponseOutput().setResponseCode(null);
 
  76         assertFalse(oper.isSuccess(null, response));
 
  79         response.setResponseOutput(null);
 
  80         assertFalse(oper.isSuccess(null, response));
 
  84     protected Map<String, String> makeEnrichment() {
 
  85         return new TreeMap<>();