diff options
Diffstat (limited to 'workflow-designer-be')
-rw-r--r-- | workflow-designer-be/pom.xml | 13 | ||||
-rw-r--r-- | workflow-designer-be/src/test/java/org/onap/sdc/workflow/api/mapping/WorkflowMapperTest.java (renamed from workflow-designer-be/src/test/org/onap/sdc/workflow/api/mapping/WorkflowMapperTest.java) | 2 | ||||
-rw-r--r-- | workflow-designer-be/src/test/java/org/onap/sdc/workflow/services/UniqueValueServiceTest.java (renamed from workflow-designer-be/src/test/org/onap/sdc/workflow/services/UniqueValueServiceTest.java) | 19 |
3 files changed, 10 insertions, 24 deletions
diff --git a/workflow-designer-be/pom.xml b/workflow-designer-be/pom.xml index 65f239ad..226bfef6 100644 --- a/workflow-designer-be/pom.xml +++ b/workflow-designer-be/pom.xml @@ -76,6 +76,12 @@ <groupId>org.openecomp.sdc</groupId> <artifactId>openecomp-sdc-versioning-api</artifactId> <version>${onap.version}</version> + <exclusions> + <exclusion> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.openecomp.sdc</groupId> @@ -105,13 +111,6 @@ <artifactId>mapstruct-jdk8</artifactId> <version>${org.mapstruct.version}</version> </dependency> - <dependency> - <groupId>org.junit.jupiter</groupId> - <artifactId>junit-jupiter-api</artifactId> - <version>RELEASE</version> - <scope>test</scope> - </dependency> - </dependencies> <build> diff --git a/workflow-designer-be/src/test/org/onap/sdc/workflow/api/mapping/WorkflowMapperTest.java b/workflow-designer-be/src/test/java/org/onap/sdc/workflow/api/mapping/WorkflowMapperTest.java index 3d5784bc..5371fd70 100644 --- a/workflow-designer-be/src/test/org/onap/sdc/workflow/api/mapping/WorkflowMapperTest.java +++ b/workflow-designer-be/src/test/java/org/onap/sdc/workflow/api/mapping/WorkflowMapperTest.java @@ -22,7 +22,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; public class WorkflowMapperTest { @Configuration - @ComponentScan(basePackageClasses = WorkflowMapperTest.class) + @ComponentScan(basePackageClasses = {WorkflowMapper.class}) public static class WorkflowMapperSpringTestConfig { } @Autowired diff --git a/workflow-designer-be/src/test/org/onap/sdc/workflow/services/UniqueValueServiceTest.java b/workflow-designer-be/src/test/java/org/onap/sdc/workflow/services/UniqueValueServiceTest.java index 57d06fcb..50a19655 100644 --- a/workflow-designer-be/src/test/org/onap/sdc/workflow/services/UniqueValueServiceTest.java +++ b/workflow-designer-be/src/test/java/org/onap/sdc/workflow/services/UniqueValueServiceTest.java @@ -4,7 +4,6 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; @@ -23,8 +22,8 @@ import org.onap.sdc.workflow.services.errors.UniqueValueViolationException; public class UniqueValueServiceTest { - public static final String TYPE = "ss"; - public static final String DUMMY_COMBINATION = "dummy"; + private static final String TYPE = "ss"; + private static final String DUMMY_COMBINATION = "dummy"; @Mock private UniqueValueRepository uniqueValueRepositoryMock; @@ -34,11 +33,10 @@ public class UniqueValueServiceTest { private UniqueValueService uniqueValueService; @Before - public void setUp() throws Exception { + public void setUp() { MockitoAnnotations.initMocks(this); } - // testing create unique value- START @Test public void shouldCallRepositoryInsertIfValueUnique(){ doReturn(Optional.empty()).when(uniqueValueRepositoryMock).findById(any()); @@ -57,9 +55,7 @@ public class UniqueValueServiceTest { doReturn(Optional.of("xxx")).when(uniqueValueRepositoryMock).findById(any()); uniqueValueService.createUniqueValue(TYPE, new String[]{DUMMY_COMBINATION}); } - // testing create unique value- END - // testing delete unique value- START @Test public void shouldCallRepositoryDeleteIfValueValid(){ uniqueValueService.deleteUniqueValue(TYPE, new String[]{DUMMY_COMBINATION}); @@ -72,9 +68,6 @@ public class UniqueValueServiceTest { verify(uniqueValueRepositoryMock, never()).delete(any(UniqueValueEntity.class)); } - // testing delete unique value- END - - // testing update unique value- START @Test public void shouldNotUpdateIfNewAndOldValueAreEqualsCaseIgnore(){ String value = "value"; @@ -90,9 +83,7 @@ public class UniqueValueServiceTest { verify(uniqueValueService, times(1)).createUniqueValue(anyString(), any()); verify(uniqueValueService, times(1)).deleteUniqueValue(anyString(), any()); } - // testing update unique value- END - // testing validateUniqueValue- START @Test public void shouldReturnTrueIfValueExist() { doReturn(Optional.of("xxx")).when(uniqueValueRepositoryMock).findById(any()); @@ -104,8 +95,4 @@ public class UniqueValueServiceTest { doReturn(Optional.empty()).when(uniqueValueRepositoryMock).findById(any()); assertFalse(uniqueValueService.isUniqueValueOccupied(TYPE, new String[]{DUMMY_COMBINATION})); } - - // testing validate unique value- END - - } |