aboutsummaryrefslogtreecommitdiffstats
path: root/certServiceClient
diff options
context:
space:
mode:
authorPiotr Marcinkiewicz <piotr.marcinkiewicz@nokia.com>2020-06-24 14:06:48 +0200
committerPiotr Marcinkiewicz <piotr.marcinkiewicz@nokia.com>2020-06-25 09:00:36 +0200
commit34d11834cbe76992246f3a4c5df5807af2e7d0d2 (patch)
tree6026a29b559732d614d17004c2588486d0c9ce81 /certServiceClient
parentffa2b75513bac0ac7aa39bdb6d0b77f751735c5e (diff)
Fix checkstyle warnings1.1.0
Issue-ID: AAF-1152 Signed-off-by: Piotr Marcinkiewicz <piotr.marcinkiewicz@nokia.com> Change-Id: I77777db7080000c22ef3db9ff8e755dac8258c9e
Diffstat (limited to 'certServiceClient')
-rw-r--r--certServiceClient/src/main/java/org/onap/aaf/certservice/client/api/ExitableException.java4
-rw-r--r--certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/CsrFactory.java8
-rw-r--r--certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/exception/CertFileWriterException.java4
-rw-r--r--certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/exception/CsrGenerationException.java4
-rw-r--r--certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/exception/PemConversionException.java4
-rw-r--r--certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/exception/PkEncodingException.java4
-rw-r--r--certServiceClient/src/main/java/org/onap/aaf/certservice/client/configuration/factory/SslContextFactory.java4
-rw-r--r--certServiceClient/src/main/java/org/onap/aaf/certservice/client/httpclient/exception/HttpClientException.java4
-rw-r--r--certServiceClient/src/test/java/org/onap/aaf/certservice/client/certification/writer/CertFileWriterTest.java2
-rw-r--r--certServiceClient/src/test/java/org/onap/aaf/certservice/client/configuration/EnvsForCsrTest.java8
-rw-r--r--certServiceClient/src/test/java/org/onap/aaf/certservice/client/configuration/factory/CsrConfigurationFactoryTest.java4
-rw-r--r--certServiceClient/src/test/java/org/onap/aaf/certservice/client/configuration/factory/SslContextFactoryTest.java2
12 files changed, 26 insertions, 26 deletions
diff --git a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/api/ExitableException.java b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/api/ExitableException.java
index 439c0488..3a7a542b 100644
--- a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/api/ExitableException.java
+++ b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/api/ExitableException.java
@@ -20,8 +20,8 @@
package org.onap.aaf.certservice.client.api;
public abstract class ExitableException extends Exception {
- public ExitableException(Throwable e) {
- super(e);
+ public ExitableException(Throwable cause) {
+ super(cause);
}
public ExitableException(String message) {
diff --git a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/CsrFactory.java b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/CsrFactory.java
index e381a8ce..0faf5cab 100644
--- a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/CsrFactory.java
+++ b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/CsrFactory.java
@@ -67,10 +67,10 @@ public class CsrFactory {
LOGGER.info("Creation of CSR has been started with following parameters: {}", configuration.toString());
String csrParameters = getMandatoryParameters().append(getOptionalParameters()).toString();
X500Principal subject = new X500Principal(csrParameters);
- PKCS10CertificationRequest request = createPKCS10Csr(subject, keyPair);
+ PKCS10CertificationRequest request = createPkcs10Csr(subject, keyPair);
LOGGER.info("Creation of CSR has been completed successfully");
- return convertPKCS10CsrToPem(request);
+ return convertPkcs10CsrToPem(request);
}
private StringBuilder getMandatoryParameters() {
@@ -92,7 +92,7 @@ public class CsrFactory {
return optionalParameters.toString();
}
- private PKCS10CertificationRequest createPKCS10Csr(X500Principal subject, KeyPair keyPair) throws CsrGenerationException {
+ private PKCS10CertificationRequest createPkcs10Csr(X500Principal subject, KeyPair keyPair) throws CsrGenerationException {
JcaPKCS10CertificationRequestBuilder builder = new JcaPKCS10CertificationRequestBuilder(subject, keyPair.getPublic());
if (isParameterPresent(configuration.getSans())) {
@@ -114,7 +114,7 @@ public class CsrFactory {
return contentSigner;
}
- private String convertPKCS10CsrToPem(PKCS10CertificationRequest request) throws CsrGenerationException {
+ private String convertPkcs10CsrToPem(PKCS10CertificationRequest request) throws CsrGenerationException {
final StringWriter stringWriter = new StringWriter();
try (JcaPEMWriter pemWriter = new JcaPEMWriter(stringWriter)) {
LOGGER.info("Conversion of CSR to PEM has been started");
diff --git a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/exception/CertFileWriterException.java b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/exception/CertFileWriterException.java
index e723ca11..7912f6d7 100644
--- a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/exception/CertFileWriterException.java
+++ b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/exception/CertFileWriterException.java
@@ -24,8 +24,8 @@ import org.onap.aaf.certservice.client.api.ExitableException;
public class CertFileWriterException extends ExitableException {
- public CertFileWriterException(Throwable e) {
- super(e);
+ public CertFileWriterException(Throwable cause) {
+ super(cause);
}
@Override
diff --git a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/exception/CsrGenerationException.java b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/exception/CsrGenerationException.java
index 8c93a227..ba501cd6 100644
--- a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/exception/CsrGenerationException.java
+++ b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/exception/CsrGenerationException.java
@@ -25,8 +25,8 @@ import org.onap.aaf.certservice.client.api.ExitableException;
public class CsrGenerationException extends ExitableException {
private static final ExitStatus EXIT_STATUS = ExitStatus.CSR_GENERATION_EXCEPTION;
- public CsrGenerationException(Throwable e) {
- super(e);
+ public CsrGenerationException(Throwable cause) {
+ super(cause);
}
public ExitStatus applicationExitStatus() {
diff --git a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/exception/PemConversionException.java b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/exception/PemConversionException.java
index 4d1cdaa6..cad3388b 100644
--- a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/exception/PemConversionException.java
+++ b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/exception/PemConversionException.java
@@ -25,8 +25,8 @@ import org.onap.aaf.certservice.client.api.ExitableException;
public class PemConversionException extends ExitableException {
private static final ExitStatus EXIT_STATUS = ExitStatus.PEM_CONVERSION_EXCEPTION;
- public PemConversionException(Throwable e) {
- super(e);
+ public PemConversionException(Throwable cause) {
+ super(cause);
}
public PemConversionException(String message) {
diff --git a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/exception/PkEncodingException.java b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/exception/PkEncodingException.java
index 20d623aa..89976bf3 100644
--- a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/exception/PkEncodingException.java
+++ b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/certification/exception/PkEncodingException.java
@@ -25,8 +25,8 @@ import org.onap.aaf.certservice.client.api.ExitableException;
public class PkEncodingException extends ExitableException {
private static final ExitStatus EXIT_STATUS = ExitStatus.PK_TO_PEM_ENCODING_EXCEPTION;
- public PkEncodingException(Throwable e) {
- super(e);
+ public PkEncodingException(Throwable cause) {
+ super(cause);
}
public ExitStatus applicationExitStatus() {
diff --git a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/configuration/factory/SslContextFactory.java b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/configuration/factory/SslContextFactory.java
index ef74d830..7da8fa58 100644
--- a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/configuration/factory/SslContextFactory.java
+++ b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/configuration/factory/SslContextFactory.java
@@ -53,7 +53,7 @@ public class SslContextFactory {
String truststorePassword = envsForTls.getTruststorePassword()
.orElseThrow(() -> new TlsConfigurationException(createEnvMissingMessage(TlsConfigurationEnvs.TRUSTSTORE_PASSWORD)));
- return createSSLContext(keystorePath, keystorePassword, truststorePath, truststorePassword);
+ return createSslContext(keystorePath, keystorePassword, truststorePath, truststorePassword);
}
private String createEnvMissingMessage(TlsConfigurationEnvs keystorePath) {
@@ -69,7 +69,7 @@ public class SslContextFactory {
return keyStore;
}
- private SSLContext createSSLContext(String keystorePath, String keystorePassword, String truststorePath, String truststorePassword) throws TlsConfigurationException {
+ private SSLContext createSslContext(String keystorePath, String keystorePassword, String truststorePath, String truststorePassword) throws TlsConfigurationException {
try {
KeyStore identityKeystore = setupKeystore(keystorePath, keystorePassword);
KeyStore trustKeystore = setupKeystore(truststorePath, truststorePassword);
diff --git a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/httpclient/exception/HttpClientException.java b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/httpclient/exception/HttpClientException.java
index bc48554a..e9f0f0ad 100644
--- a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/httpclient/exception/HttpClientException.java
+++ b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/httpclient/exception/HttpClientException.java
@@ -26,8 +26,8 @@ import org.onap.aaf.certservice.client.api.ExitableException;
public class HttpClientException extends ExitableException {
private static final ExitStatus EXIT_STATUS = ExitStatus.HTTP_CLIENT_EXCEPTION;
- public HttpClientException(Throwable e) {
- super(e);
+ public HttpClientException(Throwable cause) {
+ super(cause);
}
@Override
diff --git a/certServiceClient/src/test/java/org/onap/aaf/certservice/client/certification/writer/CertFileWriterTest.java b/certServiceClient/src/test/java/org/onap/aaf/certservice/client/certification/writer/CertFileWriterTest.java
index e7ebb32b..61c4d835 100644
--- a/certServiceClient/src/test/java/org/onap/aaf/certservice/client/certification/writer/CertFileWriterTest.java
+++ b/certServiceClient/src/test/java/org/onap/aaf/certservice/client/certification/writer/CertFileWriterTest.java
@@ -70,7 +70,7 @@ class CertFileWriterTest {
}
@Test
- void certFileWriterShouldThrowPemToPKCS12ConverterExceptionWhenOutputDirectoryDoesNotExist() {
+ void certFileWriterShouldThrowCertFileWriterExceptionWhenOutputDirectoryDoesNotExist() {
// given
final byte[] data = new byte[]{-128, 1, 2, 3, 0};
CertFileWriter certFileWriter = new CertFileWriter(OUTPUT_PATH + "thisPathDoesNotExist/");
diff --git a/certServiceClient/src/test/java/org/onap/aaf/certservice/client/configuration/EnvsForCsrTest.java b/certServiceClient/src/test/java/org/onap/aaf/certservice/client/configuration/EnvsForCsrTest.java
index 8e0f5bbf..656bbe59 100644
--- a/certServiceClient/src/test/java/org/onap/aaf/certservice/client/configuration/EnvsForCsrTest.java
+++ b/certServiceClient/src/test/java/org/onap/aaf/certservice/client/configuration/EnvsForCsrTest.java
@@ -83,7 +83,7 @@ class EnvsForCsrTest {
}
@Test
- void shouldReturnSystemEnvOUVariableWhenItWasDefined() {
+ void shouldReturnSystemEnvOuVariableWhenItWasDefined() {
// given
when(envsForCsr.readEnv(CsrConfigurationEnvs.ORGANIZATION_UNIT)).thenReturn(Optional.of(TEST_ENV));
@@ -96,7 +96,7 @@ class EnvsForCsrTest {
}
@Test
- public void shouldReportThatSystemEnvOUVariableIsNotPresentWhenItWasNotDefined() {
+ public void shouldReportThatSystemEnvOuVariableIsNotPresentWhenItWasNotDefined() {
// when
final Optional<String> testEnv = envsForCsr.getOrganizationUnit();
@@ -171,7 +171,7 @@ class EnvsForCsrTest {
}
@Test
- void shouldReturnSystemEnvSANSVariableWhenItWasDefined() {
+ void shouldReturnSystemEnvSansVariableWhenItWasDefined() {
// given
when(envsForCsr.readEnv(CsrConfigurationEnvs.SANS)).thenReturn(Optional.of(TEST_ENV));
@@ -184,7 +184,7 @@ class EnvsForCsrTest {
}
@Test
- public void shouldReportThatSystemEnvSANSVariableIsNotPresentWhenItWasNotDefined() {
+ public void shouldReportThatSystemEnvSansVariableIsNotPresentWhenItWasNotDefined() {
// when
final Optional<String> testEnv = envsForCsr.getSubjectAlternativesName();
diff --git a/certServiceClient/src/test/java/org/onap/aaf/certservice/client/configuration/factory/CsrConfigurationFactoryTest.java b/certServiceClient/src/test/java/org/onap/aaf/certservice/client/configuration/factory/CsrConfigurationFactoryTest.java
index 5abd0b13..b9b9b078 100644
--- a/certServiceClient/src/test/java/org/onap/aaf/certservice/client/configuration/factory/CsrConfigurationFactoryTest.java
+++ b/certServiceClient/src/test/java/org/onap/aaf/certservice/client/configuration/factory/CsrConfigurationFactoryTest.java
@@ -53,8 +53,8 @@ public class CsrConfigurationFactoryTest {
private CsrConfigurationFactory testedFactory;
private Condition<CsrConfigurationException> expectedExitCodeCondition = new Condition<>("Correct exit code") {
@Override
- public boolean matches(CsrConfigurationException e) {
- return e.applicationExitStatus() == CSR_CONFIGURATION_EXCEPTION;
+ public boolean matches(CsrConfigurationException exception) {
+ return exception.applicationExitStatus() == CSR_CONFIGURATION_EXCEPTION;
}
};
diff --git a/certServiceClient/src/test/java/org/onap/aaf/certservice/client/configuration/factory/SslContextFactoryTest.java b/certServiceClient/src/test/java/org/onap/aaf/certservice/client/configuration/factory/SslContextFactoryTest.java
index e71e9895..8e6e8369 100644
--- a/certServiceClient/src/test/java/org/onap/aaf/certservice/client/configuration/factory/SslContextFactoryTest.java
+++ b/certServiceClient/src/test/java/org/onap/aaf/certservice/client/configuration/factory/SslContextFactoryTest.java
@@ -173,7 +173,7 @@ public class SslContextFactoryTest {
}
@Test
- public void shouldReturnSSLContext() throws TlsConfigurationException {
+ public void shouldReturnSslContext() throws TlsConfigurationException {
// Given
String keystorePath = getResourcePath(VALID_KEYSTORE_NAME);
String truststorePath = getResourcePath(VALID_TRUSTSTORE_NAME);