aboutsummaryrefslogtreecommitdiffstats
path: root/adapters/mso-network-adapter/src/test
diff options
context:
space:
mode:
authorRob Daugherty <rd472p@att.com>2018-05-02 16:46:14 -0400
committerRob Daugherty <rd472p@att.com>2018-05-04 15:28:51 +0000
commit3ee4ec41ac18e51a16eafa767e090502b1a33fb5 (patch)
tree11a4d7b6c3bc5b88ce8dd67f12c7726c9f7dd80f /adapters/mso-network-adapter/src/test
parent13999df2b5cbcfd29d479e20970b39ba876725f3 (diff)
Fix CloudConfig junits
...for some definition of the word "fix". There is still a lot that's less than ideal about how CloudConfig is handled, and with how the unit tests are written. Change-Id: Ic8c66c64d336f22c141687cf41a4828810bf1aec Issue-ID: SO-584 Signed-off-by: Rob Daugherty <rd472p@att.com>
Diffstat (limited to 'adapters/mso-network-adapter/src/test')
-rw-r--r--adapters/mso-network-adapter/src/test/java/org/openecomp/mso/adapters/network/NetworkAdapterTest.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/adapters/mso-network-adapter/src/test/java/org/openecomp/mso/adapters/network/NetworkAdapterTest.java b/adapters/mso-network-adapter/src/test/java/org/openecomp/mso/adapters/network/NetworkAdapterTest.java
index 1106c5543d..417ea80e59 100644
--- a/adapters/mso-network-adapter/src/test/java/org/openecomp/mso/adapters/network/NetworkAdapterTest.java
+++ b/adapters/mso-network-adapter/src/test/java/org/openecomp/mso/adapters/network/NetworkAdapterTest.java
@@ -34,6 +34,8 @@ import org.junit.Test;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.openecomp.mso.adapters.network.exceptions.NetworkException;
+import org.openecomp.mso.cloud.CloudConfig;
+import org.openecomp.mso.cloud.CloudConfigFactory;
import org.openecomp.mso.db.catalog.CatalogDatabase;
import org.openecomp.mso.db.catalog.beans.NetworkResource;
import org.openecomp.mso.db.catalog.beans.NetworkResourceCustomization;
@@ -50,11 +52,15 @@ public class NetworkAdapterTest {
@Mock
private static CatalogDatabase db;
+
+ @Mock
+ private static CloudConfigFactory cloudConfigFactory;
@BeforeClass
public static final void prepare () {
adapter = Mockito.spy (new MsoNetworkAdapterImpl ());
db = Mockito.mock (CatalogDatabase.class);
+ cloudConfigFactory = Mockito.mock(CloudConfigFactory.class);
NetworkResource networkResource = new NetworkResource ();
NetworkResourceCustomization nrc = new NetworkResourceCustomization();
nrc.setNetworkResource(networkResource);
@@ -65,6 +71,9 @@ public class NetworkAdapterTest {
networkResource.setOrchestrationMode ("toto");
Mockito.when (db.getNetworkResource ("PROVIDER")).thenReturn (networkResource);
Mockito.when (adapter.getCatalogDB ()).thenReturn (db);
+ CloudConfig cloudConfig = Mockito.mock(CloudConfig.class);
+ Mockito.when(cloudConfigFactory.getCloudConfig()).thenReturn(cloudConfig);
+ Mockito.when (adapter.getCloudConfigFactory()).thenReturn(cloudConfigFactory);
}
@Test