diff options
author | LiZi <li.zi30@zte.com.cn> | 2018-03-02 01:14:49 -0500 |
---|---|---|
committer | LiZi <li.zi30@zte.com.cn> | 2018-03-02 01:14:58 -0500 |
commit | 0ab46140874180b586d578c79c75621697b7a3b1 (patch) | |
tree | ca8b7df39a5022bf616c15a1b97e2e6cb2177c38 /esr-mgr/src/main | |
parent | 1d8aafe77787e3c86ec53075cd0eaf3536316aef (diff) |
Add unit test for the newly API.
Add unit test for the API of query complexes and create relationship between cloud region and complex
Change-Id: I1a5b4b53346e820f66946482ce27f4273d842e88
Issue-ID: AAI-830
Signed-off-by: LiZi <li.zi30@zte.com.cn>
Diffstat (limited to 'esr-mgr/src/main')
-rw-r--r-- | esr-mgr/src/main/java/org/onap/aai/esr/externalservice/cloud/VimManagerProxy.java | 10 | ||||
-rw-r--r-- | esr-mgr/src/main/java/org/onap/aai/esr/wrapper/VimManagerWrapper.java | 9 |
2 files changed, 11 insertions, 8 deletions
diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/cloud/VimManagerProxy.java b/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/cloud/VimManagerProxy.java index 8e086a9..4822e27 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/cloud/VimManagerProxy.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/cloud/VimManagerProxy.java @@ -1,5 +1,5 @@ /** - * Copyright 2017 ZTE Corporation. + * Copyright 2017-2018 ZTE Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,11 +22,11 @@ import com.eclipsesource.jaxrs.consumer.ConsumerFactory; public class VimManagerProxy { - private VimManagerProxy() { - - } +// private VimManagerProxy() { +// +// } - public static void updateVim(String cloudOwner, String cloudRegionId, Tenant tenant) throws ExtsysException { + public void updateVim(String cloudOwner, String cloudRegionId, Tenant tenant) throws ExtsysException { ClientConfig config = new ClientConfig(new VimUpdateProvider()); IVimManage updateVimServiceproxy = ConsumerFactory.createConsumer(MsbConfig.getMultiCloudAddr(), config, IVimManage.class); diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/VimManagerWrapper.java b/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/VimManagerWrapper.java index 3003159..82c6f77 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/VimManagerWrapper.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/wrapper/VimManagerWrapper.java @@ -46,6 +46,8 @@ public class VimManagerWrapper { private static VimManagerUtil vimManagerUtil = new VimManagerUtil(); private static CloudRegionProxy cloudRegionProxy = new CloudRegionProxy(); + + private static VimManagerProxy vimManagerProxy = new VimManagerProxy(); private static ExtsysUtil extsysUtil = new ExtsysUtil(); @@ -56,13 +58,14 @@ public class VimManagerWrapper { */ public static VimManagerWrapper getInstance() { if (vimManagerWrapper == null) { - vimManagerWrapper = new VimManagerWrapper(cloudRegionProxy); + vimManagerWrapper = new VimManagerWrapper(cloudRegionProxy, vimManagerProxy); } return vimManagerWrapper; } - public VimManagerWrapper(CloudRegionProxy cloudRegionProxy) { + public VimManagerWrapper(CloudRegionProxy cloudRegionProxy, VimManagerProxy vimManagerProxy) { VimManagerWrapper.cloudRegionProxy = cloudRegionProxy; + VimManagerWrapper.vimManagerProxy = vimManagerProxy; } public Response registerVim(VimRegisterInfo vimRegisterInfo) { @@ -91,7 +94,7 @@ public class VimManagerWrapper { Tenant tenant = new Tenant(); tenant.setDefaultTenant(cloudRegion.getEsrSystemInfoList().getEsrSystemInfo().get(0).getDefaultTenant()); try { - VimManagerProxy.updateVim(cloudOwner, cloudRegionId, tenant); + vimManagerProxy.updateVim(cloudOwner, cloudRegionId, tenant); } catch (ExtsysException e) { LOG.error("Update VIM by Multi-cloud failed !", e); } |