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.cert;
24 import static org.mockito.Mockito.mock;
26 import java.util.List;
28 import org.bouncycastle.pkcs.PKCS10CertificationRequest;
29 import org.junit.BeforeClass;
30 import org.junit.Rule;
31 import org.junit.Test;
32 import org.junit.rules.ExpectedException;
33 import org.junit.runner.RunWith;
34 import org.mockito.runners.MockitoJUnitRunner;
35 import org.onap.aaf.cadi.cm.CertException;
36 import org.onap.aaf.misc.env.Trans;
38 import junit.framework.Assert;
40 @RunWith(MockitoJUnitRunner.class)
41 public class JU_CSRMeta {
43 private static CSRMeta csrmeta;
44 private static Trans trans;
45 private static PKCS10CertificationRequest req;
48 public static void setUp() throws CertException {
49 trans = mock(Trans.class);
50 List<RDN> lrdn = RDN.parse('/',"o=ATT Services, Inc/l=St Louis/st=Missouri/c=US");
52 csrmeta = new CSRMeta(lrdn);
56 // public void x500Name() throws IOException {
58 // X500Name x500 = csrmeta.x500Name();
59 // assertEquals(x500.toString(),"CN=CN,E=pupleti@ht.com,OU=HAKJH787,O=O,L=L,ST=ST,C=C");
63 // public void initialConversationCert() throws CertificateException, OperatorCreationException, IOException {
64 // X509Certificate cert = csrmeta.initialConversationCert(trans);
65 // assertEquals(cert.getBasicConstraints(),-1);
69 // public void generateCSR() throws IOException, CertException {
70 // req = csrmeta.generateCSR(trans);
71 // assertNotNull(req);
75 public ExpectedException thrown= ExpectedException.none();
78 // public void dump() throws IOException, CertException {
79 // req = csrmeta.generateCSR(trans);
83 @Test //TODO: Temporary fix AAF-111
84 public void netYetTested() {
85 Assert.fail("Tests not yet implemented");