From f28a670df2ea958a83d28930264f002f6d67eec7 Mon Sep 17 00:00:00 2001 From: awudzins Date: Wed, 19 Feb 2020 14:32:58 +0100 Subject: Remove cyclic dependencies and rename execeptions package Issue-ID: AAF-997 Signed-off-by: adamwudzinski Change-Id: Ib7a7da43ac616c74945490fd727c9ac7d7fc7cdd --- .../aaf/certservice/api/CertificationService.java | 2 +- .../CertificationExceptionController.java | 58 ++++++++++++++++++++++ .../certservice/certification/CsrModelFactory.java | 6 +-- .../exception/CsrDecryptionException.java | 30 +++++++++++ .../exception/DecryptionException.java | 30 +++++++++++ .../exception/ErrorResponseModel.java | 36 ++++++++++++++ .../exception/KeyDecryptionException.java | 30 +++++++++++ .../CertificationExceptionController.java | 56 --------------------- .../exceptions/CsrDecryptionException.java | 30 ----------- .../exceptions/DecryptionException.java | 30 ----------- .../exceptions/KeyDecryptionException.java | 30 ----------- .../certservice/certification/model/CsrModel.java | 3 +- .../certification/model/ErrorResponseModel.java | 36 -------------- .../certservice/api/CertificationServiceTest.java | 6 +-- .../certification/CsrModelFactoryTest.java | 6 +-- .../certification/PemObjectFactoryTest.java | 3 +- .../aaf/certservice/certification/TestUtils.java | 2 +- .../CertificationExceptionControllerTest.java | 5 +- .../certification/model/CsrModelTest.java | 6 +-- 19 files changed, 201 insertions(+), 204 deletions(-) create mode 100644 certService/src/main/java/org/onap/aaf/certservice/certification/CertificationExceptionController.java create mode 100644 certService/src/main/java/org/onap/aaf/certservice/certification/exception/CsrDecryptionException.java create mode 100644 certService/src/main/java/org/onap/aaf/certservice/certification/exception/DecryptionException.java create mode 100644 certService/src/main/java/org/onap/aaf/certservice/certification/exception/ErrorResponseModel.java create mode 100644 certService/src/main/java/org/onap/aaf/certservice/certification/exception/KeyDecryptionException.java delete mode 100644 certService/src/main/java/org/onap/aaf/certservice/certification/exceptions/CertificationExceptionController.java delete mode 100644 certService/src/main/java/org/onap/aaf/certservice/certification/exceptions/CsrDecryptionException.java delete mode 100644 certService/src/main/java/org/onap/aaf/certservice/certification/exceptions/DecryptionException.java delete mode 100644 certService/src/main/java/org/onap/aaf/certservice/certification/exceptions/KeyDecryptionException.java delete mode 100644 certService/src/main/java/org/onap/aaf/certservice/certification/model/ErrorResponseModel.java (limited to 'certService/src') diff --git a/certService/src/main/java/org/onap/aaf/certservice/api/CertificationService.java b/certService/src/main/java/org/onap/aaf/certservice/api/CertificationService.java index d1a4a17a..d2de1aa0 100644 --- a/certService/src/main/java/org/onap/aaf/certservice/api/CertificationService.java +++ b/certService/src/main/java/org/onap/aaf/certservice/api/CertificationService.java @@ -24,7 +24,7 @@ import com.google.gson.Gson; import org.onap.aaf.certservice.certification.CertificationModelFactory; import org.onap.aaf.certservice.certification.CsrModelFactory; import org.onap.aaf.certservice.certification.CsrModelFactory.StringBase64; -import org.onap.aaf.certservice.certification.exceptions.DecryptionException; +import org.onap.aaf.certservice.certification.exception.DecryptionException; import org.onap.aaf.certservice.certification.model.CertificationModel; import org.onap.aaf.certservice.certification.model.CsrModel; import org.slf4j.Logger; diff --git a/certService/src/main/java/org/onap/aaf/certservice/certification/CertificationExceptionController.java b/certService/src/main/java/org/onap/aaf/certservice/certification/CertificationExceptionController.java new file mode 100644 index 00000000..4c9d3042 --- /dev/null +++ b/certService/src/main/java/org/onap/aaf/certservice/certification/CertificationExceptionController.java @@ -0,0 +1,58 @@ +/* + * ============LICENSE_START======================================================= + * PROJECT + * ================================================================================ + * Copyright (C) 2020 Nokia. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.aaf.certservice.certification; + +import com.google.gson.Gson; +import org.onap.aaf.certservice.certification.exception.CsrDecryptionException; +import org.onap.aaf.certservice.certification.exception.ErrorResponseModel; +import org.onap.aaf.certservice.certification.exception.KeyDecryptionException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; + +@ControllerAdvice +public class CertificationExceptionController { + + private static final Logger LOGGER = LoggerFactory.getLogger(CertificationExceptionController.class); + + @ExceptionHandler(value = CsrDecryptionException.class) + public ResponseEntity handle(CsrDecryptionException exception) { + LOGGER.error("Exception occurred during decoding certificate sign request:", exception); + return getErrorResponseEntity("Wrong certificate signing request (CSR) format"); + } + + @ExceptionHandler(value = KeyDecryptionException.class) + public ResponseEntity handle(KeyDecryptionException exception) { + LOGGER.error("Exception occurred during decoding key:", exception); + return getErrorResponseEntity("Wrong key (PK) format"); + } + + private ResponseEntity getErrorResponseEntity(String errorMessage) { + ErrorResponseModel errorResponse = new ErrorResponseModel(errorMessage); + return new ResponseEntity<>( + new Gson().toJson(errorResponse), + HttpStatus.BAD_REQUEST + ); + } +} 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 f89c34e5..bca30dee 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 @@ -25,9 +25,9 @@ import java.util.Optional; import org.bouncycastle.pkcs.PKCS10CertificationRequest; import org.bouncycastle.util.io.pem.PemObject; -import org.onap.aaf.certservice.certification.exceptions.CsrDecryptionException; -import org.onap.aaf.certservice.certification.exceptions.DecryptionException; -import org.onap.aaf.certservice.certification.exceptions.KeyDecryptionException; +import org.onap.aaf.certservice.certification.exception.CsrDecryptionException; +import org.onap.aaf.certservice.certification.exception.DecryptionException; +import org.onap.aaf.certservice.certification.exception.KeyDecryptionException; import org.onap.aaf.certservice.certification.model.CsrModel; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/certService/src/main/java/org/onap/aaf/certservice/certification/exception/CsrDecryptionException.java b/certService/src/main/java/org/onap/aaf/certservice/certification/exception/CsrDecryptionException.java new file mode 100644 index 00000000..0bb46258 --- /dev/null +++ b/certService/src/main/java/org/onap/aaf/certservice/certification/exception/CsrDecryptionException.java @@ -0,0 +1,30 @@ +/* + * ============LICENSE_START======================================================= + * PROJECT + * ================================================================================ + * Copyright (C) 2020 Nokia. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.aaf.certservice.certification.exception; + +public class CsrDecryptionException extends DecryptionException { + public CsrDecryptionException(String message, Throwable cause) { + super(message, cause); + } + public CsrDecryptionException(String message) { + super(message); + } +} diff --git a/certService/src/main/java/org/onap/aaf/certservice/certification/exception/DecryptionException.java b/certService/src/main/java/org/onap/aaf/certservice/certification/exception/DecryptionException.java new file mode 100644 index 00000000..ee0fb202 --- /dev/null +++ b/certService/src/main/java/org/onap/aaf/certservice/certification/exception/DecryptionException.java @@ -0,0 +1,30 @@ +/* + * ============LICENSE_START======================================================= + * PROJECT + * ================================================================================ + * Copyright (C) 2020 Nokia. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.aaf.certservice.certification.exception; + +public class DecryptionException extends Exception { + public DecryptionException(String message, Throwable cause) { + super(message, cause); + } + public DecryptionException(String message) { + super(message); + } +} diff --git a/certService/src/main/java/org/onap/aaf/certservice/certification/exception/ErrorResponseModel.java b/certService/src/main/java/org/onap/aaf/certservice/certification/exception/ErrorResponseModel.java new file mode 100644 index 00000000..8899f77c --- /dev/null +++ b/certService/src/main/java/org/onap/aaf/certservice/certification/exception/ErrorResponseModel.java @@ -0,0 +1,36 @@ +/* + * ============LICENSE_START======================================================= + * PROJECT + * ================================================================================ + * Copyright (C) 2020 Nokia. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.aaf.certservice.certification.exception; + +public class ErrorResponseModel { + + private final String errorMessage; + + public ErrorResponseModel(String errorMessage) { + this.errorMessage = errorMessage; + } + + public String getErrorMessage() { + return errorMessage; + } + +} + diff --git a/certService/src/main/java/org/onap/aaf/certservice/certification/exception/KeyDecryptionException.java b/certService/src/main/java/org/onap/aaf/certservice/certification/exception/KeyDecryptionException.java new file mode 100644 index 00000000..7970c393 --- /dev/null +++ b/certService/src/main/java/org/onap/aaf/certservice/certification/exception/KeyDecryptionException.java @@ -0,0 +1,30 @@ +/* + * ============LICENSE_START======================================================= + * PROJECT + * ================================================================================ + * Copyright (C) 2020 Nokia. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.aaf.certservice.certification.exception; + +public class KeyDecryptionException extends DecryptionException { + public KeyDecryptionException(String message, Throwable cause) { + super(message, cause); + } + public KeyDecryptionException(String message) { + super(message); + } +} diff --git a/certService/src/main/java/org/onap/aaf/certservice/certification/exceptions/CertificationExceptionController.java b/certService/src/main/java/org/onap/aaf/certservice/certification/exceptions/CertificationExceptionController.java deleted file mode 100644 index 7d2c43ed..00000000 --- a/certService/src/main/java/org/onap/aaf/certservice/certification/exceptions/CertificationExceptionController.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * PROJECT - * ================================================================================ - * Copyright (C) 2020 Nokia. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.aaf.certservice.certification.exceptions; - -import com.google.gson.Gson; -import org.onap.aaf.certservice.certification.model.ErrorResponseModel; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.ControllerAdvice; -import org.springframework.web.bind.annotation.ExceptionHandler; - -@ControllerAdvice -public class CertificationExceptionController { - - private static final Logger LOGGER = LoggerFactory.getLogger(CertificationExceptionController.class); - - @ExceptionHandler(value = CsrDecryptionException.class) - public ResponseEntity handle(CsrDecryptionException exception) { - LOGGER.error("Exception occurred during decoding certificate sign request:", exception); - return getErrorResponseEntity("Wrong certificate signing request (CSR) format"); - } - - @ExceptionHandler(value = KeyDecryptionException.class) - public ResponseEntity handle(KeyDecryptionException exception) { - LOGGER.error("Exception occurred during decoding key:", exception); - return getErrorResponseEntity("Wrong key (PK) format"); - } - - private ResponseEntity getErrorResponseEntity(String errorMessage) { - ErrorResponseModel errorResponse = new ErrorResponseModel(errorMessage); - return new ResponseEntity<>( - new Gson().toJson(errorResponse), - HttpStatus.BAD_REQUEST - ); - } -} diff --git a/certService/src/main/java/org/onap/aaf/certservice/certification/exceptions/CsrDecryptionException.java b/certService/src/main/java/org/onap/aaf/certservice/certification/exceptions/CsrDecryptionException.java deleted file mode 100644 index 929fbdb6..00000000 --- a/certService/src/main/java/org/onap/aaf/certservice/certification/exceptions/CsrDecryptionException.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * PROJECT - * ================================================================================ - * Copyright (C) 2020 Nokia. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.aaf.certservice.certification.exceptions; - -public class CsrDecryptionException extends DecryptionException { - public CsrDecryptionException(String message, Throwable cause) { - super(message, cause); - } - public CsrDecryptionException(String message) { - super(message); - } -} diff --git a/certService/src/main/java/org/onap/aaf/certservice/certification/exceptions/DecryptionException.java b/certService/src/main/java/org/onap/aaf/certservice/certification/exceptions/DecryptionException.java deleted file mode 100644 index 8f5f48e6..00000000 --- a/certService/src/main/java/org/onap/aaf/certservice/certification/exceptions/DecryptionException.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * PROJECT - * ================================================================================ - * Copyright (C) 2020 Nokia. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.aaf.certservice.certification.exceptions; - -public class DecryptionException extends Exception { - public DecryptionException(String message, Throwable cause) { - super(message, cause); - } - public DecryptionException(String message) { - super(message); - } -} diff --git a/certService/src/main/java/org/onap/aaf/certservice/certification/exceptions/KeyDecryptionException.java b/certService/src/main/java/org/onap/aaf/certservice/certification/exceptions/KeyDecryptionException.java deleted file mode 100644 index 15d53935..00000000 --- a/certService/src/main/java/org/onap/aaf/certservice/certification/exceptions/KeyDecryptionException.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * PROJECT - * ================================================================================ - * Copyright (C) 2020 Nokia. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.aaf.certservice.certification.exceptions; - -public class KeyDecryptionException extends DecryptionException { - public KeyDecryptionException(String message, Throwable cause) { - super(message, cause); - } - public KeyDecryptionException(String message) { - super(message); - } -} diff --git a/certService/src/main/java/org/onap/aaf/certservice/certification/model/CsrModel.java b/certService/src/main/java/org/onap/aaf/certservice/certification/model/CsrModel.java index ef76144b..2421c5a4 100644 --- a/certService/src/main/java/org/onap/aaf/certservice/certification/model/CsrModel.java +++ b/certService/src/main/java/org/onap/aaf/certservice/certification/model/CsrModel.java @@ -34,12 +34,11 @@ import org.bouncycastle.asn1.x509.GeneralNames; import org.bouncycastle.pkcs.PKCS10CertificationRequest; import org.bouncycastle.util.io.pem.PemObject; -import org.onap.aaf.certservice.certification.exceptions.CsrDecryptionException; +import org.onap.aaf.certservice.certification.exception.CsrDecryptionException; public class CsrModel { - private final PKCS10CertificationRequest csr; private final PemObject privateKey; diff --git a/certService/src/main/java/org/onap/aaf/certservice/certification/model/ErrorResponseModel.java b/certService/src/main/java/org/onap/aaf/certservice/certification/model/ErrorResponseModel.java deleted file mode 100644 index bca7915d..00000000 --- a/certService/src/main/java/org/onap/aaf/certservice/certification/model/ErrorResponseModel.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * ============LICENSE_START======================================================= - * PROJECT - * ================================================================================ - * Copyright (C) 2020 Nokia. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.onap.aaf.certservice.certification.model; - -public class ErrorResponseModel { - - private final String errorMessage; - - public ErrorResponseModel(String errorMessage) { - this.errorMessage = errorMessage; - } - - public String getErrorMessage() { - return errorMessage; - } - -} - 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 0bb99d9f..ee1ce1ef 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 @@ -28,9 +28,9 @@ import org.mockito.MockitoAnnotations; import org.onap.aaf.certservice.certification.CertificationModelFactory; import org.onap.aaf.certservice.certification.CsrModelFactory; import org.onap.aaf.certservice.certification.CsrModelFactory.StringBase64; -import org.onap.aaf.certservice.certification.exceptions.CsrDecryptionException; -import org.onap.aaf.certservice.certification.exceptions.DecryptionException; -import org.onap.aaf.certservice.certification.exceptions.KeyDecryptionException; +import org.onap.aaf.certservice.certification.exception.CsrDecryptionException; +import org.onap.aaf.certservice.certification.exception.DecryptionException; +import org.onap.aaf.certservice.certification.exception.KeyDecryptionException; import org.onap.aaf.certservice.certification.model.CertificationModel; import org.onap.aaf.certservice.certification.model.CsrModel; import org.springframework.http.HttpStatus; diff --git a/certService/src/test/java/org/onap/aaf/certservice/certification/CsrModelFactoryTest.java b/certService/src/test/java/org/onap/aaf/certservice/certification/CsrModelFactoryTest.java index 5f48b2bf..772f456f 100644 --- a/certService/src/test/java/org/onap/aaf/certservice/certification/CsrModelFactoryTest.java +++ b/certService/src/test/java/org/onap/aaf/certservice/certification/CsrModelFactoryTest.java @@ -24,9 +24,9 @@ import org.bouncycastle.util.encoders.Base64; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.onap.aaf.certservice.certification.CsrModelFactory.StringBase64; -import org.onap.aaf.certservice.certification.exceptions.CsrDecryptionException; -import org.onap.aaf.certservice.certification.exceptions.DecryptionException; -import org.onap.aaf.certservice.certification.exceptions.KeyDecryptionException; +import org.onap.aaf.certservice.certification.exception.CsrDecryptionException; +import org.onap.aaf.certservice.certification.exception.DecryptionException; +import org.onap.aaf.certservice.certification.exception.KeyDecryptionException; import org.onap.aaf.certservice.certification.model.CsrModel; import static org.junit.jupiter.api.Assertions.assertThrows; 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 0b70475c..90151b6d 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 @@ -23,8 +23,7 @@ package org.onap.aaf.certservice.certification; import org.bouncycastle.util.io.pem.PemObject; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.onap.aaf.certservice.certification.exceptions.DecryptionException; -import org.onap.aaf.certservice.certification.exceptions.KeyDecryptionException; +import org.onap.aaf.certservice.certification.exception.DecryptionException; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/certService/src/test/java/org/onap/aaf/certservice/certification/TestUtils.java b/certService/src/test/java/org/onap/aaf/certservice/certification/TestUtils.java index 39554417..11b4f84e 100644 --- a/certService/src/test/java/org/onap/aaf/certservice/certification/TestUtils.java +++ b/certService/src/test/java/org/onap/aaf/certservice/certification/TestUtils.java @@ -22,7 +22,7 @@ package org.onap.aaf.certservice.certification; import org.bouncycastle.util.io.pem.PemObject; import org.bouncycastle.util.io.pem.PemWriter; -import org.onap.aaf.certservice.certification.exceptions.KeyDecryptionException; +import org.onap.aaf.certservice.certification.exception.KeyDecryptionException; import java.io.IOException; import java.io.StringWriter; diff --git a/certService/src/test/java/org/onap/aaf/certservice/certification/exception/CertificationExceptionControllerTest.java b/certService/src/test/java/org/onap/aaf/certservice/certification/exception/CertificationExceptionControllerTest.java index 58e59f45..3dc93035 100644 --- a/certService/src/test/java/org/onap/aaf/certservice/certification/exception/CertificationExceptionControllerTest.java +++ b/certService/src/test/java/org/onap/aaf/certservice/certification/exception/CertificationExceptionControllerTest.java @@ -23,10 +23,7 @@ package org.onap.aaf.certservice.certification.exception; import com.google.gson.Gson; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.onap.aaf.certservice.certification.exceptions.CertificationExceptionController; -import org.onap.aaf.certservice.certification.exceptions.CsrDecryptionException; -import org.onap.aaf.certservice.certification.exceptions.KeyDecryptionException; -import org.onap.aaf.certservice.certification.model.ErrorResponseModel; +import org.onap.aaf.certservice.certification.CertificationExceptionController; import org.springframework.http.ResponseEntity; import static org.junit.jupiter.api.Assertions.assertEquals; 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 7df785d2..bde1dcce 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,9 +26,9 @@ import org.bouncycastle.util.io.pem.PemObject; import org.junit.jupiter.api.Test; import org.onap.aaf.certservice.certification.PKCS10CertificationRequestFactory; 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.KeyDecryptionException; +import org.onap.aaf.certservice.certification.exception.CsrDecryptionException; +import org.onap.aaf.certservice.certification.exception.DecryptionException; +import org.onap.aaf.certservice.certification.exception.KeyDecryptionException; import java.io.IOException; -- cgit 1.2.3-korg