2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 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.so.client.orchestration;
23 import static org.junit.Assert.assertTrue;
24 import static org.mockito.Matchers.eq;
25 import static org.mockito.Mockito.doReturn;
26 import static org.mockito.ArgumentMatchers.any;
28 import java.util.UUID;
30 import org.junit.Before;
31 import org.junit.Test;
32 import org.junit.runner.RunWith;
33 import org.mockito.InjectMocks;
34 import org.mockito.Mock;
35 import org.mockito.junit.MockitoJUnitRunner;
36 import org.onap.so.bpmn.common.data.TestDataSetup;
37 import org.onap.so.bpmn.common.InjectionHelper;
38 import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
39 import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
40 import org.onap.so.client.sdno.SDNOValidator;
42 @RunWith(MockitoJUnitRunner.Silent.class)
43 public class SDNOHealthCheckResourcesTest extends TestDataSetup{
45 private SDNOHealthCheckResources sdnoHealthCheckResources = new SDNOHealthCheckResources();
47 private GenericVnf genericVnf;
48 private RequestContext requestContext;
51 protected SDNOValidator MOCK_sdnoValidator;
54 protected InjectionHelper MOCK_injectionHelper;
57 public void before() {
58 genericVnf = buildGenericVnf();
59 requestContext = buildRequestContext();
60 doReturn(MOCK_sdnoValidator).when(MOCK_injectionHelper).getSdnoValidator();
64 public void healthCheckTest() throws Exception {
65 doReturn(true).when(MOCK_sdnoValidator).healthDiagnostic(any(String.class), any(UUID.class), any(String.class));
66 assertTrue(sdnoHealthCheckResources.healthCheck(genericVnf, requestContext));