[OOM-CERT-SERVICE] Improve logging
[oom/platform/cert-service.git] / certService / src / main / java / org / onap / oom / certservice / cmpv2client / validation / CmpCertificationValidator.java
index c5d6f3e..e73f57d 100644 (file)
@@ -1,8 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  * Copyright (C) 2020 Nordix Foundation.
- * ================================================================================
- * Modification copyright 2021 Nokia
+ * Copyright (C) 2021 Nokia.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -75,6 +74,7 @@ public class CmpCertificationValidator {
         if (notBefore != null && notAfter != null && notBefore.compareTo(notAfter) > 0) {
             throw new IllegalArgumentException("Before Date is set after the After Date");
         }
+        LOG.info("Validation completed successfully.");
     }
 
     public void checkCmpResponse(final PKIMessage respPkiMessage, final PublicKey publicKey, final String initAuthPassword)
@@ -127,9 +127,7 @@ public class CmpCertificationValidator {
     }
 
     private void logServerResponse(CertResponse certResponse) {
-        if (LOG.isInfoEnabled()) {
-            LOG.info("Response status code: {}", certResponse.getStatus().getStatus());
-        }
+        LOG.info("Response status code: {}", certResponse.getStatus().getStatus());
         if (certResponse.getStatus().getStatusString() != null) {
             String serverMessage = certResponse.getStatus().getStatusString().getStringAt(0).getString();
             LOG.warn("Response status text: {}", serverMessage);