summaryrefslogtreecommitdiffstats
path: root/certService/src/test
diff options
context:
space:
mode:
authorBartosz Gardziejewski <bartosz.gardziejewski@nokia.com>2020-02-12 07:49:02 +0100
committerBartosz Gardziejewski <bartosz.gardziejewski@nokia.com>2020-02-12 08:02:28 +0100
commitc88b66b45d24af033587f3c5020991460ac58302 (patch)
treefc81812bedb7c31c6eae04301d82084995a1f9de /certService/src/test
parentab3855c97a649398d75e31e68528f9c82f0f9e4f (diff)
Generate openAPI 3.0 specification.
Issue-ID: AAF-995 Signed-off-by: Bartosz Gardziejewski <bartosz.gardziejewski@nokia.com> Change-Id: I3de5dae9688d89b3bac0d86beff982247667854d
Diffstat (limited to 'certService/src/test')
-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
3 files changed, 7 insertions, 7 deletions
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());
}