summaryrefslogtreecommitdiffstats
path: root/certService/src
diff options
context:
space:
mode:
Diffstat (limited to 'certService/src')
-rw-r--r--certService/src/main/java/org/onap/aaf/certservice/certification/CsrModelFactory.java6
-rw-r--r--certService/src/main/java/org/onap/aaf/certservice/certification/PemObjectFactory.java2
-rw-r--r--certService/src/main/resources/application.properties1
-rw-r--r--certService/src/test/java/org/onap/aaf/certservice/api/CertificationServiceTest.java2
-rw-r--r--certService/src/test/java/org/onap/aaf/certservice/certification/PemObjectFactoryTest.java4
-rw-r--r--certService/src/test/java/org/onap/aaf/certservice/certification/model/CsrModelTest.java8
6 files changed, 12 insertions, 11 deletions
diff --git a/certService/src/main/java/org/onap/aaf/certservice/certification/CsrModelFactory.java b/certService/src/main/java/org/onap/aaf/certservice/certification/CsrModelFactory.java
index 80858f4d..98daa6eb 100644
--- a/certService/src/main/java/org/onap/aaf/certservice/certification/CsrModelFactory.java
+++ b/certService/src/main/java/org/onap/aaf/certservice/certification/CsrModelFactory.java
@@ -39,14 +39,14 @@ public class CsrModelFactory {
private final PemObjectFactory pemObjectFactory = new PemObjectFactory();
public CsrModel createCsrModel(StringBase64 csr, StringBase64 privateKey) throws CsrDecryptionException {
- LOGGER.debug("Decoded CSR: \n{}", csr.asString());
+ LOGGER.debug("Decoded CSR: \n{}", csr);
try {
- PemObject pemObject = pemObjectFactory.createPmObject(csr.asString());
+ PemObject pemObject = pemObjectFactory.createPemObject(csr.asString());
PKCS10CertificationRequest decodedCsr = new PKCS10CertificationRequest(
pemObject.getContent()
);
- PemObject decodedPrivateKey = pemObjectFactory.createPmObject(privateKey.asString());
+ PemObject decodedPrivateKey = pemObjectFactory.createPemObject(privateKey.asString());
return new CsrModel(decodedCsr, decodedPrivateKey);
} catch (IOException e) {
throw new CsrDecryptionException("Incorrect CSR, decryption failed", e);
diff --git a/certService/src/main/java/org/onap/aaf/certservice/certification/PemObjectFactory.java b/certService/src/main/java/org/onap/aaf/certservice/certification/PemObjectFactory.java
index e3339cc4..08ffc56d 100644
--- a/certService/src/main/java/org/onap/aaf/certservice/certification/PemObjectFactory.java
+++ b/certService/src/main/java/org/onap/aaf/certservice/certification/PemObjectFactory.java
@@ -31,7 +31,7 @@ import org.onap.aaf.certservice.certification.exceptions.CsrDecryptionException;
public class PemObjectFactory {
- public PemObject createPmObject(String pem) throws CsrDecryptionException {
+ public PemObject createPemObject(String pem) throws CsrDecryptionException {
try (StringReader stringReader = new StringReader(pem);
PemReader pemReader = new PemReader(stringReader)) {
diff --git a/certService/src/main/resources/application.properties b/certService/src/main/resources/application.properties
index a157ae66..b9ce108a 100644
--- a/certService/src/main/resources/application.properties
+++ b/certService/src/main/resources/application.properties
@@ -2,3 +2,4 @@
management.endpoints.enabled-by-default=false
management.endpoint.health.enabled=true
springdoc.swagger-ui.path=/docs
+springdoc.show-actuator=true
diff --git a/certService/src/test/java/org/onap/aaf/certservice/api/CertificationServiceTest.java b/certService/src/test/java/org/onap/aaf/certservice/api/CertificationServiceTest.java
index 99ca09b9..9367fcb1 100644
--- a/certService/src/test/java/org/onap/aaf/certservice/api/CertificationServiceTest.java
+++ b/certService/src/test/java/org/onap/aaf/certservice/api/CertificationServiceTest.java
@@ -67,7 +67,7 @@ class CertificationServiceTest {
certificationService.signCertificate("TestCa", "encryptedCSR", "encryptedPK");
// then
- assertEquals(testResponse.getStatusCode(), HttpStatus.OK);
+ assertEquals(HttpStatus.OK, testResponse.getStatusCode());
assertTrue(
testResponse.toString().contains(testStringCsr)
);
diff --git a/certService/src/test/java/org/onap/aaf/certservice/certification/PemObjectFactoryTest.java b/certService/src/test/java/org/onap/aaf/certservice/certification/PemObjectFactoryTest.java
index 67d7f1dc..2fa747db 100644
--- a/certService/src/test/java/org/onap/aaf/certservice/certification/PemObjectFactoryTest.java
+++ b/certService/src/test/java/org/onap/aaf/certservice/certification/PemObjectFactoryTest.java
@@ -46,7 +46,7 @@ class PemObjectFactoryTest {
@Test
void shouldTransformStringInToPemObjectAndBackToString() throws CsrDecryptionException {
// when
- PemObject pemObject = pemObjectFactory.createPmObject(TEST_PEM);
+ PemObject pemObject = pemObjectFactory.createPemObject(TEST_PEM);
String parsedPemObject = pemObjectToString(pemObject);
// then
@@ -57,7 +57,7 @@ class PemObjectFactoryTest {
void shouldThrowExceptionWhenParsingPemFailed() {
// when
Exception exception = assertThrows(
- CsrDecryptionException.class, () -> pemObjectFactory.createPmObject(TEST_WRONG_PEM)
+ CsrDecryptionException.class, () -> pemObjectFactory.createPemObject(TEST_WRONG_PEM)
);
String expectedMessage = "Unable to create PEM";
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 ffce61d8..c6ff2a9f 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
@@ -77,7 +77,7 @@ class CsrModelTest {
.thenReturn(wrongKryInfo);
when(wrongKryInfo.getEncoded())
.thenThrow(new IOException());
- PemObject testPrivateKey = pemObjectFactory.createPmObject(TEST_PK);
+ PemObject testPrivateKey = pemObjectFactory.createPemObject(TEST_PK);
CsrModel csrModel = new CsrModel(testCsr, testPrivateKey);
// when
@@ -96,16 +96,16 @@ class CsrModelTest {
private CsrModel generateTestCsrModel() throws CsrDecryptionException, IOException {
PemObjectFactory pemObjectFactory = new PemObjectFactory();
PKCS10CertificationRequest testCsr = new PKCS10CertificationRequest(
- pemObjectFactory.createPmObject(TEST_CSR).getContent()
+ pemObjectFactory.createPemObject(TEST_CSR).getContent()
);
- PemObject testPrivateKey = pemObjectFactory.createPmObject(TEST_PK);
+ PemObject testPrivateKey = pemObjectFactory.createPemObject(TEST_PK);
return new CsrModel(testCsr, testPrivateKey);
}
private PemObject generateTestPublicKey() throws CsrDecryptionException, IOException {
PemObjectFactory pemObjectFactory = new PemObjectFactory();
PKCS10CertificationRequest testCsr = new PKCS10CertificationRequest(
- pemObjectFactory.createPmObject(TEST_CSR).getContent()
+ pemObjectFactory.createPemObject(TEST_CSR).getContent()
);
return new PemObject("PUBLIC KEY", testCsr.getSubjectPublicKeyInfo().getEncoded());
}