summaryrefslogtreecommitdiffstats
path: root/asdctool/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'asdctool/src/test')
-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()));
}
}