* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
static X509andChain cert1;
static byte [] name = {1,23,4,54,6,56};
static X509andChain cert1;
static byte [] name = {1,23,4,54,6,56};
@BeforeClass
public static void setUp() throws CertificateException, CertException, IOException {
String str = "core java api";
@BeforeClass
public static void setUp() throws CertificateException, CertException, IOException {
String str = "core java api";
req = mock(HttpServletRequest.class);
localCA = mock(LocalCA.class);
X509Certificate cert = new X509Certificate() {
req = mock(HttpServletRequest.class);
localCA = mock(LocalCA.class);
X509Certificate cert = new X509Certificate() {
@Override
public void verify(PublicKey key, String sigProvider) throws CertificateException, NoSuchAlgorithmException,
InvalidKeyException, NoSuchProviderException, SignatureException {
@Override
public void verify(PublicKey key, String sigProvider) throws CertificateException, NoSuchAlgorithmException,
InvalidKeyException, NoSuchProviderException, SignatureException {
@Override
public void verify(PublicKey key) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException,
NoSuchProviderException, SignatureException {
@Override
public void verify(PublicKey key) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException,
NoSuchProviderException, SignatureException {
}
};
X509andChain xac = new X509andChain(cert, new ArrayList<>());
when(localCA.sign(Mockito.any(Trans.class), Mockito.any(CSRMeta.class))).thenReturn(xac);
certDAO = mock(CachedCertDAO.class, CALLS_REAL_METHODS);
}
}
};
X509andChain xac = new X509andChain(cert, new ArrayList<>());
when(localCA.sign(Mockito.any(Trans.class), Mockito.any(CSRMeta.class))).thenReturn(xac);
certDAO = mock(CachedCertDAO.class, CALLS_REAL_METHODS);
}
@Test
public void identity_True() throws CertificateException, IOException, CertException {
assertNotNull(localCA.sign(trans, csrMeta));
}
@Test
public void identity_True() throws CertificateException, IOException, CertException {
assertNotNull(localCA.sign(trans, csrMeta));
}
@Test
public void identityNull() throws CertificateException {
try {
assertNotNull(localCA.sign(null, csrMeta));
} catch (IOException e) {
@Test
public void identityNull() throws CertificateException {
try {
assertNotNull(localCA.sign(null, csrMeta));
} catch (IOException e) {
@Test
public void identityBothNull() throws CertificateException {
try {
assertNotNull(localCA.sign(null, null));
} catch (IOException e) {
@Test
public void identityBothNull() throws CertificateException {
try {
assertNotNull(localCA.sign(null, null));
} catch (IOException e) {