2 * ============LICENSE_START=======================================================
 
   4 * ================================================================================
 
   5 * Copyright 2018 TechMahindra
 
   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=========================================================
 
  20 package org.onap.dcaegen2.ves.domain;
 
  22 import static org.junit.Assert.*;
 
  24 import java.util.HashMap;
 
  25 import java.util.List;
 
  28 import org.junit.Test;
 
  29 import org.springframework.beans.factory.annotation.Autowired;
 
  31 public class ThresholdCrossingAlertFieldsTest {
 
  34         ThresholdCrossingAlertFields thresholdCrossingAlertFields =new ThresholdCrossingAlertFields();
 
  35         List<String> associatedAlertIdList;
 
  36         List<AdditionalParameter> additionalParameters;
 
  37         List<AdditionalField> additionalFields;
 
  38         Map<String, Object> additionalProperties = new HashMap<String, Object>();
 
  42                 thresholdCrossingAlertFields.setAdditionalFields(additionalFields);
 
  43                 thresholdCrossingAlertFields.setAdditionalParameters(additionalParameters);
 
  44                 thresholdCrossingAlertFields.setAdditionalProperty("name", value);
 
  45                 thresholdCrossingAlertFields.setAlertAction("test");
 
  46                 thresholdCrossingAlertFields.setAlertDescription("test");
 
  47                 thresholdCrossingAlertFields.setAlertType("test");
 
  48                 thresholdCrossingAlertFields.setAlertValue("test");
 
  49                 thresholdCrossingAlertFields.setAssociatedAlertIdList(associatedAlertIdList);
 
  50                 thresholdCrossingAlertFields.setCollectionTimestamp("test");
 
  51                 thresholdCrossingAlertFields.setDataCollector("test");
 
  52                 thresholdCrossingAlertFields.setElementType("test");
 
  53                 thresholdCrossingAlertFields.setEventSeverity("test");
 
  54                 thresholdCrossingAlertFields.setEventStartTimestamp("test");
 
  55                 thresholdCrossingAlertFields.setInterfaceName("test");
 
  56                 thresholdCrossingAlertFields.setNetworkService("test");
 
  57                 thresholdCrossingAlertFields.setPossibleRootCause("test");
 
  58                 thresholdCrossingAlertFields.setThresholdCrossingFieldsVersion(2.2);
 
  60                 additionalProperties.put("name", value);
 
  61                 assertEquals(additionalFields, thresholdCrossingAlertFields.getAdditionalFields());
 
  62                 assertEquals("test", thresholdCrossingAlertFields.getAlertAction());
 
  63                 assertEquals("test", thresholdCrossingAlertFields.getAlertDescription());
 
  64                 assertEquals("test", thresholdCrossingAlertFields.getAlertType());
 
  65                 assertEquals("test", thresholdCrossingAlertFields.getAlertValue());
 
  66                 assertEquals("test", thresholdCrossingAlertFields.getCollectionTimestamp());
 
  67                 assertEquals("test", thresholdCrossingAlertFields.getDataCollector());
 
  68                 assertEquals("test", thresholdCrossingAlertFields.getElementType());
 
  69                 assertEquals("test", thresholdCrossingAlertFields.getEventSeverity());
 
  70                 assertEquals("test", thresholdCrossingAlertFields.getEventStartTimestamp());
 
  71                 assertEquals("test", thresholdCrossingAlertFields.getInterfaceName());
 
  72                 assertEquals("test", thresholdCrossingAlertFields.getNetworkService());
 
  73                 assertEquals("test", thresholdCrossingAlertFields.getPossibleRootCause());
 
  74                 assertEquals(new Double(2.2), thresholdCrossingAlertFields.getThresholdCrossingFieldsVersion());
 
  75                 assertEquals(associatedAlertIdList, thresholdCrossingAlertFields.getAssociatedAlertIdList());
 
  76                 assertEquals(additionalProperties, thresholdCrossingAlertFields.getAdditionalProperties());
 
  77                 assertEquals(additionalParameters, thresholdCrossingAlertFields.getAdditionalParameters());