diff options
author | r.bogacki <r.bogacki@samsung.com> | 2019-03-22 15:43:49 +0100 |
---|---|---|
committer | r.bogacki <r.bogacki@samsung.com> | 2019-03-22 15:44:59 +0100 |
commit | a4088cbaed725867db1a677e56ecf58f6fae91cd (patch) | |
tree | 1ea73c22c131cdc8e64844a2b2b84972e086fa01 /bpmn/MSOCommonBPMN/src/test | |
parent | b06919e6f39b0e9dcb40e02155f9406460d2f38d (diff) |
JUnit tests for BBInputSetup
Increase junit tests coverage according to Sonar analyses.
Fix imports.
Change-Id: Ia6c3f4a3178f5293ee6750f7581cd7107c8ced84
Issue-ID: SO-1692
Signed-off-by: Robert Bogacki <r.bogacki@samsung.com>
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/test')
-rw-r--r-- | bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java index df9f2259a1..eb26bf34ee 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java @@ -4,6 +4,8 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * ================================================================================ + * Modifications Copyright (c) 2019 Samsung + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -43,6 +45,7 @@ import java.util.Map; import java.util.Optional; import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -2712,5 +2715,24 @@ public class BBInputSetupTest { assertEquals("Lookup Key Map populated with VfModule Id", vfModuleId, lookupKeyMap.get(ResourceKey.VF_MODULE_ID)); assertEquals("Lookup Key Map populated with VolumeGroup Id", volumeGroupId, lookupKeyMap.get(ResourceKey.VOLUME_GROUP_ID)); } + + @Test + public void testGettingVnfcToConfiguration() throws Exception { + + String vnfcName = "vnfcName"; + org.onap.aai.domain.yang.Configuration expectedAAI = new org.onap.aai.domain.yang.Configuration(); + AAIResourceUri aaiResourceUri = AAIUriFactory.createResourceUri(AAIObjectType.VNFC, vnfcName); + AAIResultWrapper configurationWrapper = + new AAIResultWrapper(new AAICommonObjectMapperProvider().getMapper().writeValueAsString(expectedAAI)); + + doReturn(new AAIResultWrapper(null)).when(SPY_bbInputSetupUtils).getAAIResourceDepthOne(aaiResourceUri); + Vnfc vnfc = SPY_bbInputSetup.getVnfcToConfiguration(vnfcName); + Assert.assertNull(vnfc); + + doReturn(configurationWrapper).when(SPY_bbInputSetupUtils).getAAIResourceDepthOne(aaiResourceUri); + vnfc = SPY_bbInputSetup.getVnfcToConfiguration(vnfcName); + Assert.assertNotNull(vnfc); + } + } |