Merge "removing /onap/so/infra from properties"
authorWojciech Sliwka <wojciech.sliwka@nokia.com>
Thu, 11 Apr 2019 16:58:23 +0000 (16:58 +0000)
committerGerrit Code Review <gerrit@onap.org>
Thu, 11 Apr 2019 16:58:23 +0000 (16:58 +0000)
21 files changed:
deliveries/src/main/docker/docker-files/Dockerfile
docs/release-notes.rst
vid-app-common/pom.xml
vid-app-common/src/main/java/org/onap/vid/controller/MsoConfig.java
vid-app-common/src/main/java/org/onap/vid/controller/WebConfig.java
vid-app-common/src/main/java/org/onap/vid/controller/open/HealthCheckController.java [moved from vid-app-common/src/main/java/org/onap/vid/controller/HealthCheckController.java with 98% similarity]
vid-app-common/src/main/java/org/onap/vid/controller/open/MaintenanceController.java [moved from vid-app-common/src/main/java/org/onap/vid/controller/MaintenanceController.java with 99% similarity]
vid-app-common/src/main/java/org/onap/vid/controller/open/RoleGeneratorController.java [moved from vid-app-common/src/main/java/org/onap/vid/controller/RoleGeneratorController.java with 98% similarity]
vid-app-common/src/main/java/org/onap/vid/controller/open/VersionController.java [moved from vid-app-common/src/main/java/org/onap/vid/controller/VersionController.java with 98% similarity]
vid-app-common/src/main/java/org/onap/vid/mso/RestMsoImplementation.java
vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java
vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js
vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.test.js
vid-app-common/src/test/java/org/onap/vid/controller/open/HealthCheckControllerTest.java [moved from vid-app-common/src/test/java/org/onap/vid/controller/HealthCheckControllerTest.java with 98% similarity]
vid-app-common/src/test/java/org/onap/vid/controller/open/MaintenanceControllerTest.java [moved from vid-app-common/src/test/java/org/onap/vid/controller/MaintenanceControllerTest.java with 99% similarity]
vid-app-common/src/test/java/org/onap/vid/controller/open/RoleGeneratorControllerTest.java [moved from vid-app-common/src/test/java/org/onap/vid/controller/RoleGeneratorControllerTest.java with 96% similarity]
vid-app-common/src/test/java/org/onap/vid/controller/open/VersionControllerTest.java [moved from vid-app-common/src/test/java/org/onap/vid/controller/VersionControllerTest.java with 95% similarity]
vid-app-common/src/test/java/org/onap/vid/mso/RestMsoImplementationTest.java
vid-app-common/src/test/java/org/onap/vid/mso/rest/MsoRestClientNewTest.java
vid-app-common/src/test/java/org/onap/vid/mso/rest/MsoRestClientTest.java
vid-webpack-master/package.cypress.json

index 3f9c1ad..b169aa4 100755 (executable)
@@ -1,8 +1,10 @@
-FROM tomcat:8.0-jre8-alpine
+FROM tomcat:9.0-jre8-alpine
 
 # add vim and uncomment alias to speedup troubleshooting purpose
 RUN apk update && apk add openjdk8 vim net-tools
 
+RUN adduser --disabled-password onap onap
+RUN mkdir -p /opt/app
 COPY conf.d/ /etc/onap/vid/conf.d/
 
 # MariaDB variables
@@ -90,6 +92,7 @@ ADD maven/config/server.xml ${VID_TOMCAT_PATH}
 ADD maven/scripts/*.sh /tmp/vid/
 ADD maven/artifacts/vid.war /tmp/vid/stage/
 
+RUN chown onap:onap /tmp/vid /usr/local/tomcat /etc/onap/vid /opt/app -R
 RUN chmod +x /tmp/vid/localize.sh
-
-CMD ["/tmp/vid/localize.sh"]
\ No newline at end of file
+USER onap
+CMD ["/tmp/vid/localize.sh"]
index 962fe1b..c1e2326 100644 (file)
@@ -3,6 +3,21 @@
 VID Release Notes
 =================
 
+Version: 3.2.3
+--------------
+
+:Release Date: 2019-03-28
+
+**Notes**
+
+It's v3.2.2, but repackaged with a new certificate valid until March 12, 2020.
+
+**Resolved Issues**
+
+VID certificates have been renewed to extend their expiry dates
+  - `VID-446 <https://jira.onap.org/browse/VID-446>`_ Fix Certificate Expiry.
+
+
 Version: 3.2.2
 --------------
 
index 205d642..0cc2195 100755 (executable)
             <groupId>com.google.guava</groupId>
             <artifactId>guava</artifactId>
         </dependency>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+            <version>2.9.2</version>
+        </dependency>
     </dependencies>
 </project>
index a82dfab..8d5fbbd 100644 (file)
@@ -33,6 +33,7 @@ import org.onap.vid.mso.MsoProperties;
 import org.onap.vid.mso.rest.MsoRestClientNew;
 import org.onap.vid.services.CloudOwnerService;
 import org.onap.vid.services.CloudOwnerServiceImpl;
+import org.onap.vid.utils.SystemPropertiesWrapper;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.togglz.core.manager.FeatureManager;
@@ -47,10 +48,10 @@ public class MsoConfig {
     }
 
     @Bean
-    public MsoRestClientNew msoClient(ObjectMapper unirestObjectMapper, HttpsAuthClient httpsAuthClient){
+    public MsoRestClientNew msoClient(ObjectMapper unirestObjectMapper, HttpsAuthClient httpsAuthClient, SystemPropertiesWrapper systemPropertiesWrapper){
         // Satisfy both interfaces -- MsoInterface and RestMsoImplementation
         return new MsoRestClientNew(new SyncRestClient(unirestObjectMapper), SystemProperties.getProperty(
-            MsoProperties.MSO_SERVER_URL),httpsAuthClient);
+            MsoProperties.MSO_SERVER_URL),httpsAuthClient, systemPropertiesWrapper);
     }
 
 
index 543aa94..e00c2d7 100644 (file)
@@ -42,11 +42,18 @@ import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.togglz.core.manager.FeatureManager;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
 
 import javax.servlet.ServletContext;
 import java.io.File;
 import java.io.IOException;
 
+@EnableSwagger2
 @Configuration
 public class WebConfig {
 
@@ -193,4 +200,12 @@ public class WebConfig {
 
     }
 
+    @Bean
+    public Docket api(){
+        return new Docket(DocumentationType.SWAGGER_2)
+                .select()
+                .apis(RequestHandlerSelectors.basePackage("org.onap.vid.controller.open"))
+                .paths(PathSelectors.any())
+                .build();
+    }
 }
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.vid.controller;
+package org.onap.vid.controller.open;
 
 import org.onap.portalsdk.core.controller.UnRestrictedBaseController;
 import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
 import org.onap.portalsdk.core.util.SystemProperties;
+import org.onap.vid.controller.HealthStatus;
 import org.onap.vid.dao.FnAppDoaImpl;
 import org.onap.vid.model.GitRepositoryState;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -18,7 +18,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.vid.controller;
+package org.onap.vid.controller.open;
 
 
 import com.fasterxml.jackson.core.type.TypeReference;
index e14ac0e..17af752 100644 (file)
@@ -26,7 +26,6 @@ import org.apache.commons.codec.binary.Base64;
 import org.apache.http.HttpException;
 import org.eclipse.jetty.util.security.Password;
 import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.onap.portalsdk.core.util.SystemProperties;
 import org.onap.vid.aai.ExceptionWithRequestInfo;
 import org.onap.vid.aai.util.HttpClientMode;
 import org.onap.vid.aai.util.HttpsAuthClient;
@@ -34,6 +33,7 @@ import org.onap.vid.client.HttpBasicClient;
 import org.onap.vid.exceptions.GenericUncheckedException;
 import org.onap.vid.mso.rest.RestInterface;
 import org.onap.vid.utils.Logging;
+import org.onap.vid.utils.SystemPropertiesWrapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpMethod;
 
@@ -64,6 +64,7 @@ public class RestMsoImplementation implements RestInterface {
 
 
     protected HttpsAuthClient httpsAuthClient;
+    protected SystemPropertiesWrapper systemProperties;
 
     private static final String START_LOG = " start";
     private static final String APPLICATION_JSON = "application/json";
@@ -80,8 +81,9 @@ public class RestMsoImplementation implements RestInterface {
      */
 
     @Autowired
-    protected RestMsoImplementation(HttpsAuthClient httpsAuthClient){
+    protected RestMsoImplementation(HttpsAuthClient httpsAuthClient, SystemPropertiesWrapper systemProperties){
         this.httpsAuthClient=httpsAuthClient;
+        this.systemProperties = systemProperties;
     }
 
     @SuppressWarnings("Duplicates")
@@ -89,9 +91,9 @@ public class RestMsoImplementation implements RestInterface {
     {
         final String methodname = "initRestClient()";
 
-        final String username = SystemProperties.getProperty(MsoProperties.MSO_USER_NAME);
-        final String password = SystemProperties.getProperty(MsoProperties.MSO_PASSWORD);
-        final String mso_url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL);
+        final String username = systemProperties.getProperty(MsoProperties.MSO_USER_NAME);
+        final String password = systemProperties.getProperty(MsoProperties.MSO_PASSWORD);
+        final String mso_url = systemProperties.getProperty(MsoProperties.MSO_SERVER_URL);
         final String decrypted_password = Password.deobfuscate(password);
 
         String authString = username + ":" + decrypted_password;
@@ -140,7 +142,7 @@ public class RestMsoImplementation implements RestInterface {
 
         try {
             restObject.set(t);
-            url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
+            url = systemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
 
             MultivaluedHashMap<String, Object> commonHeaders = initMsoClient();
             Logging.logRequest(outgoingRequestsLogger, HttpMethod.GET, url);
@@ -179,7 +181,7 @@ public class RestMsoImplementation implements RestInterface {
         final String methodName = getMethodName();
         logger.debug(EELFLoggerDelegate.debugLogger, "start {}->{}({}, {})", getMethodCallerName(), methodName, path, clazz);
 
-        String url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
+        String url = systemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
         logger.debug(EELFLoggerDelegate.debugLogger, "<== " +  methodName + " sending request to url= " + url);
 
         MultivaluedHashMap<String, Object> commonHeaders = initMsoClient();
@@ -216,7 +218,7 @@ public class RestMsoImplementation implements RestInterface {
         try {
             MultivaluedHashMap<String, Object> commonHeaders = initMsoClient();
 
-            url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
+            url = systemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
             Logging.logRequest(outgoingRequestsLogger, HttpMethod.DELETE, url, r);
             cres = client.target(url)
                     .request()
@@ -281,7 +283,7 @@ public class RestMsoImplementation implements RestInterface {
     public Invocation.Builder prepareClient(String path, String methodName) {
         MultivaluedHashMap<String, Object> commonHeaders = initMsoClient();
 
-        String url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
+        String url = systemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
         logger.debug(EELFLoggerDelegate.debugLogger,"<== " +  methodName + " sending request to url= " + url);
         // Change the content length
         return client.target(url)
@@ -307,7 +309,7 @@ public class RestMsoImplementation implements RestInterface {
             MultivaluedHashMap<String, Object> commonHeaders = initMsoClient();
             userId.ifPresent(id->commonHeaders.put("X-RequestorID", Collections.singletonList(id)));
 
-            url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
+            url = systemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
             Logging.logRequest(outgoingRequestsLogger, httpMethod, url, payload);
             // Change the content length
             final Invocation.Builder restBuilder = client.target(url)
@@ -369,7 +371,7 @@ public class RestMsoImplementation implements RestInterface {
 
             MultivaluedHashMap<String, Object> commonHeaders = initMsoClient();
 
-            url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
+            url = systemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
             Logging.logRequest(outgoingRequestsLogger, HttpMethod.PUT, url, r);
             // Change the content length
             final Response cres = client.target(url)
index 0c05b80..6a498fc 100644 (file)
@@ -50,6 +50,7 @@ import org.onap.vid.mso.MsoUtil;
 import org.onap.vid.mso.RestMsoImplementation;
 import org.onap.vid.mso.RestObject;
 import org.onap.vid.utils.Logging;
+import org.onap.vid.utils.SystemPropertiesWrapper;
 
 
 /**
@@ -71,8 +72,8 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf
      */
     EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoRestClientNew.class);
 
-    public MsoRestClientNew(SyncRestClient client, String baseUrl, HttpsAuthClient authClient) {
-        super(authClient);
+    public MsoRestClientNew(SyncRestClient client, String baseUrl, HttpsAuthClient authClient, SystemPropertiesWrapper systemPropertiesWrapper) {
+        super(authClient,systemPropertiesWrapper);
         this.client = client;
         this.baseUrl = baseUrl;
         this.commonHeaders = initCommonHeaders();
@@ -525,8 +526,8 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf
     }
 
     private Map<String, String> initCommonHeaders() {
-        String username = SystemProperties.getProperty(MsoProperties.MSO_USER_NAME);
-        String password = SystemProperties.getProperty(MsoProperties.MSO_PASSWORD);
+        String username = systemProperties.getProperty(MsoProperties.MSO_USER_NAME);
+        String password = systemProperties.getProperty(MsoProperties.MSO_PASSWORD);
         String decrypted_password = Password.deobfuscate(password);
 
         String authString = username + ":" + decrypted_password;
@@ -538,7 +539,7 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf
         map.put(HttpHeaders.AUTHORIZATION,  "Basic " + authStringEnc);
         map.put(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON);
         map.put(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON);
-        map.put(X_FROM_APP_ID, SystemProperties.getProperty(SystemProperties.APP_DISPLAY_NAME));
+        map.put(X_FROM_APP_ID, systemProperties.getProperty(SystemProperties.APP_DISPLAY_NAME));
         map.put(SystemProperties.ECOMP_REQUEST_ID, Logging.extractOrGenerateRequestId());
         return ImmutableMap.copyOf(map);
     }
index 05a6cde..16ec01d 100755 (executable)
@@ -55,13 +55,11 @@ appDS2.controller("aaiSubscriberController", ["COMPONENT", "FIELD", "PARAMETER",
             $scope.init();\r
             $scope.fetchSubs(FIELD.PROMPT.FETCHING_SUBS);\r
             $scope.fetchServices();\r
-\r
         };\r
 \r
         $scope.cancelCreateSI = function () {\r
 \r
             window.location.href = COMPONENT.WELCOME_PATH;\r
-\r
         };\r
 \r
         $scope.getServiceTypes = function (globalCustomerId) {\r
index 3e6bd2f..af3c218 100644 (file)
  */
 
 require('./aaiSubscriberController');
+require('../services/dataService');
+
 const jestMock = require('jest-mock');
 
 describe('TreeCtrl testing', () => {
-  let $scope;
-  beforeEach(
-      angular.mock.module('app')
-  );
-
-  beforeEach(inject(function (_$controller_) {
-    $scope = {};
-    _$controller_('TreeCtrl', {
-      $scope: $scope
-    });
-  }));
-
-  test('Verify expandAll calls broadcast with expand-all parameter', () => {
-    // given
-    const broadcast = jestMock.fn();
-    $scope.$broadcast = broadcast;
-    FIELD = {
-      ID: {
-        ANGULAR_UI_TREE_EXPANDALL: "angular-ui-tree:expand-all"
-      }
-    };
-    // when
-    $scope.expandAll();
-    // then
-    expect(broadcast).toHaveBeenCalledWith("angular-ui-tree:expand-all");
-  });
+    var window;
+
+    let $scope;
+    beforeEach(
+        angular.mock.module('app')
+    );
+
+    beforeEach(inject(function (_$controller_) {
+        $scope = {};
+        _$controller_('TreeCtrl', {
+            $scope: $scope
+        });
+    }));
+
+    test('Verify expandAll calls broadcast with expand-all parameter', () => {
+        // given
+        const broadcast = jestMock.fn();
+        $scope.$broadcast = broadcast;
+        FIELD = {
+            ID: {
+                ANGULAR_UI_TREE_EXPANDALL: "angular-ui-tree:expand-all"
+            }
+        };
+        // when
+        $scope.expandAll();
+        // then
+        expect(broadcast).toHaveBeenCalledWith("angular-ui-tree:expand-all");
+    });
+
+    test('Verify collapseAll calls broadcast with collapse-all parameter', () => {
+        // given
+        const broadcast = jestMock.fn();
+        $scope.$broadcast = broadcast;
+        FIELD = {
+            ID: {
+                ANGULAR_UI_TREE_COLLAPSEALL: "angular-ui-tree:collapse-all"
+            }
+        };
+        // when
+        $scope.collapseAll();
+        // then
+        expect(broadcast).toHaveBeenCalledWith("angular-ui-tree:collapse-all");
+    });
 
+    test('Verify toggle calls toggle in given scope', () => {
+        // given
+        const testScope = {};
+        testScope.toggle = jestMock.fn();
+        // when
+        $scope.toggle(testScope);
+        // then
+        expect(testScope.toggle).toHaveBeenCalled();
+    });
+
+    test('Verify remove calls remove in given scope', () => {
+        // given
+        const testScope = {};
+        testScope.remove = jestMock.fn();
+        // when
+        $scope.remove(testScope);
+        // then
+        expect(testScope.remove).toHaveBeenCalled();
+    });
+
+    test('Verify moveLastToTheBeginning pops last element from data and puts it on the beginning', () => {
+        // given
+        $scope.data = [ 'a', 'b', 'c' ];
+        const expectedResult = [ 'c', 'a', 'b' ];
+
+        // when
+        $scope.moveLastToTheBeginning();
+        // then
+        expect($scope.data).toMatchObject(expectedResult);
+    });
+
+    test('Verify newSubItem pushes new item into given scope', () => {
+        // given
+        const testScope = {};
+        const testModel = {};
+
+        testModel.id = 2;
+        testModel.nodes = [];
+        testModel.title = 'testObject';
+
+        const expectedResult = {
+            id: 20,
+            title: 'testObject.1',
+            nodes: []
+        };
+
+        testScope.$modelValue = testModel;
+
+        // when
+        $scope.newSubItem(testScope);
+        // then
+        expect(testModel.nodes.length).toBe(1);
+        expect(testModel.nodes[0]).toMatchObject(expectedResult);
+    });
 });
 
+describe('aaiSubscriberController testing', () => {
+
+    beforeEach(
+        angular.mock.module('app')
+    );
+
+    let $scope;
+    let $any;
+
+    let mockFIELD = {
+        PROMPT: {
+            SELECT_SERVICE: 'testService'
+        },
+        NAME: {
+            SERVICE_INSTANCE_ID: 'testID',
+            SERVICE_INSTANCE_NAME: 'testName'
+        },
+        ID: {
+            INVENTORY_RESPONSE_ITEMS: 0,
+            INVENTORY_RESPONSE_ITEM: 0
+        },
+        STYLE: {
+            MSO_CTRL_BTN: 'testButtonStyle',
+        },
+        STATUS: {
+            DONE: 'done',
+        },
+        ERROR: {
+            AAI: 'testAAIError',
+            FETCHING_SERVICE_TYPES: 'testServiceType',
+            SELECT: 'testAlertError',
+        },
+
+    };
+
+    let mockCOMPONENT = {
+        SHOW_COMPONENT_DETAILS: 'testComponentDetails',
+        VNF: 'testComponentVNF',
+        WELCOME_PATH: 'http://test/welcome/',
+        CREATE_INSTANCE_PATH: 'testInstancePath',
+        FEATURE_FLAGS:{},
+    };
+
+    let mockAaiService = {
+        getSubscriptionServiceTypeList(customerId,successFunction,failFunction){},
+        getServiceModelsByServiceType(queryId,customerId,serviceType,successFunction,failFunction){},
+        searchServiceInstances(query){},
+    };
+
+    let mockAsdcService = {
+        isMacro(item){},
+        shouldTakeTheAsyncInstantiationFlow(serviceModel){},
+    };
+
+    let mockPropertyService = {
+        retrieveMsoMaxPollingIntervalMsec(){return 1000},
+        setMsoMaxPollingIntervalMsec(msecs){},
+        retrieveMsoMaxPolls(){return 1000},
+        setMsoMaxPolls(polls){},
+    };
+
+    let mockUtilityService = {
+    };
+
+    let mockVidService = {
+        setModel(model){},
+    };
+
+    let dataService;
+
+    let mockLocation = {
+        path(path){},
+    };
+
+    let mockHttp = {
+        get(){},
+    };
+
+    let mockOwningEntityService = {
+        getOwningEntityProperties(callBack){}
+    };
+
+    let mockQ = {
+
+    };
+
+    $ = (selector) => {return mockSelector};
+    let mockSelector = {
+        addClass(){return this},
+        removeClass(){return this},
+        attr(){},
+    };
+
+    let mock_ = {
+        reduce(service,iterateeFunction,accumulatorFunction){},
+        forEach(services,iteratedFunction){},
+        includes(array, status){
+            return array.includes(status);
+        },
+    };
+
+    let mockedLog = {};
+
+    let mockFeatureFlags = {};
+
+    let mockVIDCONFIGURATION = {};
+
+    let mockRoute = {};
+
+    let mockUibModal = {};
+
+    let timeout;
+
+    beforeEach(inject(function (_$controller_,DataService,$timeout) {
+        $scope = {
+            $on(request,toDoFunction){}
+        };
+        $any = {};
+        dataService = DataService;
+        timeout = $timeout;
+        _$controller_('aaiSubscriberController', {
+            $scope: $scope,
+            COMPONENT: mockCOMPONENT,
+            FIELD: mockFIELD,
+            PARAMETER: $any,
+            DataService: DataService,
+            PropertyService: mockPropertyService,
+            $http: mockHttp,
+            $timeout: timeout,
+            $location: mockLocation,
+            $log: mockedLog,
+            $route: mockRoute,
+            $uibModal: mockUibModal,
+            VIDCONFIGURATION: mockVIDCONFIGURATION,
+            UtilityService: mockUtilityService,
+            vidService: mockVidService,
+            AaiService: mockAaiService,
+            MsoService: $any,
+            OwningEntityService: mockOwningEntityService,
+            AsdcService: mockAsdcService,
+            featureFlags: mockFeatureFlags,
+            $q: mockQ,
+            _: mock_
+        });
+    }));
+
+    test('Verify showVnfDetails calls proper broadcast methots with proper parameters', () => {
+        // given
+        const broadcast = jestMock.fn();
+        $scope.$broadcast = broadcast;
+
+        aaiResult = [[['test']]];
+
+        // when
+        $scope.showVnfDetails('testVNF');
+
+        // then
+        expect(broadcast).toHaveBeenCalledWith(mockCOMPONENT.SHOW_COMPONENT_DETAILS, { componentId: mockCOMPONENT.VNF,callbackFunction: expect.any(Function) } );
+    });
+
+    test('Verify getSubs will call fetchSubs and fetchServices and gets gets customer list from AaiService on success', () => {
+        // given
+        mockAaiService.getSubList = (successFunction,failFunction) => {
+            successFunction(['testCustomer1', 'testCustomer2']);
+        };
+        mockAaiService.getServices2 = (successFunction,failFunction) => {
+            successFunction('testListId');
+        };
+
+        // when
+        $scope.getSubs();
+
+        // then
+        expect( $scope.customerList ).toContain('testCustomer1','testCustomer2');
+        expect( dataService.getServiceIdList() ).toEqual('testListId');
+    });
+
+    test('Verify getSubs will call fetchSubs and fetchServices and return error message from AaiService on fail', () => {
+        // given
+        mockAaiService.getSubList = (successFunction,failFunction) => {
+            failFunction({status: 404, data: 'getSubListTestErrorMessage'} );
+        };
+        mockAaiService.getServices2 = (successFunction,failFunction) => {
+            failFunction({status: 404, data: 'getServices02TestErrorMessage'} );
+        };
+
+        // when
+        $scope.getSubs();
+
+        // then
+        expect( $scope.errorDetails ).toEqual('getServices02TestErrorMessage');
+    });
+
+    test('Verify refreshServiceTypes will call getServiceTypesList and gets service type list from AaiService, with proper customerID ', () => {
+        // given
+        dataService.setGlobalCustomerId('testCustomerID');
+        dataService.setServiceIdList(['testServiceId1','testServiceId2']);
+
+        mockAaiService.getSubscriptionServiceTypeList = (customerId, successFunction,failFunction) => {
+            if (customerId === 'testCustomerID'){
+                successFunction(['testServiceType1', 'testServiceType2']);
+            }
+        };
+
+        // when
+        $scope.refreshServiceTypes('testCustomerID');
+
+        // then
+        expect( $scope.serviceTypeList ).toContain('testServiceType1','testServiceType2');
+    });
+
+    test('Verify refreshServiceTypes will call getServiceTypesList and return error message with wrong customerID ', () => {
+        // given
+        mockAaiService.getSubscriptionServiceTypeList = (customerId, successFunction,failFunction) => {
+            if (customerId === 'testWrongCustomerID'){
+                failFunction( {status: 404, data: 'testErrorMessage'} );
+            }
+        };
+
+        // when
+        $scope.refreshServiceTypes('testWrongCustomerID');
+
+        // then
+        expect( $scope.errorDetails ).toEqual('testErrorMessage');
+    });
+
+    test('Verify refreshServiceTypes will call getServiceTypesList and calls alert with no customerID ', () => {
+        // given
+        alert = jestMock.fn();
+
+        // when
+        $scope.refreshServiceTypes('');
+
+        // then
+        expect( alert ).toHaveBeenCalledWith(mockFIELD.ERROR.SELECT);
+    });
+
+    test('Verify getAaiServiceModels will set correct location ', () => {
+        // given
+        mockLocation.path = jestMock.fn();
+
+        // when
+        $scope.getAaiServiceModels('testServiceType','testSubName');
+
+        // then
+        expect(mockLocation.path).toHaveBeenCalledWith(mockCOMPONENT.CREATE_INSTANCE_PATH);
+    });
+
+    test('Verify getAaiServiceModels wont set correct location if service type is empty', () => {
+        // given
+        mockLocation.path = jestMock.fn();
+
+        // when
+        $scope.getAaiServiceModels('','testSubName');
+
+        // then
+        expect(mockLocation.path).not.toHaveBeenCalled();
+    });
+
+    test('Verify getAaiServiceModelsList will call AaiService getServiceModelsByServiceType and will set wholeData ', () => {
+        // given
+
+        mockAaiService.getServiceModelsByServiceType = (queryId,customerId,serviceType,successFunction,failFunction) => {
+            let response = {};
+            response.data = {};
+            response.data['inventory-response-item'] = [[],[]];
+            response.data['inventory-response-item'][0]['inventory-response-items'] = [];
+            response.data['inventory-response-item'][0]['service-subscription'] = [];
+
+            let testItem = [];
+            testItem['extra-properties'] = [];
+            testItem['extra-properties']['extra-property'] = [[],[],[],[],[],[],[]];
+            testItem['extra-properties']['extra-property'][6]["property-value"] = 1.546;
+
+            testItem['extra-properties']['extra-property'][4]['property-value'] = 0;
+
+            response.data['inventory-response-item'][0]['service-subscription']['service-type'] = 'testServiceType';
+            response.data['inventory-response-item'][0]['inventory-response-items']['inventory-response-item'] = testItem;
+
+
+            successFunction(response);
+        };
+
+        mock_.reduce = (service,iterateeFunction,accumulatorFunction) => {
+            return iterateeFunction([],service);
+        };
+        mock_.forEach = (service,iterateeFunction) => {
+            iterateeFunction(service);
+        };
+        mock_.maxBy = (item,maxFunction) => {
+            return maxFunction( item[0][0] )
+        };
+
+        dataService.setServiceIdList(['testService1','testService2','testService3','testService4']);
+        dataService.setSubscribers([{subscriberName:'testSubscriber1'},{subscriberName:'testSubscriber2'},{subscriberName:'testSubscriber3'},{subscriberName:'testSubscriber4'}]);
+        dataService.setGlobalCustomerId(2);
+        dataService.setSubscriberName('testSubscriber1');
+
+        // when
+        $scope.getAaiServiceModelsList();
+
+        // then
+        expect($scope.services[0]).toEqual(1.546);
+        expect($scope.serviceType).toEqual('testServiceType');
+    });
+
+    test('Verify getAaiServiceModelsList will call AaiService getServiceModelsByServiceType and will return error data on fail ', () => {
+        // given
+        dataService.setServiceIdList([['testServiceId1','testServiceId2']]);
+        dataService.setSubscribers(['testSubscriber1,testSubscriber2']);
+
+        mockAaiService.getServiceModelsByServiceType = (queryId,customerId,serviceType,successFunction,failFunction) => {
+            failFunction( {status: 404, data: 'testErrorMessage'})
+        };
+
+        // when
+        $scope.getAaiServiceModelsList();
+
+        // then
+        expect($scope.errorDetails).toEqual('testErrorMessage');
+    });
+
+    test('Verify getAaiServiceModelsList will call AaiService getServiceModelsByServiceType and will return error data if respose data is empty ', () => {
+        // given
+        dataService.setServiceIdList([['testServiceId1','testServiceId2']]);
+        dataService.setSubscribers(['testSubscriber1,testSubscriber2']);
+
+        mockAaiService.getServiceModelsByServiceType = (queryId,customerId,serviceType,successFunction,failFunction) => {
+            let response = {};
+            response.data = {};
+            response.data['inventory-response-item'] = [];
+            successFunction(response);
+        };
+
+        // when
+        $scope.getAaiServiceModelsList();
+
+        // then
+        expect($scope.status).toEqual('Failed to get service models from SDC.');
+    });
+
+    test('Verify deployService will call http get method to rest model service', () => {
+        // given
+        mockedLog.error = jestMock.fn();
+        mockAsdcService.isMacro = (item) => { return true };
+        mockAsdcService.shouldTakeTheAsyncInstantiationFlow = (serviceModel) => {return 'testModel'};
+        mockUtilityService.convertModel = (serviceModel)=>{return serviceModel};
+        $scope.$broadcast = (broadcastType, broadcastObject) => {broadcastObject.callbackFunction(
+            {
+                isSuccessful:true,
+                control:
+                    [
+                        {id:"subscriberName",value:"testSubscriber"},
+                        {id:"serviceType",value:"testService"}
+                        ],
+                instanceId:"testInstance"
+            })};
+
+        let service = {
+            "service-instance":{
+                "model-version-id": 101
+            }
+        };
+
+        $scope.refreshSubs = jestMock.fn();
+
+        let mockedGetPromise = Promise.resolve({data: {service: {name: 'testServiceName' }}});
+        mockHttp.get = () => mockedGetPromise;
+
+        // when
+        $scope.deployService(service,true);
+    });
+
+    test('Verify deployService will log error if get fails ', () => {
+        // given
+
+        let mockedGetPromise = Promise.reject({code: 404});
+        mockHttp.get = () => mockedGetPromise;
+
+        let service = {
+            "service-instance":{
+                "model-version-id": 101
+            }
+        };
+
+        // when
+        $scope.deployService(service,false);
+    });
+
+    test('Verify refreshSubs fetches Subs and Services', () => {
+        // given
+        $scope.fetchSubs = jestMock.fn();
+        $scope.fetchServices = jestMock.fn();
+        $scope.init = jestMock.fn();
+
+        mockFIELD.PROMPT.REFRESH_SUB_LIST = 'testRefreshMock';
+
+        // when
+        $scope.refreshSubs();
+
+        // then
+        expect($scope.init).toHaveBeenCalled();
+        expect($scope.fetchSubs).toHaveBeenCalledWith(mockFIELD.PROMPT.REFRESH_SUB_LIST);
+        expect($scope.fetchServices).toHaveBeenCalled();
+
+    });
+
+    test('Verify loadOwningEntity gets owning entity properties', () => {
+        // given
+        mockOwningEntityService.getOwningEntityProperties = (callBack) => {
+          callBack({owningEntity:'testOwner',project:'testProject'});
+        };
+
+        // when
+        $scope.loadOwningEntity();
+
+        // then
+        expect($scope.owningEntities).toEqual('testOwner');
+        expect($scope.projects).toEqual('testProject');
+    });
+
+    test('Verify getPermitted returns items permission', () => {
+        // given
+        mockFIELD.ID.IS_PERMITTED = 'testPermission';
+
+        // when
+        expect(
+            $scope.getPermitted({})
+        ).toEqual(undefined);
+
+        expect(
+            $scope.getPermitted({isPermitted:true})
+        ).toEqual(true);
+
+        expect(
+            $scope.getPermitted({isPermitted:false})
+        ).toEqual(undefined);
+
+        expect(
+            $scope.getPermitted({isPermitted:false,testPermission:true})
+        ).toEqual(true);
+
+        expect(
+            $scope.getPermitted({testPermission:false,testPermission:false})
+        ).toEqual(false);
+
+        expect(
+            $scope.getPermitted({isPermitted:true,testPermission:false})
+        ).toEqual(true);
+    });
+
+    test('Verify getSubDetails calls to aaiService for service instance', () => {
+        // given
+        let aaiPromise = Promise.resolve(
+            {
+                displayData:[
+                    {globalCustomerId:"testCustomerId01",subscriberName:"testCustomer1"},
+                    {globalCustomerId:"testCustomerId02",subscriberName:"testCustomer2"},
+                ]
+            });
+
+        mockLocation.url = () => {return ""};
+
+        mockAaiService.searchServiceInstances = (query)=>aaiPromise;
+
+        // when
+        $scope.getSubDetails();
+    });
+
+    test('Verify getSubDetails catches bad response', () => {
+        // given
+        let aaiPromise = Promise.reject(
+            {data:'testError',status:404});
+
+        mockLocation.url = () => {return ""};
+
+        mockAaiService.searchServiceInstances = (query)=>aaiPromise;
+
+        // when
+        $scope.getSubDetails();
+    });
+
+    test('Verify getComponentList returns list of components if query is correct', () => {
+        // given
+        mockLocation.search = () => {
+            return {
+                subscriberId: 'testSubscriberID',
+                serviceType: 'testService',
+                serviceInstanceId: "testServiceInstanceID",
+                subscriberName: "testSubscriber",
+                aaiModelVersionId: "testModelVersion"
+            }
+        };
+
+        mockVidService.getModel = () => {
+            return {
+                service:{
+                    uuid: "testModelVersion",
+                },
+            }
+        };
+
+        mockUtilityService.hasContents = (content) => {
+            if (content==="testModelVersion") {
+                return true;
+            }
+            return false;
+        };
+
+        mockQ.resolve = (item) => {return Promise.resolve("testModelVersion")};
+
+        $scope.prepareScopeWithModel = () => {return Promise.resolve()};
+
+        mockAaiService.getVlansByNetworksMapping = (globalCustomerId, serviceType, serviceInstanceId, modelServiceUuid) => {
+            return Promise.resolve({serviceNetworks:true});
+        };
+
+        $scope.service ={
+            model:{
+                service:{
+                    uuid: 'testModelServiceUuid'
+                }
+            }
+        };
+
+        mockedLog.debug = () => {};
+        mockUtilityService.isObjectEmpty = () => {
+            return false;
+        };
+
+        mockFIELD.ID.INVENTORY_RESPONSE_ITEM = "testResponseItems";
+        mockFIELD.ID.SERVICE_SUBSCRIPTION = 0;
+        mockFIELD.ID.SERVICE_INSTANCES = 0;
+        mockFIELD.ID.SERVICE_INSTANCE = 0;
+        mockFIELD.ID.SERVICE_INSTANCE_ID = 'testServiceInstanceID';
+        mockFIELD.STATUS.ASSIGNED = 'teststatus';
+
+        mockAaiService.runNamedQuery = (namedQueryId,globalCustomerId,serviceType,serviceInstanceId,successFunction,failureFunction) => {
+            successFunction({
+                data:{
+                    testResponseItems:[
+                        "testItem1",
+                        "testItem2",
+                        "testItem3",
+                    ]
+                },
+            });
+            return Promise.resolve("testComponentList");
+        };
+
+        mockAaiService.getPortMirroringData = (portMirroringConfigurationIds) => {
+            return Promise.resolve({data:[8080,9090]});
+        };
+
+        mockAaiService.getPortMirroringSourcePorts = (portMirroringConfigurationIds) => {
+          return Promise.resolve({data:[8888,9999]})
+        };
+
+        mockAaiService.getSubscriberName = (customerId, successFunction) => {
+            successFunction({subscriberName:"testSubscriber1",serviceSubscriptions:[[
+                    [[[{'testServiceInstanceID':'testServiceInstanceID','orchestration-status':'testStatus'},{'testServiceInstanceID':'','orchestration-status':''}]]],
+                    [[[{'testServiceInstanceID':'','orchestration-status':''}]]]
+                ]],
+            });
+        };
+
+        mock_.map = (serviceNetworkVlans, networkId) => {
+            return ["aaiNetworkId1","aaiNetworkId2"];
+        };
+
+        // when
+        return $scope.getComponentList('','').
+        then(components =>{
+            expect(components).toEqual("testComponentList")
+        });
+
+    });
+
+    test('Verify handleServerError sets proper  $scope.error and $scope.status', () => {
+        // given
+        mockUtilityService.getHttpErrorMessage = (response) => {return response.statusText};
+        mockFIELD.ERROR.SYSTEM_ERROR = "testSystemError";
+        mockFIELD.STATUS.ERROR = "testStatusError";
+
+        // when
+        $scope.handleServerError({statusText:'testStatusError'},'');
+
+        // then
+        expect($scope.error).toEqual("testSystemError (testStatusError)");
+        expect($scope.status).toEqual("testStatusError");
+    });
+
+    test('Verify showContentError sets proper $scope.error and $scope.status if UtilityService has that content', () => {
+        // given
+        mockFIELD.STATUS.ERROR = "testStatusError";
+
+        mockUtilityService.hasContents = (content) => {
+          return content === 'testContentError';
+
+        };
+
+        // when
+        $scope.showContentError('testContentError');
+
+        // then
+        expect($scope.error).toEqual("System failure (testContentError)");
+        expect($scope.status).toEqual("testStatusError");
+    });
+
+    test('Verify showContentError sets proper $scope.error and $scope.status if UtilityService has not that content', () => {
+        // given
+        mockFIELD.ERROR.SYSTEM_ERROR = "testSystemError";
+        mockFIELD.STATUS.ERROR = "testStatusError";
+
+        mockUtilityService.hasContents = (content) => {
+            return false;
+        };
+
+        // when
+        $scope.showContentError('testContentError');
+
+        // then
+        expect($scope.error).toEqual("testSystemError");
+        expect($scope.status).toEqual("testStatusError");
+    });
+
+    test('Verify handleInitialResponse shows error for response codes other then 200,201,202', ()  => {
+        // given
+        let response = {
+            data:{
+                status:404,
+            }
+        };
+
+        mockFIELD.ERROR.MSO = "testSystemError";
+        mockFIELD.ERROR.AAI_FETCHING_CUST_DATA = "testStatusError:";
+
+        $scope.showError = jestMock.fn();
+
+        // when
+        $scope.handleInitialResponse(response);
+
+        // then
+        expect($scope.showError).toHaveBeenCalledWith("testSystemError");
+        expect($scope.status).toEqual("testStatusError:404");
+    });
+
+    test('Verify handleInitialResponse updates customer list with response code 202', ()  => {
+        // given
+        let customer ={
+            'globalCustomerId':'testCustomerID',
+            "subscriberName":'testSubscriber',
+            "isPermitted":false
+        };
+        let response = {
+            data:{
+                status:202,
+                customer:[customer],
+            }
+        };
+
+        mockFIELD.ID.GLOBAL_CUSTOMER_ID = 'globalCustomerId';
+        mockFIELD.ID.SUBNAME = 'subscriberName';
+        mockFIELD.ID.IS_PERMITTED = 'isPermitted';
+
+        // when
+        $scope.handleInitialResponse(response);
+
+        // then
+        expect($scope.customerList).toContainEqual(customer);
+    });
+
+    test('Verify handleInitialResponse calls showContentError with wrong response ', ()  => {
+        // given
+        $scope.showContentError = jestMock.fn();
+
+        // when
+        $scope.handleInitialResponse(null);
+
+        // then
+        expect($scope.showContentError).toHaveBeenCalledWith(expect.objectContaining({message:"Cannot read property 'data' of null"}));
+    });
+
+    test('Verify isConfigurationDataAvailiable will return proper response', ()  => {
+        // given
+        mockedLog.debug = jestMock.fn();
+        // when
+        expect( $scope.isConfigurationDataAvailiable({configData:{}}) ).toEqual(true);
+        expect( $scope.isConfigurationDataAvailiable({configData:{errorDescription:"testerror"}}) ).toEqual(false);
+        expect( $scope.isConfigurationDataAvailiable({}) ).toEqual(undefined);
+
+    });
+
+    test('Verify isActivateDeactivateEnabled will return proper response', ()  => {
+        // given
+        mockedLog.debug = jestMock.fn();
+
+        $scope.serviceOrchestrationStatus = "active";
+        mockCOMPONENT.ACTIVATE_SERVICE_STATUSES = ["active","up"];
+
+        // when
+        expect( $scope.isActivateDeactivateEnabled("deactivate")).toEqual(true);
+        expect( $scope.isActivateDeactivateEnabled("activate")).toEqual(true);
+
+        $scope.serviceOrchestrationStatus = "down";
+        mockCOMPONENT.ACTIVATE_SERVICE_STATUSES = ["active","up"];
+
+        expect( $scope.isActivateDeactivateEnabled("deactivate")).toEqual(false);
+        expect( $scope.isActivateDeactivateEnabled("activate")).toEqual(false);
+
+        $scope.serviceOrchestrationStatus = null;
+
+        expect( $scope.isActivateDeactivateEnabled(null)).toEqual(false);
+
+    });
+
+    test('Verify isShowVerifyService will return proper response base on feature flag', ()  => {
+        // given
+        mockCOMPONENT.FEATURE_FLAGS.FLAG_SHOW_VERIFY_SERVICE = 'showVerifyService';
+        mockFeatureFlags.isOn = (flag) => {
+            if (flag === 'showVerifyService'){return true};
+        };
+
+        // when
+        expect( $scope.isShowVerifyService()).toEqual(true);
+    });
+
+    test('Verify isEnableVerifyService will return false if is not ALaCarte', ()  => {
+        // given
+        dataService.setALaCarte(false);
+
+        // when
+        expect( $scope.isEnableVerifyService()).toEqual(false);
+    });
+
+    test('Verify isEnableVerifyService will return verifyButtonEnabled if is ALaCarte', ()  => {
+        // given
+        dataService.setALaCarte(true);
+
+        // when
+        $scope.verifyButtonEnabled = true;
+        expect( $scope.isEnableVerifyService()).toEqual(true);
+
+        $scope.verifyButtonEnabled = false;
+        expect( $scope.isEnableVerifyService()).toEqual(false);
+    });
+
+    test('Verify activateVerifyService will post POMBA verification', ()  => {
+        // given
+        mockCOMPONENT.VERIFY_SERVICE_URL = "/testURL";
+
+        mockAaiService.postPOMBAverificationRequest = jestMock.fn();
+
+        $scope.serviceInstanceId = "testInstanceID";
+        $scope.service = {model:{service:{}},instance:{}};
+        $scope.service.model.service.uuid = "testUuid";
+        $scope.service.model.service.invariantUuid = "testInvariantUuid";
+        $scope.globalCustomerId = "testCustomerId";
+        $scope.service.instance.serviceType = "testServiceType";
+
+        // when
+        $scope.activateVerifyService();
+
+        // then
+        expect(mockAaiService.postPOMBAverificationRequest).toHaveBeenCalledWith(
+            "/testURL",
+            expect.objectContaining({'serviceInstanceList':[expect.any(Object)]}),
+            expect.objectContaining({'headers':expect.any(Object)}));
+    });
+
+    test('Verify isShowAssignmentsEnabled will return proper response determine by feature flag', ()  => {
+        // given
+        mockCOMPONENT.FEATURE_FLAGS.FLAG_SHOW_ASSIGNMENTS = "showAssignment";
+
+        mockFeatureFlags.isOn = (flag) => {
+            if (flag === 'showAssignment'){return true};
+        };
+
+        // when
+        $scope.serviceOrchestrationStatus = "assigned";
+        expect( $scope.isShowAssignmentsEnabled() ).toEqual(true);
+
+        $scope.serviceOrchestrationStatus = "notAssigned";
+        expect( $scope.isShowAssignmentsEnabled() ).toEqual(false);
+
+        $scope.serviceOrchestrationStatus = null;
+        expect( $scope.isShowAssignmentsEnabled() ).toEqual(false);
+    });
+
+    test('Verify isActivateFabricConfiguration will return proper response determine by feature flag', ()  => {
+        // given
+        mockCOMPONENT.FEATURE_FLAGS.FLAG_FABRIC_CONFIGURATION_ASSIGNMENTS = "fabricConfigurationAssignment";
+        $scope.hasFabricConfigurations = true;
+
+        mockFeatureFlags.isOn = (flag) => {
+            if (flag === 'fabricConfigurationAssignment'){return true};
+        };
+
+        // when
+        $scope.serviceOrchestrationStatus = "assigned";
+        expect( $scope.isActivateFabricConfiguration() ).toEqual(true);
+
+        $scope.serviceOrchestrationStatus = "notAssigned";
+        expect( $scope.isActivateFabricConfiguration() ).toEqual(false);
+
+        $scope.serviceOrchestrationStatus = null;
+        expect( $scope.isActivateFabricConfiguration() ).toEqual(false);
+    });
+
+    test('Verify isResumeShown will return proper response determine by feature flag with disabled ActivateDeactivate', ()  => {
+        // given
+        $scope.serviceOrchestrationStatus = "assigned";
+        $scope.isActivateDeactivateEnabled = () => {return false};
+
+        // when
+        expect( $scope.isResumeShown("assigned") ).toEqual(true);
+        expect( $scope.isResumeShown("unAssigned") ).toEqual(false);
+
+    });
+
+    test('Verify isResumeShown will return proper response determine by feature flag with enable ActivateDeactivate', ()  => {
+        // given
+        $scope.serviceOrchestrationStatus = "assigned";
+        $scope.isActivateDeactivateEnabled = () => {return true};
+
+        // when
+        expect( $scope.isResumeShown("assigned") ).toEqual(false);
+        expect( $scope.isResumeShown("unAssigned") ).toEqual(false);
+
+    });
+
+    test('Verify close will call time out cancel and hides pop up window if timer is defined', ()  => {
+        // given
+        $scope.timer = 1000;
+        $scope.isPopupVisible = true;
+
+        timeout.cancel = jestMock.fn();
+
+        // when
+        $scope.close();
+
+        // then
+        expect(timeout.cancel).toHaveBeenCalledWith(1000);
+        expect($scope.isPopupVisible).toEqual(false);
+    });
+
+    test('Verify close will hide pop up window if timer is undefined', ()  => {
+        // given
+        $scope.timer = undefined;
+        $scope.isPopupVisible = true;
+
+        // when
+        $scope.close();
+
+        // then
+        expect($scope.isPopupVisible).toEqual(false);
+    });
+
+    test('Verify reloadRoute will call reload on rout', ()  => {
+        // given
+        mockRoute.reload = jestMock.fn();
+
+        // when
+        $scope.reloadRoute();
+
+        // then
+        expect(mockRoute.reload).toHaveBeenCalled();
+    });
+
+    test('Verify prevPage will decrease currentPage', ()  => {
+        // given
+        $scope.currentPage = 5;
+
+        // when
+        $scope.prevPage();
+
+        // then
+        expect($scope.currentPage).toEqual(4);
+    });
+
+    test('Verify showAssignmentsSDNC will return proper response base on VIDCONFIGURATION', ()  => {
+        // given
+        $scope.service = {};
+        $scope.service.instance = {};
+        $scope.service.instance.id = "testServiceInstanceId";
+
+        mockVIDCONFIGURATION.SDNC_SHOW_ASSIGNMENTS_URL = "test/ulr/to/<SERVICE_INSTANCE_ID>";
+
+        // when
+        expect( $scope.showAssignmentsSDNC() ).toEqual("test/ulr/to/testServiceInstanceId");
+    });
+
+    test('Verify showAssignmentsSDNC will return null if service instance dos not exist or is null', ()  => {
+        // given
+        $scope.service = {};
+
+        // when
+        expect( $scope.showAssignmentsSDNC() ).toEqual(null);
+
+        $scope.service.instance = null;
+        expect( $scope.showAssignmentsSDNC() ).toEqual(null);
+    });
+
+    test('Verify activateFabricConfigurationMSO with logged in user, will call uibModal open that will return response ', ()  => {
+        // given
+        let resopnse = {};
+
+        mockCOMPONENT.MSO_ACTIVATE_FABRIC_CONFIGURATION_REQ = "testMsoActivateType";
+
+        $scope.service = {};
+        $scope.service.model = {};
+        $scope.service = {};
+        $scope.serviceInstanceId= "testServiceInstanceId";
+
+        dataService.setLoggedInUserId("testUserId");
+
+        mockUibModal.open = (testResponse) => {
+            resopnse = testResponse.resolve;
+        };
+
+        // when
+        $scope.activateFabricConfigurationMSO();
+
+        // then
+        expect( resopnse.msoType() ).toEqual("testMsoActivateType");
+        expect( resopnse.requestParams().serviceInstanceId ).toEqual("testServiceInstanceId");
+        expect( resopnse.requestParams().userId ).toEqual("testUserId");
+        expect( resopnse.configuration() ).toEqual(undefined);
+    });
+
+    test('Verify activateFabricConfigurationMSO without logged in user will first get user id from AaiService , will call uibModal open that will return response ', ()  => {
+        // given
+        let resopnse = {};
+
+        mockCOMPONENT.MSO_ACTIVATE_FABRIC_CONFIGURATION_REQ = "testMsoActivateType";
+
+        $scope.service = {};
+        $scope.service.model = {};
+        $scope.service = {};
+        $scope.serviceInstanceId= "testServiceInstanceId";
+
+
+        mockAaiService.getLoggedInUserID = (onSuccess) => {
+            onSuccess({data:"testAaiUserId"});
+        };
+
+        mockUibModal.open = (testResponse) => {
+            resopnse = testResponse.resolve;
+        };
+
+        // when
+        $scope.activateFabricConfigurationMSO();
+
+        // then
+        expect( resopnse.msoType() ).toEqual("testMsoActivateType");
+        expect( resopnse.requestParams().serviceInstanceId ).toEqual("testServiceInstanceId");
+        expect( resopnse.requestParams().userId ).toEqual("testAaiUserId");
+        expect( resopnse.configuration() ).toEqual(undefined);
+    });
+
+    test('Verify activateMSOInstance with logged in user, will get aicZone from AaiService and call uibModal open that will return response ', ()  => {
+        // given
+        let resopnse = {};
+
+        mockCOMPONENT.MSO_ACTIVATE_SERVICE_REQ = "testMsoActivateType";
+
+        $scope.service = {};
+        $scope.service.model = {};
+        $scope.service.instance = {};
+
+        dataService.setLoggedInUserId("testUserId");
+
+        mockAaiService.getAicZoneForPNF = (globalCustomerId,serviceType,serviceInstanceId,getZoneFunction) => {
+            getZoneFunction("testAicZone");
+        };
+
+        mockUibModal.open = (testResponse) => {
+            resopnse = testResponse.resolve;
+        };
+
+        // when
+        $scope.activateMSOInstance();
+
+        // then
+        expect( resopnse.msoType() ).toEqual("testMsoActivateType");
+        expect( resopnse.requestParams().aicZone ).toEqual("testAicZone");
+        expect( resopnse.requestParams().userId ).toEqual("testUserId");
+        expect( resopnse.configuration() ).toEqual(undefined);
+    });
+
+    test('Verify activateMSOInstance without logged in user will first get user id from AaiService , will call uibModal open that will return response ', ()  => {
+        // given
+        let resopnse = {};
+
+        mockCOMPONENT.MSO_ACTIVATE_SERVICE_REQ = "testMsoActivateType";
+
+        $scope.service = {};
+        $scope.service.model = {};
+        $scope.service.instance = {};
+
+
+        mockAaiService.getAicZoneForPNF = (globalCustomerId,serviceType,serviceInstanceId,getZoneFunction) => {
+            getZoneFunction("testAicZone");
+        };
+
+        mockAaiService.getLoggedInUserID = (onSuccess) => {
+            onSuccess({data:"testAaiUserId"});
+        };
+
+        mockUibModal.open = (testResponse) => {
+            resopnse = testResponse.resolve;
+        };
+
+        // when
+        $scope.activateMSOInstance();
+
+        // then
+        expect( resopnse.msoType() ).toEqual("testMsoActivateType");
+        expect( resopnse.requestParams().aicZone ).toEqual("testAicZone");
+        expect( resopnse.requestParams().userId ).toEqual("testAaiUserId");
+        expect( resopnse.configuration() ).toEqual(undefined);
+    });
+
+    test('Verify deactivateMSOInstance will get call uibModal open that will return response ', ()  => {
+        // given
+        let resopnse = {};
+
+        mockCOMPONENT.MSO_DEACTIVATE_SERVICE_REQ = "testMsoDeactivateType";
+
+        $scope.service = {};
+        $scope.service.model = {};
+        $scope.service.instance = {};
+
+
+        mockAaiService.getAicZoneForPNF = (globalCustomerId,serviceType,serviceInstanceId,getZoneFunction) => {
+            getZoneFunction("testAicZone");
+        };
+
+        mockAaiService.getLoggedInUserID = (onSuccess) => {
+            onSuccess({data:"testAaiUserId"});
+        };
+
+        mockUibModal.open = (testResponse) => {
+            resopnse = testResponse.resolve;
+        };
+
+        // when
+        $scope.deactivateMSOInstance();
+
+        // then
+        expect( resopnse.msoType() ).toEqual("testMsoDeactivateType");
+        expect( resopnse.requestParams().aicZone ).toEqual("testAicZone");
+        expect( resopnse.requestParams().userId ).toEqual("testAaiUserId");
+        expect( resopnse.configuration() ).toEqual(undefined);
+    });
+
+    test('Verify deleteConfiguration will get call uibModal open that will return response ', ()  => {
+        // given
+        let resopnse = {};
+
+        serviceObject = {
+            model:{
+                service:{
+                    invariantUuid:"testInvariantUuid",
+                    uuid:"testUuid",
+                    name:"testService",
+                    version:"testVersion",
+                }},
+            instance:{
+                serviceInstanceId:"testServiceInstanceId",
+            }
+        };
+
+        configuration = {
+            modelInvariantId:"testModelInvariantId",
+            modelVersionId:"testModelVersionId",
+            modelCustomizationId:"testModelCustomizationId",
+            nodeId:"testNodeId",
+            DELETE:"testDELETE",
+        };
+
+        mockCOMPONENT.MSO_DELETE_CONFIGURATION_REQ = "testMsoDeleteType";
+
+        mockAaiService.getLoggedInUserID = (successFunction) => {
+            successFunction( {data:"testLoggedInUserId"} );
+        };
+
+        mockUibModal.open = (testResponse) => {
+            resopnse = testResponse.resolve;
+        };
+
+        // when
+        $scope.deleteConfiguration(serviceObject, configuration);
+
+        // then
+        expect( resopnse.msoType() ).toEqual("testMsoDeleteType");
+        expect( resopnse.requestParams().serviceModel.modelInvariantId ).toEqual("testInvariantUuid");
+        expect( resopnse.requestParams().serviceModel.modelVersionId ).toEqual("testUuid");
+        expect( resopnse.requestParams().serviceModel.modelName ).toEqual("testService");
+        expect( resopnse.requestParams().serviceModel.modelVersion ).toEqual("testVersion");
+        expect( resopnse.requestParams().serviceInstanceId ).toEqual("testServiceInstanceId");
+        expect( resopnse.requestParams().configurationModel.modelInvariantId ).toEqual("testModelInvariantId");
+        expect( resopnse.requestParams().configurationModel.modelVersionId ).toEqual("testModelVersionId");
+        expect( resopnse.requestParams().configurationModel.modelCustomizationId ).toEqual("testModelCustomizationId");
+        expect( resopnse.requestParams().configurationId ).toEqual("testNodeId");
+        expect( resopnse.requestParams().configStatus ).toEqual("testDELETE");
+        expect( resopnse.requestParams().userId ).toEqual("testLoggedInUserId");
+    });
+
+    test('Verify toggleConfigurationStatus will get call uibModal open that will return response ', ()  => {
+        // given
+        let resopnse = {};
+
+        serviceObject = {
+            model:{
+                service:{
+                    invariantUuid:"testInvariantUuid",
+                    uuid:"testUuid",
+                    name:"testService",
+                    version:"testVersion",
+                }},
+            instance:{
+                serviceInstanceId:"testServiceInstanceId",
+            }
+        };
+
+        configuration = {
+            modelInvariantId:"testModelInvariantId",
+            modelVersionId:"testModelVersionId",
+            modelCustomizationId:"testModelCustomizationId",
+            nodeId:"testNodeId",
+            nodeStatus:"testNodeStatus",
+        };
+
+        mockAaiService.getLoggedInUserID = (successFunction) => {
+            successFunction( {data:"testLoggedInUserId"} );
+        };
+
+        mockUibModal.open = (testResponse) => {
+            resopnse = testResponse.resolve;
+        };
+
+        mockCOMPONENT.MSO_CHANGE_CONFIG_STATUS_REQ = "testMsoChangeConfig";
+
+        // when
+        $scope.toggleConfigurationStatus(serviceObject, configuration);
+
+        // then
+        expect( resopnse.msoType() ).toEqual("testMsoChangeConfig");
+        expect( resopnse.requestParams().serviceModel.modelInvariantId ).toEqual("testInvariantUuid");
+        expect( resopnse.requestParams().serviceModel.modelVersionId ).toEqual("testUuid");
+        expect( resopnse.requestParams().serviceModel.modelName ).toEqual("testService");
+        expect( resopnse.requestParams().serviceModel.modelVersion ).toEqual("testVersion");
+        expect( resopnse.requestParams().serviceInstanceId ).toEqual("testServiceInstanceId");
+        expect( resopnse.requestParams().configurationModel.modelInvariantId ).toEqual("testModelInvariantId");
+        expect( resopnse.requestParams().configurationModel.modelVersionId ).toEqual("testModelVersionId");
+        expect( resopnse.requestParams().configurationModel.modelCustomizationId ).toEqual("testModelCustomizationId");
+        expect( resopnse.requestParams().configurationId ).toEqual("testNodeId");
+        expect( resopnse.requestParams().configStatus ).toEqual("testNodeStatus");
+        expect( resopnse.requestParams().userId ).toEqual("testLoggedInUserId");
+    });
+
+    test('Verify togglePortStatus will get call uibModal open that will return response ', ()  => {
+        // given
+        let resopnse = {};
+
+        let serviceObject = {
+            model:{
+                service:{
+                    invariantUuid:"testInvariantUuid",
+                    uuid:"testUuid",
+                    name:"testService",
+                    version:"testVersion",
+                }},
+            instance:{
+                serviceInstanceId:"testServiceInstanceId",
+            }
+        };
+
+        let configuration = {
+            modelInvariantId:"testModelInvariantId",
+            modelVersionId:"testModelVersionId",
+            modelCustomizationId:"testModelCustomizationId",
+            nodeId:"testNodeId",
+        };
+
+        let port = {
+            portId:"testPort",
+            portStatus:"open",
+        };
+
+        mockAaiService.getLoggedInUserID = (successFunction) => {
+            successFunction( {data:"testLoggedInUserId"} );
+        };
+
+        mockUibModal.open = (testResponse) => {
+            resopnse = testResponse.resolve;
+        };
+
+        mockCOMPONENT.MSO_CHANGE_PORT_STATUS_REQ = "testMsoPortStatus";
+
+        // when
+        $scope.togglePortStatus(serviceObject, configuration,port);
+
+        // then
+        expect( resopnse.msoType() ).toEqual("testMsoPortStatus");
+        expect( resopnse.requestParams().serviceModel.modelInvariantId ).toEqual("testInvariantUuid");
+        expect( resopnse.requestParams().serviceModel.modelVersionId ).toEqual("testUuid");
+        expect( resopnse.requestParams().serviceModel.modelName ).toEqual("testService");
+        expect( resopnse.requestParams().serviceModel.modelVersion ).toEqual("testVersion");
+        expect( resopnse.requestParams().serviceInstanceId ).toEqual("testServiceInstanceId");
+        expect( resopnse.requestParams().configurationModel.modelInvariantId ).toEqual("testModelInvariantId");
+        expect( resopnse.requestParams().configurationModel.modelVersionId ).toEqual("testModelVersionId");
+        expect( resopnse.requestParams().configurationModel.modelCustomizationId ).toEqual("testModelCustomizationId");
+        expect( resopnse.requestParams().configurationId ).toEqual("testNodeId");
+        expect( resopnse.requestParams().userId ).toEqual("testLoggedInUserId");
+        expect( resopnse.requestParams().portId ).toEqual("testPort");
+        expect( resopnse.requestParams().portStatus ).toEqual("open");
+    });
+
+
+    test('Verify getServiceInstancesSearchResults will get global customer Id from AaiService with proper service instance', ()  => {
+        // given
+        let selectedCustomer = 'testCustomer';
+        let selectedInstanceIdentifierType = 'testInstanceIdentifierType';
+        let selectedServiceInstance = 'testServiceInstance ';
+        let selectedProject = "testProject";
+        let selectedOwningEntity = "testOwningEntity";
+
+        let globalCustomerId = 'testCustomerIdResponse';
+
+        mockAaiService.getGlobalCustomerIdByInstanceIdentifier = jestMock.fn((serviceInstance, instanceIdentifierType) => {
+            if(serviceInstance===selectedServiceInstance && instanceIdentifierType == selectedInstanceIdentifierType){
+                return Promise.resolve(globalCustomerId);
+            }
+            return Promise.reject();
+        });
+
+        mockAaiService.getMultipleValueParamQueryString = ( element, subPath) => {
+            return subPath + '/ ' + element;
+        };
+
+        mockAaiService.getJoinedQueryString = jestMock.fn();
+
+        mock_.map = (element,id) => {
+            return element;
+        };
+
+        mockCOMPONENT.PROJECT_SUB_PATH = "test/project/sub";
+        mockCOMPONENT.OWNING_ENTITY_SUB_PATH = "test/entity/sub";
+        mockCOMPONENT.SELECTED_SUBSCRIBER_SUB_PATH = "test/subscriber/sub";
+        mockCOMPONENT.SELECTED_SERVICE_INSTANCE_SUB_PATH = "test/service/instance/sub";
+        mockCOMPONENT.SELECTED_SERVICE_SUB_PATH = "text/service/sub";
+
+        mockUtilityService.hasContents = (element) => {
+          if (  element ===  selectedCustomer ||
+                element === selectedServiceInstance ||
+                element === globalCustomerId )
+              return true;
+        };
+
+        window.location = {};
+
+        // when
+        $scope.getServiceInstancesSearchResults(selectedCustomer, selectedInstanceIdentifierType, selectedServiceInstance, selectedProject, selectedOwningEntity);
+
+        // then
+        expect(mockAaiService.getGlobalCustomerIdByInstanceIdentifier).toHaveBeenCalledWith(selectedServiceInstance,selectedInstanceIdentifierType);
+    });
+
+    test('Verify getServiceInstancesSearchResults will alert error if non of parameters is located in UtilityService', ()  => {
+        // given
+        let selectedCustomer = 'testCustomer';
+        let selectedInstanceIdentifierType = 'testInstanceIdentifierType';
+        let selectedServiceInstance = 'testServiceInstance ';
+        let selectedProject = "testProject";
+        let selectedOwningEntity = "testOwningEntity";
+
+        let globalCustomerId = 'testCustomerIdResponse';
+
+        mockAaiService.getGlobalCustomerIdByInstanceIdentifier = (serviceInstance, instanceIdentifierType) => {
+            if(serviceInstance===selectedServiceInstance && instanceIdentifierType == selectedInstanceIdentifierType){
+                return Promise.resolve(globalCustomerId);
+            }
+            return Promise.reject();
+        };
+
+        mockAaiService.getMultipleValueParamQueryString = ( element, subPath) => {
+            return subPath + '/ ' + element;
+        };
+
+        mockAaiService.getJoinedQueryString = (queryArray) => {
+            let joinedQuery = "";
+            queryArray.forEach((element)=>{
+                joinedQuery += element + "//"
+            });
+
+            return joinedQuery;
+        };
+
+        mock_.map = (element,id) => {
+            return element;
+        };
+
+        mockCOMPONENT.PROJECT_SUB_PATH = "test/project/sub";
+        mockCOMPONENT.OWNING_ENTITY_SUB_PATH = "test/entity/sub";
+        mockCOMPONENT.SELECTED_SUBSCRIBER_SUB_PATH = "test/subscriber/sub";
+        mockCOMPONENT.SELECTED_SERVICE_INSTANCE_SUB_PATH = "test/service/instance/sub";
+        mockCOMPONENT.SELECTED_SERVICE_SUB_PATH = "text/service/sub";
+
+        mockUtilityService.hasContents = (element) => {
+                return false;
+        };
+
+        alert = jestMock.fn();
+        mockFIELD.ERROR.SELECT = "testError";
+
+        window.location = {};
+
+        // when
+        $scope.getServiceInstancesSearchResults(selectedCustomer, selectedInstanceIdentifierType, selectedServiceInstance, selectedProject, selectedOwningEntity);
+
+        // then
+        expect(alert).toHaveBeenCalledWith("testError");
+    });
+
+    test('Verify getServiceInstancesSearchResults will navigate to proper page if selected service instance is not present in UtilityService', ()  => {
+        // given
+        let selectedCustomer = 'testCustomer';
+        let selectedInstanceIdentifierType = 'testInstanceIdentifierType';
+        let selectedServiceInstance = 'testServiceInstance ';
+        let selectedProject = "testProject";
+        let selectedOwningEntity = "testOwningEntity";
+
+        let globalCustomerId = 'testCustomerIdResponse';
+
+        mockAaiService.getGlobalCustomerIdByInstanceIdentifier = (serviceInstance, instanceIdentifierType) => {
+            if(serviceInstance===selectedServiceInstance && instanceIdentifierType == selectedInstanceIdentifierType){
+                return Promise.resolve(globalCustomerId);
+            }
+            return Promise.reject();
+        };
+
+        mockAaiService.getMultipleValueParamQueryString = ( element, subPath) => {
+            return subPath + element;
+        };
+
+        mockAaiService.getJoinedQueryString = jestMock.fn();
+
+        mock_.map = (element,id) => {
+            return element;
+        };
+
+        mockCOMPONENT.PROJECT_SUB_PATH = "test/project/sub/";
+        mockCOMPONENT.OWNING_ENTITY_SUB_PATH = "test/entity/sub/";
+        mockCOMPONENT.SELECTED_SUBSCRIBER_SUB_PATH = "test/subscriber/sub/";
+        mockCOMPONENT.SELECTED_SERVICE_INSTANCE_SUB_PATH = "test/service/instance/sub/";
+        mockCOMPONENT.SELECTED_SERVICE_SUB_PATH = "text/service/sub/";
+
+
+        mockUtilityService.hasContents = (element) => {
+            return element === selectedCustomer;
+        };
+
+        window.location = {};
+
+        // when
+        $scope.getServiceInstancesSearchResults(selectedCustomer, selectedInstanceIdentifierType, selectedServiceInstance, selectedProject, selectedOwningEntity);
+
+        // then
+        expect(mockAaiService.getJoinedQueryString).toHaveBeenCalledWith(expect.arrayContaining([
+            mockCOMPONENT.PROJECT_SUB_PATH+selectedProject,
+            mockCOMPONENT.OWNING_ENTITY_SUB_PATH+selectedOwningEntity,
+            mockCOMPONENT.SELECTED_SUBSCRIBER_SUB_PATH+selectedCustomer
+        ]));
+    });
+
+
+});
\ No newline at end of file
@@ -18,7 +18,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.vid.controller;
+package org.onap.vid.controller.open;
 
 import org.apache.log4j.BasicConfigurator;
 import org.junit.Before;
@@ -26,6 +26,7 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.junit.MockitoJUnitRunner;
+import org.onap.vid.controller.open.HealthCheckController;
 import org.onap.vid.dao.FnAppDoaImpl;
 import org.springframework.http.MediaType;
 import org.springframework.test.web.servlet.MockMvc;
@@ -1,4 +1,4 @@
-package org.onap.vid.controller;
+package org.onap.vid.controller.open;
 
 /*-
  * ============LICENSE_START=======================================================
@@ -35,6 +35,7 @@ import org.onap.vid.category.AddCategoryOptionResponse;
 import org.onap.vid.category.AddCategoryOptionsRequest;
 import org.onap.vid.category.CategoryParameterOptionRep;
 import org.onap.vid.category.CategoryParametersResponse;
+import org.onap.vid.controller.open.MaintenanceController;
 import org.onap.vid.model.CategoryParameter;
 import org.onap.vid.model.CategoryParameterOption;
 import org.onap.vid.services.CategoryParameterService;
@@ -19,7 +19,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.vid.controller;
+package org.onap.vid.controller.open;
 
 import static org.mockito.BDDMockito.given;
 import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
@@ -32,6 +32,7 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.runners.MockitoJUnitRunner;
+import org.onap.vid.controller.open.RoleGeneratorController;
 import org.onap.vid.services.RoleGeneratorService;
 import org.springframework.http.MediaType;
 import org.springframework.test.web.servlet.MockMvc;
@@ -18,8 +18,9 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.vid.controller;
+package org.onap.vid.controller.open;
 
+import org.onap.vid.controller.open.VersionController;
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
index 4cba537..102c89a 100644 (file)
@@ -24,11 +24,11 @@ import io.joshworks.restclient.request.HttpRequest;
 import org.glassfish.jersey.client.JerseyInvocation;
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
-import org.onap.portalsdk.core.util.SystemProperties;
 import org.onap.vid.aai.util.HttpsAuthClient;
 import org.onap.vid.changeManagement.RequestDetailsWrapper;
 import org.onap.vid.exceptions.GenericUncheckedException;
 import org.onap.vid.mso.rest.RequestDetails;
+import org.onap.vid.utils.SystemPropertiesWrapper;
 import org.springframework.http.HttpMethod;
 import org.springframework.http.HttpStatus;
 import org.testng.annotations.BeforeClass;
@@ -72,15 +72,19 @@ public class RestMsoImplementationTest  {
     @Mock
     private JerseyInvocation jerseyInvocation;
 
+    @Mock
+    private SystemPropertiesWrapper systemProperties;
+
     @InjectMocks
-    private RestMsoImplementation restMsoImplementation = new RestMsoImplementation(mockHttpsAuthClient);
+    private RestMsoImplementation restMsoImplementation = new RestMsoImplementation(mockHttpsAuthClient, systemProperties);
 
-    String path = "/test_path/";
-    String rawData = "test-row-data";
+    private String path = "/test_path/";
+    private String rawData = "test-row-data";
 
     @BeforeClass
     public void setUp(){
         initMocks(this);
+        when(systemProperties.getProperty(MsoProperties.MSO_PASSWORD)).thenReturn("OBF:1ghz1kfx1j1w1m7w1i271e8q1eas1hzj1m4i1iyy1kch1gdz");
     }
 
     @Test
@@ -127,7 +131,8 @@ public class RestMsoImplementationTest  {
         RestObject<HttpRequest> restObject = new RestObject<>();
 
         prepareMocks("",HttpStatus.ACCEPTED.value(),"");
-        when(mockClient.target(SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL))).thenThrow(new MsoTestException("test-target-exception"));
+        when(systemProperties.getProperty(MsoProperties.MSO_SERVER_URL)).thenReturn("SAMPLE_URL");
+        when(mockClient.target("SAMPLE_URL")).thenThrow(new MsoTestException("test-target-exception"));
 
         //  when
         restMsoImplementation.Get(httpRequest, "", restObject,false);
@@ -418,4 +423,4 @@ public class RestMsoImplementationTest  {
         }
     }
 
-}
\ No newline at end of file
+}
index 12fd4a5..832aa09 100644 (file)
@@ -45,6 +45,7 @@ import org.onap.vid.mso.MsoProperties;
 import org.onap.vid.mso.MsoResponseWrapper;
 import org.onap.vid.mso.MsoResponseWrapperInterface;
 import org.onap.vid.mso.RestObject;
+import org.onap.vid.utils.SystemPropertiesWrapper;
 import org.springframework.test.context.ContextConfiguration;
 
 @ContextConfiguration(classes = {SystemProperties.class})
@@ -473,10 +474,10 @@ public class MsoRestClientNewTest {
 
     private MsoRestClientNew msoRestClient() {
         final WebConfig webConfig = new WebConfig();
-        return new MsoRestClientNew(new SyncRestClient(webConfig.unirestFasterxmlObjectMapper(new ObjectMapper())), baseUrl(),null);
+        return new MsoRestClientNew(new SyncRestClient(webConfig.unirestFasterxmlObjectMapper(new ObjectMapper())), baseUrl(), null, new SystemPropertiesWrapper());
     }
 
     private MsoRestClientNew createTestSubject() {
-        return new MsoRestClientNew(null, "",null);
+        return new MsoRestClientNew(null, "", null, new SystemPropertiesWrapper());
     }
 }
index 839e6e6..050fa0d 100644 (file)
@@ -44,12 +44,14 @@ import org.onap.vid.changeManagement.WorkflowRequestDetail;
 import org.onap.vid.client.SyncRestClient;
 import org.onap.vid.controller.LocalWebConfig;
 import org.onap.vid.model.RequestReferencesContainer;
+import org.onap.vid.mso.MsoProperties;
 import org.onap.vid.mso.MsoResponseWrapper;
 import org.onap.vid.mso.MsoResponseWrapperInterface;
 import org.onap.vid.mso.MsoUtil;
 import org.onap.vid.mso.RestObject;
 import org.onap.vid.mso.model.CloudConfiguration;
 import org.onap.vid.mso.model.RequestReferences;
+import org.onap.vid.utils.SystemPropertiesWrapper;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.web.WebAppConfiguration;
 import org.testng.annotations.BeforeClass;
@@ -75,6 +77,8 @@ public class MsoRestClientTest {
     @Mock
     private SyncRestClient client;
 
+    @Mock
+    private SystemPropertiesWrapper systemProperties;
 
     private MsoRestClientNew restClient;
 
@@ -82,8 +86,9 @@ public class MsoRestClientTest {
     @BeforeClass
     private void setUp(){
         initMocks(this);
-        restClient = new MsoRestClientNew(client,baseUrl,null);
-
+        when(systemProperties.getProperty(MsoProperties.MSO_PASSWORD)).thenReturn("OBF:1ghz1kfx1j1w1m7w1i271e8q1eas1hzj1m4i1iyy1kch1gdz");
+        when(systemProperties.getProperty("app_display_name")).thenReturn("vid");
+        restClient = new MsoRestClientNew(client,baseUrl,null,systemProperties);
     }
 
     @Test
index 39a4008..b872e61 100644 (file)
@@ -1,7 +1,7 @@
 {
   "name": "vid-cli",
   "version": "0.0.0",
-  "license": "MIT",
+  "license": "Apache-2.0",
   "scripts": {
     "cypress:open": "cypress open",
     "cypress": "cypress open --config baseUrl=http://localhost:8080/vid ",