diff options
author | shrikantawachar <shrikant.awachar@amdocs.com> | 2018-11-20 19:08:06 +0530 |
---|---|---|
committer | Avi Gaffa <avi.gaffa@amdocs.com> | 2018-12-02 08:48:20 +0000 |
commit | c2a1b7c2eea934f309838f0082b2b851012be9a1 (patch) | |
tree | 12b3dac98cec264a12d96fe76c727df714ca4601 /openecomp-be/backend/openecomp-sdc-action-manager/src/test/java/org | |
parent | 594a8c618a763e79e05229509dbf2b60ab831213 (diff) |
Enhance or write new tests
Enhance or write new tests
Change-Id: I4281b83410645ca0b6f64ab719adcd01c2a04ed3
Issue-ID: SDC-1816
Signed-off-by: shrikantawachar <shrikant.awachar@amdocs.com>
Diffstat (limited to 'openecomp-be/backend/openecomp-sdc-action-manager/src/test/java/org')
-rw-r--r-- | openecomp-be/backend/openecomp-sdc-action-manager/src/test/java/org/openecomp/sdc/action/impl/ActionManagerImplTest.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/src/test/java/org/openecomp/sdc/action/impl/ActionManagerImplTest.java b/openecomp-be/backend/openecomp-sdc-action-manager/src/test/java/org/openecomp/sdc/action/impl/ActionManagerImplTest.java index 40cf107c53..7143271613 100644 --- a/openecomp-be/backend/openecomp-sdc-action-manager/src/test/java/org/openecomp/sdc/action/impl/ActionManagerImplTest.java +++ b/openecomp-be/backend/openecomp-sdc-action-manager/src/test/java/org/openecomp/sdc/action/impl/ActionManagerImplTest.java @@ -27,6 +27,7 @@ import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; import org.mockito.runners.MockitoJUnitRunner; +import org.openecomp.core.dao.UniqueValueDao; import org.openecomp.sdc.action.ActionConstants; import org.openecomp.sdc.action.dao.ActionArtifactDao; import org.openecomp.sdc.action.dao.ActionDao; @@ -57,6 +58,7 @@ import java.util.Map; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyInt; import static org.mockito.Matchers.anyString; +import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.times; import static org.mockito.Mockito.when; @@ -71,14 +73,26 @@ public class ActionManagerImplTest { private ActionArtifactDao actionArtifactDao; @Mock private VersionInfoDao versionInfoDao; + @Mock + private UniqueValueDao uniqueValueDao; private ActionManagerImpl actionManager; - @Before public void init() { MockitoAnnotations.initMocks(this); - actionManager = new ActionManagerImpl(actionDao, versioningManager, actionArtifactDao, versionInfoDao); + actionManager = new ActionManagerImpl(actionDao, versioningManager, actionArtifactDao, + versionInfoDao, uniqueValueDao); + } + + @Test + public void testCreateAction() { + Action action = createAction(); + Version version = createVersion(); + doReturn(version).when(versioningManager).create(anyString(), anyString(), anyString()); + doReturn(action).when(actionDao).createAction(any()); + actionManager.createAction(action, "USER"); + Mockito.verify(actionDao,times(1)).createAction(any()); } @Test |