diff options
Diffstat (limited to 'certService/src/test')
2 files changed, 18 insertions, 19 deletions
diff --git a/certService/src/test/java/org/onap/aaf/certservice/certification/adapter/CSRMetaBuilderTest.java b/certService/src/test/java/org/onap/aaf/certservice/certification/adapter/CSRMetaBuilderTest.java index d3f8cc65..adb89b31 100644 --- a/certService/src/test/java/org/onap/aaf/certservice/certification/adapter/CSRMetaBuilderTest.java +++ b/certService/src/test/java/org/onap/aaf/certservice/certification/adapter/CSRMetaBuilderTest.java @@ -72,14 +72,14 @@ public class CSRMetaBuilderTest { CSRMeta createdCSRMeta = csrMetaBuilder.build(testCsrModel, testServer); // Then - assertThat(createdCSRMeta.password()).isEqualTo(testServer.getAuthentication().getIak()); - assertThat(createdCSRMeta.senderKid()).isEqualTo(testServer.getAuthentication().getRv()); - assertThat(createdCSRMeta.caUrl()).isEqualTo(testServer.getUrl()); - assertThat(createdCSRMeta.sans()).containsAll(testSans); - assertThat(createdCSRMeta.keyPair().getPrivate()).isEqualTo(mockPrivateKey); - assertThat(createdCSRMeta.keyPair().getPublic()).isEqualTo(mockPublicKey); - assertThat(createdCSRMeta.x500Name()).isEqualTo(TEST_SUBJECT_DATA); - assertThat(createdCSRMeta.issuerx500Name()).isEqualTo(TEST_SUBJECT_DATA); + assertThat(createdCSRMeta.getPassword()).isEqualTo(testServer.getAuthentication().getIak()); + assertThat(createdCSRMeta.getSenderKid()).isEqualTo(testServer.getAuthentication().getRv()); + assertThat(createdCSRMeta.getCaUrl()).isEqualTo(testServer.getUrl()); + assertThat(createdCSRMeta.getSans()).containsAll(testSans); + assertThat(createdCSRMeta.getKeyPair().getPrivate()).isEqualTo(mockPrivateKey); + assertThat(createdCSRMeta.getKeyPair().getPublic()).isEqualTo(mockPublicKey); + assertThat(createdCSRMeta.getX500Name()).isEqualTo(TEST_SUBJECT_DATA); + assertThat(createdCSRMeta.getIssuerX500Name()).isEqualTo(TEST_SUBJECT_DATA); } private Cmpv2Server createTestServer() { diff --git a/certService/src/test/java/org/onap/aaf/certservice/cmpv2Client/Cmpv2ClientTest.java b/certService/src/test/java/org/onap/aaf/certservice/cmpv2Client/Cmpv2ClientTest.java index 713a2d00..a2f3050f 100644 --- a/certService/src/test/java/org/onap/aaf/certservice/cmpv2Client/Cmpv2ClientTest.java +++ b/certService/src/test/java/org/onap/aaf/certservice/cmpv2Client/Cmpv2ClientTest.java @@ -89,7 +89,7 @@ class Cmpv2ClientTest { KeyPairGenerator keyGenerator; keyGenerator = KeyPairGenerator.getInstance("RSA", BouncyCastleProvider.PROVIDER_NAME); keyGenerator.initialize(2048); - keyPair = LoadKeyPair(); + keyPair = loadKeyPair(); rdns = new ArrayList<>(); try { rdns.add(new RDN("O=CommonCompany")); @@ -99,7 +99,7 @@ class Cmpv2ClientTest { initMocks(this); } - public KeyPair LoadKeyPair() + public KeyPair loadKeyPair() throws IOException, NoSuchAlgorithmException, InvalidKeySpecException, NoSuchProviderException { @@ -307,16 +307,15 @@ class Cmpv2ClientTest { Date notBefore, Date notAfter) { csrMeta = new CSRMeta(rdns); - csrMeta.cn(cn); - csrMeta.san(san); - csrMeta.password(password); - csrMeta.email(email); - csrMeta.issuerCn(issuerCn); + csrMeta.setCn(cn); + csrMeta.addSan(san); + csrMeta.setPassword(password); + csrMeta.setEmail(email); + csrMeta.setIssuerCn(issuerCn); when(kpg.generateKeyPair()).thenReturn(keyPair); - csrMeta.keypair(); - csrMeta.caUrl(externalCaUrl); - csrMeta.senderKid(senderKid); - + csrMeta.getKeyPairOrGenerateIfNull(); + csrMeta.setCaUrl(externalCaUrl); + csrMeta.setSenderKid(senderKid); this.notBefore = notBefore; this.notAfter = notAfter; } |