Add unit test for app Configuration.
[aai/esr-server.git] / esr-mgr / src / main / java / org / onap / aai / esr / wrapper / ThirdpatySdncWrapper.java
index 0dfd45a..0aa21da 100644 (file)
@@ -22,12 +22,10 @@ import javax.ws.rs.core.Response;
 import org.onap.aai.esr.entity.aai.EsrSystemInfo;
 import org.onap.aai.esr.entity.aai.EsrThirdpartySdncDetail;
 import org.onap.aai.esr.entity.aai.EsrThirdpartySdncList;
-import org.onap.aai.esr.entity.aai.EsrVnfmDetail;
 import org.onap.aai.esr.entity.rest.CommonRegisterResponse;
 import org.onap.aai.esr.entity.rest.ThirdpartySdncRegisterInfo;
 import org.onap.aai.esr.externalservice.aai.ExternalSystemProxy;
 import org.onap.aai.esr.util.ThirdpartySdncManagerUtil;
-import org.onap.aai.esr.util.VnfmManagerUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -105,7 +103,7 @@ public class ThirdpatySdncWrapper {
     } catch (Exception e) {
       e.printStackTrace();
       LOG.error("Query thirdparty SDNC list failed !");
-      return Response.serverError().build();
+      return Response.ok(sdncList).build();
     }
   }
   
@@ -115,7 +113,7 @@ public class ThirdpatySdncWrapper {
     if(thirdpartySdnc != null) {
       return Response.ok(thirdpartySdnc).build();
     } else {
-      return Response.ok().build();
+      return Response.ok(thirdpartySdnc).build();
     }
   }
   
@@ -126,12 +124,12 @@ public class ThirdpatySdncWrapper {
     if (resourceVersion != null) {
       try {
         ExternalSystemProxy.deleteThirdpartySdnc(thirdpartySdncId, resourceVersion);
-        return Response.ok().build();
+        return Response.noContent().build();
       } catch (Exception e) {
         e.printStackTrace();
         LOG.error("Delete VNFM from A&AI failed! thirdparty SDNC ID: " + thirdpartySdncId + "resouce-version:"
             + resourceVersion, e.getMessage());
-        return Response.noContent().build();
+        return Response.serverError().build();
       }
     } else {
       LOG.error("resouce-version is null ! Can not delete resouce from A&AI. ");