Tests for DR_NodeResource & bugfixes
[dmaap/dbcapi.git] / src / main / java / org / onap / dmaap / dbcapi / service / DR_NodeService.java
index b6d62a2..9181154 100644 (file)
@@ -3,6 +3,8 @@
  * org.onap.dcae
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ *
+ * Modifications Copyright (C) 2019 IBM.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,8 +29,8 @@ import java.util.Map;
 import javax.ws.rs.core.Response.Status;
 
 import org.apache.log4j.Logger;
-import org.onap.dmaap.dbcapi.aaf.client.DrProvConnection;
-import org.onap.dmaap.dbcapi.aaf.database.DatabaseClass;
+import org.onap.dmaap.dbcapi.client.DrProvConnection;
+import org.onap.dmaap.dbcapi.database.DatabaseClass;
 import org.onap.dmaap.dbcapi.logging.BaseLoggingClass;
 import org.onap.dmaap.dbcapi.model.ApiError;
 import org.onap.dmaap.dbcapi.model.DR_Node;
@@ -58,7 +60,7 @@ public class DR_NodeService extends BaseLoggingClass {
                private void setX( String X, String list, ApiError apiError ) {
                        DrProvConnection prov = new DrProvConnection();
                        prov.makeNodesConnection( X, list );    
-                       String resp = prov.doPutNodes( apiError );
+                       prov.doPutNodes( apiError );
                }
                
                private String removeFromList( String aNode, String aList ) {
@@ -213,11 +215,11 @@ public class DR_NodeService extends BaseLoggingClass {
        }
        
        public DR_Node updateDr_Node( DR_Node node, ApiError apiError ) {
-               DR_Node old = dr_nodes.get( node );
+               DR_Node old = dr_nodes.get( node.getFqdn() );
                if ( old == null ) {
                        apiError.setCode(Status.NOT_FOUND.getStatusCode());
                        apiError.setFields( "fqdn");
-                       apiError.setMessage( "Node " + node + " does not exist");
+                       apiError.setMessage( "Node " + node.getFqdn() + " does not exist");
                        return null;
                }
                node.setLastMod();