summaryrefslogtreecommitdiffstats
path: root/certService/src/test/java/org/onap/aaf/certservice/certification/model/CsrModelTest.java
diff options
context:
space:
mode:
authorBartosz Gardziejewski <bartosz.gardziejewski@nokia.com>2020-02-12 11:53:42 +0100
committerBartosz Gardziejewski <bartosz.gardziejewski@nokia.com>2020-02-13 10:53:19 +0100
commit1d90088826d5bb2f141be9683d9e31b606fca978 (patch)
treee2cf2fb2f81f607ed0f8142ee08bd9879355cbcb /certService/src/test/java/org/onap/aaf/certservice/certification/model/CsrModelTest.java
parent41a5418f3d93fb09d5544c2070b42d5d5f4e216a (diff)
Return hardcoded CA certs and certification chain.
Issue-ID: AAF-995 Signed-off-by: Bartosz Gardziejewski <bartosz.gardziejewski@nokia.com> Change-Id: I38b498c4deeedc4ea4323065c5f7b5ddd137209f
Diffstat (limited to 'certService/src/test/java/org/onap/aaf/certservice/certification/model/CsrModelTest.java')
-rw-r--r--certService/src/test/java/org/onap/aaf/certservice/certification/model/CsrModelTest.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/certService/src/test/java/org/onap/aaf/certservice/certification/model/CsrModelTest.java b/certService/src/test/java/org/onap/aaf/certservice/certification/model/CsrModelTest.java
index c6ff2a9f..9d748150 100644
--- a/certService/src/test/java/org/onap/aaf/certservice/certification/model/CsrModelTest.java
+++ b/certService/src/test/java/org/onap/aaf/certservice/certification/model/CsrModelTest.java
@@ -26,6 +26,8 @@ import org.bouncycastle.util.io.pem.PemObject;
import org.junit.jupiter.api.Test;
import org.onap.aaf.certservice.certification.PemObjectFactory;
import org.onap.aaf.certservice.certification.exceptions.CsrDecryptionException;
+import org.onap.aaf.certservice.certification.exceptions.DecryptionException;
+import org.onap.aaf.certservice.certification.exceptions.PemDecryptionException;
import java.io.IOException;
@@ -44,7 +46,7 @@ class CsrModelTest {
@Test
- void shouldByConstructedAndReturnProperFields() throws CsrDecryptionException, IOException {
+ void shouldByConstructedAndReturnProperFields() throws DecryptionException, IOException {
// given
PemObject testPublicKey = generateTestPublicKey();
@@ -68,7 +70,7 @@ class CsrModelTest {
}
@Test
- void shouldThrowExceptionWhenKeyIsNotCorrect() throws IOException, CsrDecryptionException {
+ void shouldThrowExceptionWhenKeyIsNotCorrect() throws PemDecryptionException ,IOException {
// given
PemObjectFactory pemObjectFactory = new PemObjectFactory();
PKCS10CertificationRequest testCsr = mock(PKCS10CertificationRequest.class);
@@ -93,7 +95,7 @@ class CsrModelTest {
assertTrue(actualMessage.contains(expectedMessage));
}
- private CsrModel generateTestCsrModel() throws CsrDecryptionException, IOException {
+ private CsrModel generateTestCsrModel() throws PemDecryptionException, IOException {
PemObjectFactory pemObjectFactory = new PemObjectFactory();
PKCS10CertificationRequest testCsr = new PKCS10CertificationRequest(
pemObjectFactory.createPemObject(TEST_CSR).getContent()
@@ -102,7 +104,7 @@ class CsrModelTest {
return new CsrModel(testCsr, testPrivateKey);
}
- private PemObject generateTestPublicKey() throws CsrDecryptionException, IOException {
+ private PemObject generateTestPublicKey() throws PemDecryptionException, IOException {
PemObjectFactory pemObjectFactory = new PemObjectFactory();
PKCS10CertificationRequest testCsr = new PKCS10CertificationRequest(
pemObjectFactory.createPemObject(TEST_CSR).getContent()