Fix for incorrect handling of SQL results 94/82794/2
authorJoss Armstrong <joss.armstrong@ericsson.com>
Wed, 20 Mar 2019 13:03:26 +0000 (13:03 +0000)
committerTakamune Cho <takamune.cho@att.com>
Thu, 21 Mar 2019 00:12:32 +0000 (00:12 +0000)
Corrected handling of SQL COUNT query

Issue-ID: APPC-1545
Change-Id: I8c246b97c8ed8b483e79ae0e3b2cb51f8b4b62be
Signed-off-by: Joss Armstrong <joss.armstrong@ericsson.com>
appc-config/appc-encryption-tool/provider/src/main/java/org/onap/appc/encryptiontool/wrapper/EncryptionToolDGWrapper.java

index 3b032d9..0910a5b 100644 (file)
@@ -138,7 +138,8 @@ public class EncryptionToolDGWrapper implements SvcLogicJavaPlugin {
                                 log.info(fn + ":: Error retrieving credentials");
                                 throw new SvcLogicException("Error retrieving credentials");
                             }
-                            if (status == QueryStatus.NOT_FOUND) {
+                            // SELECT COUNT query will return SUCCESS with a count of 0 when no data is found
+                            if (status == QueryStatus.SUCCESS) {
                                 log.info(fn + ":: NOT_FOUND! No data found in device_authentication table for "
                                         + vnf_Type + " " + protocol + "" + action + "");
                                 throw new SvcLogicException(