Introduce FeatureManager to ResourceCommand 01/107801/3
authorEinat Vinouze <einat.vinouze@intl.att.com>
Mon, 18 May 2020 09:59:57 +0000 (12:59 +0300)
committerEinat Vinouze <einat.vinouze@intl.att.com>
Tue, 19 May 2020 05:53:30 +0000 (08:53 +0300)
Issue-ID: VID-821

Signed-off-by: Einat Vinouze <einat.vinouze@intl.att.com>
Change-Id: Id6c663d4612d69a48b4a9425db082fb6c33e08b1
Signed-off-by: Einat Vinouze <einat.vinouze@intl.att.com>
16 files changed:
vid-app-common/src/main/java/org/onap/vid/job/command/ALaCarteServiceCommand.kt
vid-app-common/src/main/java/org/onap/vid/job/command/InstanceGroupCommand.kt
vid-app-common/src/main/java/org/onap/vid/job/command/InstanceGroupMemberCommand.kt
vid-app-common/src/main/java/org/onap/vid/job/command/MacroServiceCommand.kt
vid-app-common/src/main/java/org/onap/vid/job/command/NetworkCommand.kt
vid-app-common/src/main/java/org/onap/vid/job/command/ResourceCommand.kt
vid-app-common/src/main/java/org/onap/vid/job/command/RootServiceCommand.kt
vid-app-common/src/main/java/org/onap/vid/job/command/VfmoduleCommand.kt
vid-app-common/src/main/java/org/onap/vid/job/command/VnfCommand.kt
vid-app-common/src/main/java/org/onap/vid/job/command/VolumeGroupCommand.kt
vid-app-common/src/test/java/org/onap/vid/config/JobCommandsConfigWithMockedMso.java
vid-app-common/src/test/java/org/onap/vid/job/command/InstanceGroupCommandTest.java
vid-app-common/src/test/java/org/onap/vid/job/command/MacroServiceCommandTest.java
vid-app-common/src/test/java/org/onap/vid/job/command/ResourceCommandTest.java
vid-app-common/src/test/java/org/onap/vid/job/command/ServiceInProgressStatusCommandTest.java
vid-app-common/src/test/java/org/onap/vid/job/command/VfmoduleCommandTest.kt

index 9bef3c1..df39f73 100644 (file)
@@ -36,6 +36,7 @@ import org.springframework.beans.factory.config.ConfigurableBeanFactory
 import org.springframework.context.annotation.Scope
 import org.springframework.http.HttpMethod
 import org.springframework.stereotype.Component
+import org.togglz.core.manager.FeatureManager
 import java.time.ZonedDateTime
 import java.time.temporal.ChronoUnit
 import java.util.*
@@ -63,9 +64,10 @@ class ALaCarteServiceCommand @Autowired constructor(
         msoResultHandlerService: MsoResultHandlerService,
         jobAdapter: JobAdapter,
         restMso: RestMsoImplementation,
-        auditService: AuditService
+        auditService: AuditService,
+        featureManager: FeatureManager
 ) : RootServiceCommand(restMso, inProgressStatusService, msoResultHandlerService,
-        watchChildrenJobsBL, jobsBrokerService, jobAdapter, asyncInstantiationBL, auditService, msoRequestBuilder), JobCommand {
+        watchChildrenJobsBL, jobsBrokerService, jobAdapter, asyncInstantiationBL, auditService, msoRequestBuilder, featureManager), JobCommand {
 
     companion object {
         private val LOGGER = EELFLoggerDelegate.getLogger(ALaCarteServiceCommand::class.java)
index 886251a..60d0519 100644 (file)
@@ -34,6 +34,7 @@ import org.springframework.beans.factory.config.ConfigurableBeanFactory
 import org.springframework.context.annotation.Scope
 import org.springframework.http.HttpMethod
 import org.springframework.stereotype.Component
+import org.togglz.core.manager.FeatureManager
 import java.util.*
 
 @Component
@@ -46,9 +47,10 @@ class InstanceGroupCommand @Autowired constructor(
         inProgressStatusService:InProgressStatusService,
         watchChildrenJobsBL: WatchChildrenJobsBL,
         jobsBrokerService: JobsBrokerService,
-        jobAdapter: JobAdapter
-        ) : ResourceCommand(restMso, inProgressStatusService, msoResultHandlerService,
-        watchChildrenJobsBL, jobsBrokerService, jobAdapter), JobCommand {
+        jobAdapter: JobAdapter,
+        featureManager: FeatureManager
+) : ResourceCommand(restMso, inProgressStatusService, msoResultHandlerService,
+        watchChildrenJobsBL, jobsBrokerService, jobAdapter, featureManager), JobCommand {
 
     companion object {
         private val LOGGER = EELFLoggerDelegate.getLogger(InstanceGroupCommand::class.java)
index d8e9297..b70c449 100644 (file)
@@ -13,6 +13,7 @@ import org.springframework.beans.factory.config.ConfigurableBeanFactory
 import org.springframework.context.annotation.Scope
 import org.springframework.http.HttpMethod
 import org.springframework.stereotype.Component
+import org.togglz.core.manager.FeatureManager
 import java.util.*
 
 @Component
@@ -25,9 +26,10 @@ class InstanceGroupMemberCommand @Autowired constructor(
         inProgressStatusService:InProgressStatusService,
         watchChildrenJobsBL: WatchChildrenJobsBL,
         jobsBrokerService: JobsBrokerService,
-        jobAdapter: JobAdapter
+        jobAdapter: JobAdapter,
+        featureManager: FeatureManager
 ) : ResourceCommand(restMso, inProgressStatusService, msoResultHandlerService,
-        watchChildrenJobsBL, jobsBrokerService, jobAdapter), JobCommand {
+        watchChildrenJobsBL, jobsBrokerService, jobAdapter, featureManager), JobCommand {
 
     companion object {
         private val LOGGER = EELFLoggerDelegate.getLogger(InstanceGroupMemberCommand::class.java)
index 8ce73d7..c3744b5 100644 (file)
@@ -21,6 +21,7 @@ import org.springframework.beans.factory.config.ConfigurableBeanFactory
 import org.springframework.context.annotation.Scope
 import org.springframework.http.HttpMethod
 import org.springframework.stereotype.Component
+import org.togglz.core.manager.FeatureManager
 import java.util.*
 
 @Component
@@ -34,9 +35,10 @@ class MacroServiceCommand @Autowired constructor(
         msoResultHandlerService: MsoResultHandlerService,
         jobAdapter: JobAdapter,
         restMso: RestMsoImplementation,
-        auditService: AuditService
+        auditService: AuditService,
+        featureManager: FeatureManager
 ) : RootServiceCommand(restMso, inProgressStatusService, msoResultHandlerService,
-        watchChildrenJobsBL, jobsBrokerService, jobAdapter, asyncInstantiationBL, auditService, msoRequestBuilder), JobCommand {
+        watchChildrenJobsBL, jobsBrokerService, jobAdapter, asyncInstantiationBL, auditService, msoRequestBuilder, featureManager), JobCommand {
 
 
     companion object {
index 6c9af14..3cf2b28 100644 (file)
@@ -13,6 +13,7 @@ import org.springframework.beans.factory.config.ConfigurableBeanFactory
 import org.springframework.context.annotation.Scope
 import org.springframework.http.HttpMethod
 import org.springframework.stereotype.Component
+import org.togglz.core.manager.FeatureManager
 import java.util.*
 
 
@@ -26,9 +27,10 @@ class NetworkCommand @Autowired constructor(
         inProgressStatusService:InProgressStatusService,
         watchChildrenJobsBL: WatchChildrenJobsBL,
         jobsBrokerService: JobsBrokerService,
-        jobAdapter: JobAdapter
-        ) : ResourceCommand(restMso, inProgressStatusService, msoResultHandlerService,
-        watchChildrenJobsBL, jobsBrokerService, jobAdapter), JobCommand {
+        jobAdapter: JobAdapter,
+        featureManager: FeatureManager
+) : ResourceCommand(restMso, inProgressStatusService, msoResultHandlerService,
+        watchChildrenJobsBL, jobsBrokerService, jobAdapter, featureManager), JobCommand {
     override fun createChildren(): Job.JobStatus {
         return Job.JobStatus.COMPLETED_WITH_NO_ACTION
     }
index 2b5ec01..9b4f8b9 100644 (file)
@@ -33,11 +33,14 @@ import org.onap.vid.job.impl.JobSharedData
 import org.onap.vid.model.Action
 import org.onap.vid.model.RequestReferencesContainer
 import org.onap.vid.model.serviceInstantiation.BaseResource
+import org.onap.vid.model.serviceInstantiation.BaseResource.PauseInstantiation.afterCompletion
 import org.onap.vid.mso.RestMsoImplementation
 import org.onap.vid.mso.model.ModelInfo
+import org.onap.vid.properties.Features
 import org.onap.vid.utils.JACKSON_OBJECT_MAPPER
 import org.onap.vid.utils.getEnumFromMapOfStrings
 import org.springframework.http.HttpMethod
+import org.togglz.core.manager.FeatureManager
 import java.util.*
 
 
@@ -76,7 +79,8 @@ abstract class ResourceCommand(
         protected val msoResultHandlerService: MsoResultHandlerService,
         protected val watchChildrenJobsBL: WatchChildrenJobsBL,
         private val jobsBrokerService: JobsBrokerService,
-        private val jobAdapter: JobAdapter
+        private val jobAdapter: JobAdapter,
+        private val featureManager: FeatureManager
         ) : CommandBase(), JobCommand {
 
     companion object {
index c4680b2..d13ecd7 100644 (file)
@@ -13,6 +13,7 @@ import org.onap.vid.services.AsyncInstantiationBusinessLogic
 import org.onap.vid.services.AuditService
 import org.springframework.beans.factory.annotation.Autowired
 import org.springframework.http.HttpMethod
+import org.togglz.core.manager.FeatureManager
 import java.util.*
 
 abstract class RootServiceCommand @Autowired constructor(
@@ -24,9 +25,10 @@ abstract class RootServiceCommand @Autowired constructor(
         jobAdapter: JobAdapter,
         private val asyncInstantiationBL: AsyncInstantiationBusinessLogic,
         private val auditService: AuditService,
-        private val msoRequestBuilder: MsoRequestBuilder
+        private val msoRequestBuilder: MsoRequestBuilder,
+        featureManager: FeatureManager
 ) : ResourceCommand(restMso, inProgressStatusService, msoResultHandlerService,
-        watchChildrenJobsBL, jobsBrokerService, jobAdapter), JobCommand {
+        watchChildrenJobsBL, jobsBrokerService, jobAdapter, featureManager), JobCommand {
 
     lateinit var optimisticUniqueServiceInstanceName: String
 
index 29d7001..a92f610 100644 (file)
@@ -16,6 +16,7 @@ import org.springframework.beans.factory.config.ConfigurableBeanFactory
 import org.springframework.context.annotation.Scope
 import org.springframework.http.HttpMethod
 import org.springframework.stereotype.Component
+import org.togglz.core.manager.FeatureManager
 import java.util.*
 
 typealias ToscaVfm = org.onap.vid.model.VfModule
@@ -30,9 +31,10 @@ class VfmoduleCommand @Autowired constructor(
         inProgressStatusService:InProgressStatusService,
         watchChildrenJobsBL: WatchChildrenJobsBL,
         jobsBrokerService: JobsBrokerService,
-        jobAdapter: JobAdapter
+        jobAdapter: JobAdapter,
+        featureManager: FeatureManager
 ) : ResourceCommand(restMso, inProgressStatusService, msoResultHandlerService,
-        watchChildrenJobsBL, jobsBrokerService, jobAdapter), JobCommand {
+        watchChildrenJobsBL, jobsBrokerService, jobAdapter, featureManager), JobCommand {
 
     companion object {
         private val LOGGER = EELFLoggerDelegate.getLogger(VfmoduleCommand::class.java)
index 1eb9799..e2bc6dc 100644 (file)
@@ -39,7 +39,7 @@ class VnfCommand @Autowired constructor(
         jobAdapter: JobAdapter,
         private val featureManager: FeatureManager
 ) : ResourceCommand(restMso, inProgressStatusService, msoResultHandlerService,
-        watchChildrenJobsBL, jobsBrokerService, jobAdapter), JobCommand {
+        watchChildrenJobsBL, jobsBrokerService, jobAdapter, featureManager), JobCommand {
 
     private var needToCreateBaseModule:Boolean by Delegates.notNull<Boolean>()
 
index 9794933..906ff26 100644 (file)
@@ -13,6 +13,7 @@ import org.springframework.beans.factory.config.ConfigurableBeanFactory
 import org.springframework.context.annotation.Scope
 import org.springframework.http.HttpMethod
 import org.springframework.stereotype.Component
+import org.togglz.core.manager.FeatureManager
 import java.util.*
 
 @Component
@@ -25,9 +26,10 @@ class VolumeGroupCommand @Autowired constructor(
         inProgressStatusService:InProgressStatusService,
         watchChildrenJobsBL: WatchChildrenJobsBL,
         jobsBrokerService: JobsBrokerService,
-        jobAdapter: JobAdapter
+        jobAdapter: JobAdapter,
+        featureManager: FeatureManager
 ) : ResourceCommand(restMso, inProgressStatusService, msoResultHandlerService,
-        watchChildrenJobsBL, jobsBrokerService, jobAdapter), JobCommand {
+        watchChildrenJobsBL, jobsBrokerService, jobAdapter, featureManager), JobCommand {
 
     companion object {
         private val LOGGER = EELFLoggerDelegate.getLogger(VolumeGroupCommand::class.java)
index 3f2bf73..468fb41 100644 (file)
@@ -174,8 +174,9 @@ public class JobCommandsConfigWithMockedMso {
             InProgressStatusService inProgressStatusService,
             WatchChildrenJobsBL watchChildrenJobsBL,
             RestMsoImplementation restMso,
-            AuditService auditService) {
-        return new ALaCarteServiceCommand(inProgressStatusService, watchChildrenJobsBL, asyncInstantiationBusinessLogic, jobsBrokerService, msoRequestBuilder, msoResultHandlerService, jobAdapter, restMso, auditService);
+            AuditService auditService,
+            FeatureManager featureManager) {
+        return new ALaCarteServiceCommand(inProgressStatusService, watchChildrenJobsBL, asyncInstantiationBusinessLogic, jobsBrokerService, msoRequestBuilder, msoResultHandlerService, jobAdapter, restMso, auditService, featureManager);
     }
 
     @Bean
@@ -189,8 +190,9 @@ public class JobCommandsConfigWithMockedMso {
             InProgressStatusService inProgressStatusService,
             WatchChildrenJobsBL watchChildrenJobsBL,
             RestMsoImplementation restMso,
-            AuditService auditService) {
-        return new MacroServiceCommand(inProgressStatusService, watchChildrenJobsBL, asyncInstantiationBusinessLogic, jobsBrokerService, msoRequestBuilder, msoResultHandlerService, jobAdapter, restMso, auditService);
+            AuditService auditService,
+            FeatureManager featureManager) {
+        return new MacroServiceCommand(inProgressStatusService, watchChildrenJobsBL, asyncInstantiationBusinessLogic, jobsBrokerService, msoRequestBuilder, msoResultHandlerService, jobAdapter, restMso, auditService, featureManager);
     }
 
 
@@ -204,9 +206,10 @@ public class JobCommandsConfigWithMockedMso {
             InProgressStatusService inProgressStatusService,
             WatchChildrenJobsBL watchChildrenJobsBL,
             JobsBrokerService jobsBrokerService,
-            JobAdapter jobAdapter) {
+            JobAdapter jobAdapter,
+            FeatureManager featureManager) {
         return new NetworkCommand(asyncInstantiationBusinessLogic, restMso, msoRequestBuilder, msoResultHandlerService,
-                inProgressStatusService, watchChildrenJobsBL, jobsBrokerService, jobAdapter);
+                inProgressStatusService, watchChildrenJobsBL, jobsBrokerService, jobAdapter, featureManager);
     }
     @Bean
     @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
@@ -218,8 +221,10 @@ public class JobCommandsConfigWithMockedMso {
             WatchChildrenJobsBL watchChildrenJobsBL,
             RestMsoImplementation restMso,
             JobsBrokerService jobsBrokerService,
-            JobAdapter jobAdapter) {
-        return new InstanceGroupCommand(asyncInstantiationBusinessLogic, restMso, msoRequestBuilder, msoResultHandlerService, inProgressStatusService, watchChildrenJobsBL, jobsBrokerService, jobAdapter);
+            JobAdapter jobAdapter,
+            FeatureManager featureManager) {
+        return new InstanceGroupCommand(asyncInstantiationBusinessLogic, restMso, msoRequestBuilder, msoResultHandlerService, inProgressStatusService,
+            watchChildrenJobsBL, jobsBrokerService, jobAdapter, featureManager);
     }
 
     @Bean
@@ -232,9 +237,10 @@ public class JobCommandsConfigWithMockedMso {
             WatchChildrenJobsBL watchChildrenJobsBL,
             RestMsoImplementation restMso,
             JobsBrokerService jobsBrokerService,
-            JobAdapter jobAdapter) {
+            JobAdapter jobAdapter,
+            FeatureManager featureManager) {
         return new InstanceGroupMemberCommand(asyncInstantiationBusinessLogic, restMso, msoRequestBuilder, msoResultHandlerService, inProgressStatusService,
-                watchChildrenJobsBL, jobsBrokerService, jobAdapter);
+                watchChildrenJobsBL, jobsBrokerService, jobAdapter, featureManager);
     }
 
 
@@ -265,9 +271,10 @@ public class JobCommandsConfigWithMockedMso {
             InProgressStatusService inProgressStatusService,
             WatchChildrenJobsBL watchChildrenJobsBL,
             JobsBrokerService jobsBrokerService,
-            JobAdapter jobAdapter) {
+            JobAdapter jobAdapter,
+            FeatureManager featureManager) {
         return new VolumeGroupCommand(asyncInstantiationBusinessLogic, restMso, msoRequestBuilder, msoResultHandlerService,
-                inProgressStatusService, watchChildrenJobsBL, jobsBrokerService ,jobAdapter);
+                inProgressStatusService, watchChildrenJobsBL, jobsBrokerService ,jobAdapter, featureManager);
     }
 
     @Bean
@@ -280,9 +287,10 @@ public class JobCommandsConfigWithMockedMso {
             InProgressStatusService inProgressStatusService,
             WatchChildrenJobsBL watchChildrenJobsBL,
             JobsBrokerService jobsBrokerService,
-            JobAdapter jobAdapter) {
+            JobAdapter jobAdapter,
+            FeatureManager featureManager) {
         return new VfmoduleCommand(asyncInstantiationBusinessLogic, restMso, msoRequestBuilder, msoResultHandlerService,
-                inProgressStatusService, watchChildrenJobsBL, jobsBrokerService, jobAdapter);
+                inProgressStatusService, watchChildrenJobsBL, jobsBrokerService, jobAdapter, featureManager);
     }
     @Bean
     public AuditService auditService(RestMsoImplementation msoClient, AsyncInstantiationRepository asyncInstantiationRepository) {
index c68c5f7..3817ac2 100644 (file)
 
 package org.onap.vid.job.command;
 
+import static java.util.function.Function.identity;
+import static java.util.stream.Collectors.toMap;
+import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.eq;
+import static org.mockito.Mockito.only;
+import static org.mockito.Mockito.same;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
 import com.google.common.collect.ImmutableMap;
+import java.util.Optional;
+import java.util.Set;
 import org.apache.commons.beanutils.BeanUtils;
 import org.mockito.Answers;
 import org.mockito.InjectMocks;
@@ -39,15 +51,7 @@ import org.springframework.http.HttpMethod;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
-
-import java.util.Optional;
-import java.util.Set;
-
-import static java.util.function.Function.identity;
-import static java.util.stream.Collectors.toMap;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.*;
+import org.togglz.core.manager.FeatureManager;
 
 public class InstanceGroupCommandTest {
 
@@ -75,6 +79,8 @@ public class InstanceGroupCommandTest {
 
     @Mock InProgressStatusService inProgressStatusService;
 
+    @Mock FeatureManager featureManager;
+
     @InjectMocks
     private InstanceGroupCommand command;
 
index e477161..cf1322e 100644 (file)
@@ -54,6 +54,7 @@ import org.onap.vid.services.AuditService;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
+import org.togglz.core.manager.FeatureManager;
 
 public class MacroServiceCommandTest {
 
@@ -84,6 +85,9 @@ public class MacroServiceCommandTest {
     @Mock
     private AuditService auditService;
 
+    @Mock
+    FeatureManager featureManager;
+
     @InjectMocks
     private MacroServiceCommand macroServiceCommand;
 
index 8d60b84..9d466f4 100644 (file)
@@ -81,6 +81,7 @@ import org.onap.vid.mso.model.ModelInfo;
 import org.springframework.http.HttpMethod;
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
+import org.togglz.core.manager.FeatureManager;
 
 public class ResourceCommandTest {
 
@@ -97,7 +98,8 @@ public class ResourceCommandTest {
                     mock(MsoResultHandlerService.class, RETURNS_MOCKS),
                     mock(WatchChildrenJobsBL.class),
                     mock(JobsBrokerService.class, RETURNS_MOCKS),
-                    mock(JobAdapter.class, RETURNS_MOCKS));
+                    mock(JobAdapter.class, RETURNS_MOCKS),
+                    mock(FeatureManager.class));
             this.mockedJobStatus = mockedJobStatus;
             this.mockState = mockState;
             this.mockPhase = mockPhase;
index 9923250..463d720 100644 (file)
 
 package org.onap.vid.job.command;
 
+import static java.util.Collections.emptyList;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.containsInAnyOrder;
+import static org.hamcrest.core.Is.is;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import static org.onap.vid.job.Job.JobStatus.COMPLETED;
+import static org.onap.vid.job.Job.JobStatus.COMPLETED_WITH_NO_ACTION;
+import static org.onap.vid.job.Job.JobStatus.IN_PROGRESS;
+import static org.onap.vid.job.command.ResourceCommandKt.ACTION_PHASE;
+import static org.onap.vid.job.command.ResourceCommandKt.CHILD_JOBS;
+import static org.onap.vid.job.command.ResourceCommandKt.INTERNAL_STATE;
+import static org.onap.vid.job.command.ResourceCommandTest.FakeResourceCreator.createNetwork;
+import static org.onap.vid.job.command.ResourceCommandTest.FakeResourceCreator.createService;
+import static org.onap.vid.job.command.ResourceCommandTest.FakeResourceCreator.createVnf;
+import static org.onap.vid.model.Action.Create;
+import static org.onap.vid.testUtils.TestUtils.testWithSystemProperty;
+import static org.testng.AssertJUnit.assertEquals;
+
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
+import java.time.Instant;
+import java.time.ZoneOffset;
+import java.time.ZonedDateTime;
+import java.time.temporal.ChronoUnit;
+import java.util.Arrays;
+import java.util.UUID;
 import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
-import org.onap.vid.job.*;
+import org.onap.vid.job.Job;
+import org.onap.vid.job.JobAdapter;
+import org.onap.vid.job.JobType;
+import org.onap.vid.job.JobsBrokerService;
+import org.onap.vid.job.NextCommand;
 import org.onap.vid.job.impl.JobSharedData;
 import org.onap.vid.model.Action;
 import org.onap.vid.model.serviceInstantiation.Network;
@@ -42,27 +75,6 @@ import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 import org.togglz.core.manager.FeatureManager;
 
-import java.time.Instant;
-import java.time.ZoneOffset;
-import java.time.ZonedDateTime;
-import java.time.temporal.ChronoUnit;
-import java.util.Arrays;
-import java.util.UUID;
-
-import static java.util.Collections.emptyList;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.containsInAnyOrder;
-import static org.hamcrest.core.Is.is;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.*;
-import static org.onap.vid.job.Job.JobStatus.*;
-import static org.onap.vid.job.command.ResourceCommandKt.*;
-import static org.onap.vid.job.command.ResourceCommandTest.FakeResourceCreator.*;
-import static org.onap.vid.model.Action.Create;
-import static org.onap.vid.testUtils.TestUtils.testWithSystemProperty;
-import static org.testng.AssertJUnit.assertEquals;
-
 public class ServiceInProgressStatusCommandTest {
 
 
@@ -134,7 +146,8 @@ public class ServiceInProgressStatusCommandTest {
                 msoResultHandlerService,
                 jobAdapter,
                 restMsoImplementation,
-                auditService
+                auditService,
+                featureManager
         );
     }
 
index ea67f23..3d8ec94 100644 (file)
@@ -14,6 +14,7 @@ import org.onap.vid.services.AsyncInstantiationBusinessLogic
 import org.onap.vid.testUtils.TestUtils.initMockitoMocks
 import org.testng.annotations.BeforeMethod
 import org.testng.annotations.Test
+import org.togglz.core.manager.FeatureManager
 
 class VfmoduleCommandTest {
 
@@ -25,6 +26,8 @@ class VfmoduleCommandTest {
     @Mock lateinit var watchChildrenJobsBL: WatchChildrenJobsBL;
     @Mock lateinit var jobsBrokerService: JobsBrokerService;
     @Mock lateinit var jobAdapter: JobAdapter;
+    @Mock lateinit var featureManager: FeatureManager;
+
 
     @InjectMocks lateinit var vfModuleCommand: VfmoduleCommand;