+ @mock.patch.object(monPluginRec.AuthManager, 'get_credentials')
+ def test_get_vim_access_config(self, m_get_credentials):
+ """ Test functionality of get_vim_access_config method-positive case"""
+
+ # Mock vim_uuid & access_info
+ vim_uuid = '1'
+ vim_details = VimCredentials()
+ vim_details.name = "vrops_vcd82"
+ vim_details.password = "passwd"
+ vim_details.tenant_name = "MANO-VDC"
+ vim_details.type = "VMware"
+ vim_details.url = "https://10.10.1.1"
+ vim_details.user = "admin"
+ vim_details.uuid = "1"
+ vim_details.config = '{"orgname": "MANO-Org", "tenant_id": "MANO-VDC",\
+ "admin_username": "administrator","admin_password": "vcd_pwd",\
+ "vrops_user": "admin", "vrops_password": "vrops_pwd",\
+ "vrops_site": "https://10.10.1.2","nsx_user": "admin",\
+ "nsx_manager": "https://10.10.1.3", "nsx_password":"nsx_pwd",\
+ "sdn_controller": "None", "sdn_port_mapping": "None",\
+ "vcenter_ip": "10.10.1.4", "vcenter_user": "admin@vsphere.local",\
+ "vcenter_password": "vcenter_pwd", "vcenter_port": "443"}'
+ m_get_credentials.return_value = vim_details
+ expected_config = {'vrops_password': 'vrops_pwd', 'vcenter_password': 'vcenter_pwd',
+ 'name': 'vrops_vcd82', 'org_user': 'admin',
+ 'org_password': 'passwd', 'nsx_user': 'admin', 'vim_tenant_name': 'MANO-VDC',
+ 'admin_username': 'administrator', 'vcenter_port': '443',
+ 'vim_url': 'https://10.10.1.1', 'orgname': 'MANO-Org',
+ 'admin_password':'vcd_pwd', 'vrops_user':'admin', 'vcenter_ip':'10.10.1.4',
+ 'vrops_site': 'https://10.10.1.2', 'nsx_manager': 'https://10.10.1.3',
+ 'nsx_password': 'nsx_pwd', 'vim_type': 'VMware', 'vim_uuid': '1',
+ 'vcenter_user': 'admin@vsphere.local'}
+
+ # call get_vim_access_config method under test
+ actual_config = self.plugin_receiver.get_vim_access_config('1')
+
+ #verify that mocked method is called
+ m_get_credentials.assert_called_with(vim_uuid)
+
+ #Verify return value with expected value
+ self.assertEqual(expected_config, actual_config)
+
+