aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBaseTest.java
diff options
context:
space:
mode:
authorEinat Vinouze <einat.vinouze@intl.att.com>2019-12-17 19:10:31 +0200
committerEinat Vinouze <einat.vinouze@intl.att.com>2019-12-18 15:07:08 +0200
commitfbb6e45a9186104f50162472e05b4bd76d20de5c (patch)
tree248099c778963ecc892130ebe8e2455570b35cdd /vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBaseTest.java
parente6de82bfd595d5c680a515c2ff32de21a163cd70 (diff)
on templates - filter only Action==INSTANTIATE
Issue-ID: VID-730 Signed-off-by: Einat Vinouze <einat.vinouze@intl.att.com> Change-Id: I16b73639f18b49b546868326cc6ed82d14818c1f Signed-off-by: Einat Vinouze <einat.vinouze@intl.att.com>
Diffstat (limited to 'vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBaseTest.java')
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBaseTest.java24
1 files changed, 21 insertions, 3 deletions
diff --git a/vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBaseTest.java b/vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBaseTest.java
index d41ce87bf..7c0abbe6e 100644
--- a/vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBaseTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/services/AsyncInstantiationBaseTest.java
@@ -23,7 +23,6 @@ package org.onap.vid.services;
import static java.util.Collections.emptyList;
import static java.util.Collections.emptyMap;
import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.core.IsEqual.equalTo;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.eq;
@@ -49,6 +48,7 @@ import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.inject.Inject;
import org.hibernate.SessionFactory;
+import org.jetbrains.annotations.NotNull;
import org.onap.portalsdk.core.domain.FusionObject;
import org.onap.portalsdk.core.service.DataAccessService;
import org.onap.vid.aai.AaiClientInterface;
@@ -56,6 +56,7 @@ import org.onap.vid.aai.ExceptionWithRequestInfo;
import org.onap.vid.job.Job.JobStatus;
import org.onap.vid.model.Action;
import org.onap.vid.model.ServiceInfo;
+import org.onap.vid.model.ServiceInfo.ServiceAction;
import org.onap.vid.model.VidNotions;
import org.onap.vid.model.serviceInstantiation.InstanceGroup;
import org.onap.vid.model.serviceInstantiation.Network;
@@ -67,7 +68,6 @@ import org.onap.vid.mso.model.ModelInfo;
import org.onap.vid.mso.rest.AsyncRequestStatus;
import org.onap.vid.mso.rest.RequestStatus;
import org.onap.vid.properties.Features;
-import org.onap.vid.services.AsyncInstantiationBusinessLogicTest.ServiceInfoComparator;
import org.onap.vid.utils.DaoUtils;
import org.onap.vid.utils.TimeUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -149,9 +149,19 @@ public class AsyncInstantiationBaseTest extends AbstractTestNGSpringContextTests
});
}
+
protected void addNewServiceInfo(UUID uuid, String userId, String serviceName, LocalDateTime createDate,
LocalDateTime statusModifiedDate, JobStatus status, boolean isHidden, boolean retryEnabled,
String modelUUID) {
+ ServiceInfo serviceInfo = createServiceInfo(uuid, userId, serviceName, createDate, statusModifiedDate, status,
+ isHidden, retryEnabled, modelUUID);
+ dataAccessService.saveDomainObject(serviceInfo, getPropsMap());
+ setCreateDateToServiceInfo(uuid, createDate);
+ serviceCount++;
+ }
+ @NotNull
+ private ServiceInfo createServiceInfo(UUID uuid, String userId, String serviceName, LocalDateTime createDate,
+ LocalDateTime statusModifiedDate, JobStatus status, boolean isHidden, boolean retryEnabled, String modelUUID) {
ServiceInfo serviceInfo = new ServiceInfo();
serviceInfo.setJobId(uuid);
serviceInfo.setUserId(userId);
@@ -164,10 +174,18 @@ public class AsyncInstantiationBaseTest extends AbstractTestNGSpringContextTests
serviceInfo.setRetryEnabled(retryEnabled);
serviceInfo.setServiceModelId(modelUUID);
serviceInfo.setHidden(isHidden);
+ return serviceInfo;
+ }
+
+ protected void addNewServiceInfoWithAction(UUID uuid, String userId, String serviceName, LocalDateTime createDate,
+ LocalDateTime statusModifiedDate, JobStatus status, boolean isHidden, boolean retryEnabled,
+ String modelUUID, ServiceAction action) {
+ ServiceInfo serviceInfo = createServiceInfo(uuid, userId, serviceName, createDate, statusModifiedDate, status,
+ isHidden, retryEnabled, modelUUID);
+ serviceInfo.setAction(action);
dataAccessService.saveDomainObject(serviceInfo, getPropsMap());
setCreateDateToServiceInfo(uuid, createDate);
serviceCount++;
-
}