summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-be/src/test')
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineClusterHealthTest.java27
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/EnvironmentsEngineTest.java9
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/StepsTenantIsolation.java4
3 files changed, 20 insertions, 20 deletions
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineClusterHealthTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineClusterHealthTest.java
index 97cb367761..5f2b412743 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineClusterHealthTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngineClusterHealthTest.java
@@ -20,6 +20,10 @@
package org.openecomp.sdc.be.components.distribution.engine;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
import mockit.Deencapsulation;
import org.junit.Test;
import org.openecomp.sdc.be.components.BeConfDependentTest;
@@ -30,6 +34,7 @@ import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
+import org.openecomp.sdc.be.resources.data.OperationalEnvironmentEntry;
public class DistributionEngineClusterHealthTest extends BeConfDependentTest{
@@ -38,15 +43,6 @@ public class DistributionEngineClusterHealthTest extends BeConfDependentTest{
}
@Test
- public void testInit() throws Exception {
- DistributionEngineClusterHealth testSubject;
-
- // default test
- testSubject = createTestSubject();
- Deencapsulation.invoke(testSubject, "init");
- }
-
- @Test
public void testDestroy() throws Exception {
DistributionEngineClusterHealth testSubject;
@@ -67,14 +63,11 @@ public class DistributionEngineClusterHealthTest extends BeConfDependentTest{
}
@Test
- public void testStartHealthCheckTask_1() throws Exception {
- DistributionEngineClusterHealth testSubject;
- Map<String, AtomicBoolean> envNamePerStatus = new HashMap<>();
-
- // default test
- testSubject = createTestSubject();
- testSubject.init();
- testSubject.startHealthCheckTask(envNamePerStatus);
+ public void testStartHealthCheckTask_1() {
+ final DistributionEngineClusterHealth distributionEngineClusterHealth = new DistributionEngineClusterHealth();
+ final Map<String, AtomicBoolean> envNamePerStatus = new HashMap<>();
+ distributionEngineClusterHealth.init("myKey");
+ distributionEngineClusterHealth.startHealthCheckTask(envNamePerStatus);
}
@Test
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/EnvironmentsEngineTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/EnvironmentsEngineTest.java
index 9ac04885b3..109743436f 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/EnvironmentsEngineTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/EnvironmentsEngineTest.java
@@ -51,11 +51,12 @@ import java.util.List;
import java.util.Map;
import org.openecomp.sdc.common.impl.ExternalConfiguration;
import org.openecomp.sdc.common.impl.FSConfigurationSource;
-
+import com.att.nsa.apiClient.credentials.ApiCredential;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.any;
import static org.mockito.Mockito.when;
public class EnvironmentsEngineTest {
@@ -70,6 +71,8 @@ public class EnvironmentsEngineTest {
private DistributionEngineConfiguration distributionEngineConfiguration;
@Mock
private AaiRequestHandler aaiRequestHandler;
+ @Mock
+ private CambriaHandler cambriaHandler;
@Before
public void preStart() {
@@ -94,8 +97,10 @@ public class EnvironmentsEngineTest {
when(configurationManager.getConfiguration()).thenReturn(config);
when(config.getDmaapConsumerConfiguration()).thenReturn(dmaapConf);
when(dmaapConf.isActive()).thenReturn(false);
+ ApiCredential apiCredential = new ApiCredential("apiKey", "apiSecret");
+ when(cambriaHandler.createUebKeys(any())).thenReturn(Either.left(apiCredential));
envEngine.init();
-
+
Map<String, OperationalEnvironmentEntry> mapEnvs = envEngine.getEnvironments();
assertEquals("unexpected size of map",3, mapEnvs.size());
}
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/StepsTenantIsolation.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/StepsTenantIsolation.java
index 2d440aa0f4..77c332a314 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/StepsTenantIsolation.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/StepsTenantIsolation.java
@@ -79,6 +79,8 @@ public class StepsTenantIsolation {
private AaiRequestHandler aaiRequestHandler;
@Mock
private CambriaHandler cambriaHandler;
+ @Mock
+ private DistributionEngineClusterHealth distributionEngineClusterHealth;
@InjectMocks
@Spy
private EnvironmentsEngine envEngine;
@@ -298,7 +300,7 @@ public class StepsTenantIsolation {
@SuppressWarnings("unchecked")
@Then("^trying to create Ueb keys (.*)$")
public void trying_to_create_ueb_keys(boolean isActivated) throws Throwable {
- verify(envEngine, Mockito.times(getNumberOfCallsToValidate(isActivated)))
+ verify(envEngine, Mockito.times(getNumberOfCallsToValidate(isActivated) + 1))
.createUebKeys(Mockito.any(Wrapper.class), Mockito.any(OperationalEnvironmentEntry.class));
}