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 ******************************************************************************/
22 package org.onap.aaf.auth.cm.data;
24 import static org.junit.Assert.*;
25 import static org.mockito.Mockito.mock;
26 import static org.mockito.Mockito.when;
28 import java.io.IOException;
29 import java.security.cert.X509Certificate;
30 import java.util.ArrayList;
31 import java.util.List;
33 import org.junit.BeforeClass;
34 import org.junit.Test;
35 import org.junit.runner.RunWith;
36 import org.mockito.Mock;
37 import org.mockito.Mockito;
38 import org.mockito.runners.MockitoJUnitRunner;
39 import org.onap.aaf.auth.cm.ca.CA;
40 import org.onap.aaf.auth.cm.ca.X509andChain;
41 import org.onap.aaf.auth.cm.cert.BCFactory;
42 import org.onap.aaf.auth.cm.cert.CSRMeta;
43 import org.onap.aaf.auth.cm.data.CertReq;
44 import org.onap.aaf.cadi.cm.CertException;
45 import org.onap.aaf.misc.env.Trans;
47 @RunWith(MockitoJUnitRunner.class)
48 public class JU_CertReq {
50 private static BCFactory bcFact;
52 private static CSRMeta value;
54 private static CertReq req;
57 public static void setUp() {
58 bcFact = mock(BCFactory.class);
59 value = mock(CSRMeta.class);
60 req = mock(CertReq.class);
65 // public void getCSRMeta() throws CertException, IOException {
66 // //req = new CertReq();
67 // req.mechid = "1213";
68 // List<String> fqdnsas = new ArrayList<String>();
69 // fqdnsas.add("String1");
70 // List<String> emails = new ArrayList<String>();
71 // emails.add("pupleti@hotmail.com");
72 // req.emails = emails;
73 // req.fqdns = fqdnsas;
74 // req.certAuthority = new CA(null, "testName", "ALL") {
75 // //TODO: Gabe [JUnit] REREVIEW
77 // public X509andChain sign(Trans trans, CSRMeta csrmeta) throws IOException, CertException {
82 // req.sponsor = "asa@df.co";
83 // assertNull(req.getCSRMeta());
86 @Test //TODO: Temporary fix AAF-111
87 public void netYetTested() {
88 fail("Tests not yet implemented");