summaryrefslogtreecommitdiffstats
path: root/asdctool/src/test/java
diff options
context:
space:
mode:
authorvasraz <vasyl.razinkov@est.tech>2021-11-15 15:45:28 +0000
committerVasyl Razinkov <vasyl.razinkov@est.tech>2021-11-15 15:46:00 +0000
commitd06b3dd32d8d1bc43a0c956aff323173cafe0c59 (patch)
tree648d987c6225e36cdfc017a45ed746f40394e7b6 /asdctool/src/test/java
parenta6fc7a9303edd6f11a4766701981d4ff30cc40ef (diff)
Move CSV's generation folder to target
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Change-Id: I379f20499eeb81f2dc82a943eaef4133ec6f6408 Issue-ID: SDC-3771
Diffstat (limited to 'asdctool/src/test/java')
-rw-r--r--asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executor/ArtifactValidatorExecutorContract.java8
-rw-r--r--asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executor/IArtifactValidatorExecutorContract.java5
-rw-r--r--asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/task/MigrationTasksTest.java41
3 files changed, 25 insertions, 29 deletions
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executor/ArtifactValidatorExecutorContract.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executor/ArtifactValidatorExecutorContract.java
index 621b832898..a940407d19 100644
--- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executor/ArtifactValidatorExecutorContract.java
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executor/ArtifactValidatorExecutorContract.java
@@ -20,7 +20,6 @@
package org.openecomp.sdc.asdctool.impl.validator.executor;
-import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.mockito.Mockito.mock;
import java.util.HashMap;
@@ -51,8 +50,7 @@ public interface ArtifactValidatorExecutorContract {
VertexTypeEnum type = null;
Map<GraphPropertyEnum, Object> hasProps = null;
- Assertions.assertThrows(NullPointerException.class, () ->
- testSubject.getVerticesToValidate(type, hasProps)
+ Assertions.assertThrows(NullPointerException.class, () -> testSubject.getVerticesToValidate(type, hasProps)
);
}
@@ -68,8 +66,6 @@ public interface ArtifactValidatorExecutorContract {
Map<String, List<Component>> vertices = new HashMap<>();
vertices.put("stam", linkedList);
- // Initially no outputFilePath was passed to this function (hence it is set to null)
- // TODO: Fix this null and see if the argument is used by this function
- assertFalse(testSubject.validate(vertices, null));
+ Assertions.assertFalse(testSubject.validate(vertices, "target/"));
}
}
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executor/IArtifactValidatorExecutorContract.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executor/IArtifactValidatorExecutorContract.java
index 8af265e715..a21afb85fe 100644
--- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executor/IArtifactValidatorExecutorContract.java
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executor/IArtifactValidatorExecutorContract.java
@@ -20,13 +20,13 @@
package org.openecomp.sdc.asdctool.impl.validator.executor;
+import static org.mockito.Mockito.mock;
+
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.openecomp.sdc.be.dao.janusgraph.JanusGraphDao;
import org.openecomp.sdc.be.model.jsonjanusgraph.operations.ToscaOperationFacade;
-import static org.mockito.Mockito.mock;
-
public abstract class IArtifactValidatorExecutorContract {
protected abstract IArtifactValidatorExecutor createTestSubject(
@@ -47,4 +47,3 @@ public abstract class IArtifactValidatorExecutorContract {
);
}
}
-
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/task/MigrationTasksTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/task/MigrationTasksTest.java
index 9a6db29ae7..5efb23f3e3 100644
--- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/task/MigrationTasksTest.java
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/task/MigrationTasksTest.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,23 +20,20 @@
package org.openecomp.sdc.asdctool.migration.task;
-import static org.junit.jupiter.api.Assertions.fail;
-
-import org.apache.commons.lang3.StringUtils;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.openecomp.sdc.asdctool.migration.core.DBVersion;
-import org.openecomp.sdc.asdctool.migration.core.task.Migration;
-import org.openecomp.sdc.asdctool.migration.scanner.ClassScanner;
-
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
+import org.apache.commons.lang.StringUtils;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.openecomp.sdc.asdctool.migration.core.DBVersion;
+import org.openecomp.sdc.asdctool.migration.core.task.Migration;
+import org.openecomp.sdc.asdctool.migration.scanner.ClassScanner;
-
-public class MigrationTasksTest {
+public class MigrationTasksTest {
public static final String MIGRATIONS_BASE_PACKAGE = "org.openecomp.sdc.asdctool.migration.tasks";
private List<Migration> migrations;
@@ -52,21 +49,25 @@ public class MigrationTasksTest {
Map<DBVersion, List<Migration>> migrationsByVersion = migrations.stream().collect(Collectors.groupingBy(Migration::getVersion));
migrationsByVersion.forEach((version, migrations) -> {
if (migrations.size() > 1) {
- System.out.println(String.format("the following migration tasks have the same version %s. versions must be unique", version.toString()));
- fail(String.format("migration tasks %s has same version %s. migration tasks versions must be unique.", getMigrationsNameAsString(migrations), version.toString()));
+ System.out.println(
+ String.format("the following migration tasks have the same version %s. versions must be unique", version.toString()));
+ Assertions.fail(String.format("migration tasks %s has same version %s. migration tasks versions must be unique.",
+ getMigrationsNameAsString(migrations), version.toString()));
}
});
}
@Test
public void testNoTaskWithVersionGreaterThanCurrentVersion() throws Exception {
- Set<Migration> migrationsWithVersionsGreaterThanCurrent = migrations.stream().filter(mig -> mig.getVersion().compareTo(DBVersion.DEFAULT_VERSION) > 0)
- .collect(Collectors.toSet());
+ Set<Migration> migrationsWithVersionsGreaterThanCurrent = migrations.stream()
+ .filter(mig -> mig.getVersion().compareTo(DBVersion.DEFAULT_VERSION) > 0)
+ .collect(Collectors.toSet());
if (!migrationsWithVersionsGreaterThanCurrent.isEmpty()) {
- fail(String.format("migrations tasks %s have version which is greater than DBVersion.DEFAULT_VERSION %s. did you forget to update current version?",
- getMigrationsNameAsString(migrationsWithVersionsGreaterThanCurrent),
- DBVersion.DEFAULT_VERSION.toString()));
+ Assertions.fail(String.format(
+ "migrations tasks %s have version which is greater than DBVersion.DEFAULT_VERSION %s. did you forget to update current version?",
+ getMigrationsNameAsString(migrationsWithVersionsGreaterThanCurrent),
+ DBVersion.DEFAULT_VERSION.toString()));
}
}