1 /*******************************************************************************
 
   2  *  ============LICENSE_START=======================================================
 
   4  *  ================================================================================
 
   5  *   Copyright (C) 2022 Huawei Canada Limited.
 
   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  *******************************************************************************/
 
  22 package org.onap.slice.analysis.ms.service.ccvpn;
 
  24 import org.junit.Before;
 
  25 import org.junit.Test;
 
  26 import org.junit.runner.RunWith;
 
  27 import org.mockito.InjectMocks;
 
  28 import org.mockito.Mockito;
 
  29 import org.mockito.MockitoAnnotations;
 
  30 import org.mockito.Spy;
 
  31 import org.springframework.boot.test.context.SpringBootTest;
 
  32 import org.springframework.test.context.junit4.SpringRunner;
 
  33 import static org.mockito.Mockito.mock;
 
  35 @RunWith(SpringRunner.class)
 
  36 @SpringBootTest(classes = BandwidthEvaluatorTest.class)
 
  37 public class BandwidthEvaluatorTest {
 
  41     BandwidthEvaluator bandwidthEvaluator;
 
  45         MockitoAnnotations.initMocks(this);
 
  49     public void initTest(){
 
  50         bandwidthEvaluator.init();
 
  51         Mockito.verify(bandwidthEvaluator, Mockito.atLeastOnce()).init();
 
  55     public void stopTest(){
 
  56         bandwidthEvaluator.init();
 
  57         bandwidthEvaluator.stop();
 
  58         Mockito.verify(bandwidthEvaluator, Mockito.atLeastOnce()).stop();
 
  62     public void postTest() {
 
  63         Event evt = new SimpleEvent(null, "{}");
 
  64         bandwidthEvaluator.post(evt);
 
  65         Mockito.verify(bandwidthEvaluator, Mockito.atLeastOnce()).post(Mockito.any(Event.class));