1 /*******************************************************************************
2 * ============LICENSE_START====================================================
4 * * ===========================================================================
5 * * Copyright © 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 ******************************************************************************/
23 package org.onap.aaf.auth.cm.api;
25 import static org.mockito.Mockito.mock;
27 import javax.servlet.http.HttpServletRequest;
28 import javax.servlet.http.HttpServletResponse;
30 import org.junit.BeforeClass;
31 import org.junit.Rule;
32 import org.junit.Test;
33 import org.junit.rules.ExpectedException;
34 import org.junit.runner.RunWith;
35 import org.mockito.Mock;
36 import org.mockito.runners.MockitoJUnitRunner;
37 import org.onap.aaf.auth.cm.AAF_CM;
38 import org.onap.aaf.auth.env.AuthzTrans;
40 import junit.framework.Assert;
43 @RunWith(MockitoJUnitRunner.class)
44 public class JU_API_Artifact {
47 private static API_Artifact api;
50 private static AAF_CM certManApi;
52 private static AAF_CM noMockAPI;
53 private static API_Artifact api_1;
55 private static HttpServletRequest req;
56 private static HttpServletResponse res;
59 public static void setUp() {
60 AuthzTrans trans = mock(AuthzTrans.class);
61 req = mock(HttpServletRequest.class);
62 res = mock(HttpServletResponse.class);
63 trans.setProperty("testTag", "UserValue");
68 public ExpectedException thrown= ExpectedException.none();
71 public void placeholder() {
72 Assert.assertTrue(true);
76 * These fail in builds. Need something better.
78 * Also, they don't do much. Just catch some null pointers.
80 public void init_bothValued() {
83 } catch (Exception e) {
84 thrown.expect(NullPointerException.class);
90 public void init_Null_() {
93 } catch (Exception e) {
94 //thrown.expect(Exception.class);
100 public void init_NMC_Null() {
103 } catch (Exception e) {
104 //thrown.expect(NullPointerException.class);
110 public void init_NMC() {
112 api_1.init(noMockAPI);
113 } catch (Exception e) {
114 //thrown.expect(NullPointerException.class);