From c6d3ec1230b2d68548587b28d4a9b02e9e96101f Mon Sep 17 00:00:00 2001 From: MichaelMorris Date: Tue, 9 Apr 2019 12:26:12 +0000 Subject: Added handling for OAM IP address Change-Id: Iaae7f17517dc44767b73495e62549765edc4e343 Issue-ID: SO-1637 Signed-off-by: MichaelMorris --- .../adapters/vnfmadapter/rest/Sol003LcnControllerTest.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test') diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003LcnControllerTest.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003LcnControllerTest.java index 0f203902c8..aa089e1348 100644 --- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003LcnControllerTest.java +++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003LcnControllerTest.java @@ -38,6 +38,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; +import javax.inject.Inject; import org.hamcrest.BaseMatcher; import org.hamcrest.Description; import org.junit.Before; @@ -49,6 +50,9 @@ import org.onap.aai.domain.yang.GenericVnf; import org.onap.aai.domain.yang.Relationship; import org.onap.aai.domain.yang.Vserver; import org.onap.so.adapters.vnfmadapter.VnfmAdapterApplication; +import org.onap.so.adapters.vnfmadapter.extclients.aai.AaiHelper; +import org.onap.so.adapters.vnfmadapter.extclients.aai.OamIpAddressSource; +import org.onap.so.adapters.vnfmadapter.extclients.aai.OamIpAddressSource.OamIpAddressType; import org.onap.so.adapters.vnfmadapter.extclients.vim.model.AccessInfo; import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs; import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.LcnVnfLcmOperationOccurrenceNotificationAffectedVnfcs.ChangeTypeEnum; @@ -102,6 +106,9 @@ public class Sol003LcnControllerTest { private Sol003LcnContoller controller; private final Gson gson = new Gson(); + @Inject + private AaiHelper aaiHelper; + @Before public void setUp() throws Exception { mockRestServer = MockRestServiceServer.bindTo(testRestTemplate).build(); @@ -269,6 +276,7 @@ public class Sol003LcnControllerTest { private InlineResponse201 createVnfInstance() { final InlineResponse201 vnfInstance = new InlineResponse201(); + vnfInstance.setId("myTestVnfIdOnVnfm"); final InlineResponse201LinksSelf selfLink = new InlineResponse201LinksSelf(); selfLink.setHref("http://vnfm:8080/vnfs/myTestVnfIdOnVnfm"); final InlineResponse201Links VnfInstancelinks = new InlineResponse201Links(); @@ -288,6 +296,10 @@ public class Sol003LcnControllerTest { vimConnection.setAccessInfo(accessInfo); vimConnectionInfo.add(vimConnection); vnfInstance.setVimConnectionInfo(vimConnectionInfo); + + final OamIpAddressSource oamIpAddressSource = + new OamIpAddressSource(OamIpAddressType.CONFIGURABLE_PROPERTY, "vnfIpAddress"); + aaiHelper.setOamIpAddressSource("myTestVnfIdOnVnfm", oamIpAddressSource); return vnfInstance; } -- cgit 1.2.3-korg