From d06b3dd32d8d1bc43a0c956aff323173cafe0c59 Mon Sep 17 00:00:00 2001 From: vasraz Date: Mon, 15 Nov 2021 15:45:28 +0000 Subject: Move CSV's generation folder to target Signed-off-by: Vasyl Razinkov Change-Id: I379f20499eeb81f2dc82a943eaef4133ec6f6408 Issue-ID: SDC-3771 --- .../ArtifactValidatorExecutorContract.java | 8 ++--- .../IArtifactValidatorExecutorContract.java | 5 ++- .../migration/task/MigrationTasksTest.java | 41 +++++++++++----------- 3 files changed, 25 insertions(+), 29 deletions(-) (limited to 'asdctool/src/test/java/org/openecomp') 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 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> 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 migrations; @@ -52,21 +49,25 @@ public class MigrationTasksTest { Map> 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 migrationsWithVersionsGreaterThanCurrent = migrations.stream().filter(mig -> mig.getVersion().compareTo(DBVersion.DEFAULT_VERSION) > 0) - .collect(Collectors.toSet()); + Set 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())); } } -- cgit 1.2.3-korg