diff options
author | Tait,Trevor(rt0435) <rtait@amdocs.com> | 2018-09-06 09:22:38 -0400 |
---|---|---|
committer | Tait,Trevor(rt0435) <rtait@amdocs.com> | 2018-09-06 10:59:40 -0400 |
commit | e8dbb2edab5055d5e2445c659dc4cb9dac41bb04 (patch) | |
tree | e0ee35ad32a581ba28fdafc21dd5244ecb675da2 /src | |
parent | 42eb3f556ceda1287bd80ad74cbe0c8919b33ded (diff) |
Udates for feedback from demo
Changes made to org.onap.pomba.common.datatypes.ModelContext,
specifically nfNamingCode and networkType have been adapted in
networkDiscoveryContextBuilder
Changes made to networkdiscovery.spec to only return attributes and
values from the network, no AAI. Also changed the name of this file as
it is not a JSON formatted file. James McNider needs to confirm this
dependency on ND OOM before we merge.
Fixed onap-java-style audit issues with
NetworkDiscoveryContextBuilderTest.java
Issue-ID: LOG-643
Change-Id: Id18b25d2fea350f93a705b94e96ad26c480c19a0
Signed-off-by: Tait,Trevor(rt0435) <rtait@amdocs.com>
Diffstat (limited to 'src')
2 files changed, 8 insertions, 8 deletions
diff --git a/src/main/java/org/onap/pomba/contextbuilder/networkdiscovery/service/SpringServiceImpl.java b/src/main/java/org/onap/pomba/contextbuilder/networkdiscovery/service/SpringServiceImpl.java index d982ada..02b223b 100644 --- a/src/main/java/org/onap/pomba/contextbuilder/networkdiscovery/service/SpringServiceImpl.java +++ b/src/main/java/org/onap/pomba/contextbuilder/networkdiscovery/service/SpringServiceImpl.java @@ -256,7 +256,7 @@ public class SpringServiceImpl implements SpringService { + serviceInstanceId + ", message body: " + reply); } - List<Object> jsonSpec = JsonUtils.filepathToList("config/networkdiscoveryspec.json"); + List<Object> jsonSpec = JsonUtils.filepathToList("config/networkdiscovery.spec"); Object jsonInput = JsonUtils.jsonToObject(reply); Chainr chainr = Chainr.fromSpec(jsonSpec); Object transObject = chainr.transform(jsonInput); @@ -460,14 +460,14 @@ public class SpringServiceImpl implements SpringService { for (VF vf : networkDiscoveryCtx.getVfs()) { for (VNFC vnfc : vf.getVnfcs()) { - ndresourceList.add(new NdResource(vnfc.getNfcNamingCode(), vnfc.getUuid())); + ndresourceList.add(new NdResource(vnfc.getType(), vnfc.getUuid())); } for (VFModule vfModule : vf.getVfModules()) { for (VM vm : vfModule.getVms() ) { ndresourceList.add(new NdResource(vm.getNfcNamingCode(), vm.getUuid())); } for (Network network : vfModule.getNetworks()) { - ndresourceList.add(new NdResource(network.getNfcNamingCode(), network.getUuid())); + ndresourceList.add(new NdResource(network.getType(), network.getUuid())); } } } diff --git a/src/test/java/org/onap/pomba/contextbuilder/networkdiscovery/unittest/service/NetworkDiscoveryContextBuilderTest.java b/src/test/java/org/onap/pomba/contextbuilder/networkdiscovery/unittest/service/NetworkDiscoveryContextBuilderTest.java index 19af1f3..1705bde 100644 --- a/src/test/java/org/onap/pomba/contextbuilder/networkdiscovery/unittest/service/NetworkDiscoveryContextBuilderTest.java +++ b/src/test/java/org/onap/pomba/contextbuilder/networkdiscovery/unittest/service/NetworkDiscoveryContextBuilderTest.java @@ -21,6 +21,10 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; +import com.github.jknack.handlebars.internal.Files; +import com.github.tomakehurst.wiremock.client.WireMock; +import com.github.tomakehurst.wiremock.junit.WireMockRule; +import com.github.tomakehurst.wiremock.matching.UrlPattern; import java.io.File; import java.io.IOException; import java.io.InputStream; @@ -55,10 +59,6 @@ import org.springframework.core.env.Environment; import org.springframework.test.context.TestPropertySource; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; -import com.github.jknack.handlebars.internal.Files; -import com.github.tomakehurst.wiremock.client.WireMock; -import com.github.tomakehurst.wiremock.junit.WireMockRule; -import com.github.tomakehurst.wiremock.matching.UrlPattern; @RunWith(SpringJUnit4ClassRunner.class) @@ -262,10 +262,10 @@ public class NetworkDiscoveryContextBuilderTest { dataQuality.setStatus(DataQuality.Status.ok); myResource.setDataQuality(dataQuality); Attribute attribute = new Attribute(); - List<Attribute> attributeList = new ArrayList<>(); attribute.setName("vserver-id"); attribute.setValue("25fb07ab-0478-465e-a021-6384ac299671"); attribute.setDataQuality(dataQuality); + List<Attribute> attributeList = new ArrayList<>(); attributeList.add(attribute); attribute.setName("power-state"); |