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.isA;
25 import static org.mockito.Mockito.doReturn;
27 import java.util.UUID;
29 import org.junit.Before;
30 import org.junit.Test;
31 import org.junit.runner.RunWith;
32 import org.mockito.InjectMocks;
33 import org.mockito.Mock;
34 import org.mockito.runners.MockitoJUnitRunner;
35 import org.onap.so.bpmn.common.data.TestDataSetup;
36 import org.onap.so.bpmn.common.InjectionHelper;
37 import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf;
38 import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext;
39 import org.onap.so.client.sdno.SDNOValidator;
41 @RunWith(MockitoJUnitRunner.class)
42 public class SDNOHealthCheckResourcesTest extends TestDataSetup{
44 private SDNOHealthCheckResources sdnoHealthCheckResources = new SDNOHealthCheckResources();
46 private GenericVnf genericVnf;
47 private RequestContext requestContext;
50 protected SDNOValidator MOCK_sdnoValidator;
53 protected InjectionHelper MOCK_injectionHelper;
56 public void before() {
57 genericVnf = buildGenericVnf();
58 requestContext = buildRequestContext();
59 doReturn(MOCK_sdnoValidator).when(MOCK_injectionHelper).getSdnoValidator();
63 public void healthCheckTest() throws Exception {
64 doReturn(true).when(MOCK_sdnoValidator).healthDiagnostic(isA(String.class), isA(UUID.class), isA(String.class));
65 assertTrue(sdnoHealthCheckResources.healthCheck(genericVnf, requestContext));