summaryrefslogtreecommitdiffstats
path: root/esr-mgr/src/main
diff options
context:
space:
mode:
authorLizi <li.zi30@zte.com.cn>2018-01-09 11:37:38 +0000
committerLizi <li.zi30@zte.com.cn>2018-01-09 11:47:33 +0000
commit84c2147a46842e37c4e73c3bf19af9036371253f (patch)
tree027b285e33d109598dd2593a47476df5c24d5468 /esr-mgr/src/main
parent6362b35e771e397cb9b49fb73a003cad38a5e0cb (diff)
add unit test for vnfmregister.
Change-Id: I90e690efd0f35fff7151650f078e2b77e134b440 Issue-ID: AAI-500 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/aai/ExternalSystemProxy.java25
1 files changed, 15 insertions, 10 deletions
diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/ExternalSystemProxy.java b/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/ExternalSystemProxy.java
index 6fca0e6..a4c80eb 100644
--- a/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/ExternalSystemProxy.java
+++ b/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/ExternalSystemProxy.java
@@ -26,8 +26,8 @@ import com.eclipsesource.jaxrs.consumer.ConsumerFactory;
public class ExternalSystemProxy {
+ public static boolean isTest = false;
private static IExternalSystem externalSystemproxy;
-
private static String transactionId = "9999";
private static String fromAppId = "esr-server";
private static String authorization = AaiCommon.getAuthenticationCredentials();
@@ -37,15 +37,20 @@ public class ExternalSystemProxy {
config, IExternalSystem.class);
}
- public static void registerVnfm(String vnfmId, EsrVnfmDetail esrVnfmDetail) throws ExtsysException {
- ClientConfig config = new ClientConfig(new VnfmRegisterProvider());
- IExternalSystem registerVnfmServiceproxy = ConsumerFactory
- .createConsumer(MsbConfig.getExternalSystemAddr(), config, IExternalSystem.class);
- try {
- registerVnfmServiceproxy.registerVNFM(transactionId, fromAppId, authorization, vnfmId,
- esrVnfmDetail);
- } catch (Exception e) {
- throw new ExtsysException("PUT VNFM to A&AI failed.", e);
+ public static void registerVnfm(String vnfmId, EsrVnfmDetail esrVnfmDetail)
+ throws ExtsysException {
+ if (isTest) {
+
+ } else {
+ ClientConfig config = new ClientConfig(new VnfmRegisterProvider());
+ IExternalSystem registerVnfmServiceproxy = ConsumerFactory
+ .createConsumer(MsbConfig.getExternalSystemAddr(), config, IExternalSystem.class);
+ try {
+ registerVnfmServiceproxy.registerVNFM(transactionId, fromAppId, authorization, vnfmId,
+ esrVnfmDetail);
+ } catch (Exception e) {
+ throw new ExtsysException("PUT VNFM to A&AI failed.", e);
+ }
}
}