From e9cb7eb287f88938b0a2f6d2cd0743e6ac2867f8 Mon Sep 17 00:00:00 2001 From: Francis Toth Date: Wed, 24 Jun 2020 09:28:06 -0400 Subject: Cleaned up ArtifactValidatorExecuter and IArtifactValidatorExecutor This commit intends to clean the tests related to ArtifactValidatorExecuter and IArtifactValidatorExecutor by introducing the concept of test contract. Some renaming have to be done to fix the typo in Executer (it should be named Executor), hence the number of changes. Signed-off-by: Francis Toth Change-Id: I5cd4512c425ae01f4f1118c9d61e6fce3df94f1d Issue-ID: SDC-2499 --- .../impl/validator/ArtifactToolBLTest.java | 4 +- .../impl/validator/ValidationToolBLTest.java | 4 +- .../config/ValidationToolConfigurationTest.java | 4 +- .../executers/ArtifactValidatorExecuterTest.java | 95 ---------------------- .../ArtifactValidatorExecutorContract.java | 75 +++++++++++++++++ .../IArtifactValidatorExecutorContract.java | 50 ++++++++++++ .../NodeToscaArtifactsValidatorExecuterTest.java | 64 --------------- .../NodeToscaArtifactsValidatorExecutorTest.java | 36 ++++++++ ...ServiceToscaArtifactsValidatorExecutorTest.java | 44 ++-------- .../VFToscaArtifactValidatorExecutorTest.java | 50 ++---------- 10 files changed, 182 insertions(+), 244 deletions(-) delete mode 100644 asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/ArtifactValidatorExecuterTest.java create mode 100644 asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/ArtifactValidatorExecutorContract.java create mode 100644 asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/IArtifactValidatorExecutorContract.java delete mode 100644 asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/NodeToscaArtifactsValidatorExecuterTest.java create mode 100644 asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/NodeToscaArtifactsValidatorExecutorTest.java (limited to 'asdctool/src/test') diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/ArtifactToolBLTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/ArtifactToolBLTest.java index e6ae05f493..47952f8d5c 100644 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/ArtifactToolBLTest.java +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/ArtifactToolBLTest.java @@ -25,7 +25,7 @@ import static org.mockito.Mockito.mock; import java.util.ArrayList; import java.util.LinkedList; import org.junit.Test; -import org.openecomp.sdc.asdctool.impl.validator.executers.NodeToscaArtifactsValidatorExecuter; +import org.openecomp.sdc.asdctool.impl.validator.executers.NodeToscaArtifactsValidatorExecutor; import org.openecomp.sdc.be.dao.jsongraph.JanusGraphDao; import org.openecomp.sdc.be.model.jsonjanusgraph.operations.ToscaOperationFacade; @@ -43,7 +43,7 @@ public class ArtifactToolBLTest { ArtifactToolBL testSubject = createTestSubject(); testSubject.validators = new LinkedList<>(); - testSubject.validators.add(new NodeToscaArtifactsValidatorExecuter(janusGraphDaoMock, toscaOperationFacade)); + testSubject.validators.add(new NodeToscaArtifactsValidatorExecutor(janusGraphDaoMock, toscaOperationFacade)); // 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 testSubject.validateAll(null); diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/ValidationToolBLTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/ValidationToolBLTest.java index 8c2dffcbc2..ddea391ab1 100644 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/ValidationToolBLTest.java +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/ValidationToolBLTest.java @@ -46,8 +46,6 @@ public class ValidationToolBLTest { testSubject.validators = new LinkedList<>(); testSubject.validators.add(new ServiceValidatorExecuter(janusGraphDaoMock)); Report report = Report.make(); - // 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 - testSubject.validateAll(report, makeTxtFile(makeConsoleWriter()), null); + testSubject.validateAll(report, makeTxtFile(makeConsoleWriter())); } } diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationToolConfigurationTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationToolConfigurationTest.java index deadf3250d..1903f0f1e7 100644 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationToolConfigurationTest.java +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationToolConfigurationTest.java @@ -23,7 +23,7 @@ package org.openecomp.sdc.asdctool.impl.validator.config; import org.junit.Test; import org.openecomp.sdc.asdctool.impl.validator.ArtifactToolBL; import org.openecomp.sdc.asdctool.impl.validator.ValidationToolBL; -import org.openecomp.sdc.asdctool.impl.validator.executers.NodeToscaArtifactsValidatorExecuter; +import org.openecomp.sdc.asdctool.impl.validator.executers.NodeToscaArtifactsValidatorExecutor; import org.openecomp.sdc.asdctool.impl.validator.executers.ServiceToscaArtifactsValidatorExecutor; import org.openecomp.sdc.asdctool.impl.validator.executers.ServiceValidatorExecuter; import org.openecomp.sdc.asdctool.impl.validator.executers.VFToscaArtifactValidatorExecutor; @@ -227,7 +227,7 @@ public class ValidationToolConfigurationTest { @Test public void testNodeToscaArtifactsValidatorValidator() { ValidationToolConfiguration testSubject; - NodeToscaArtifactsValidatorExecuter result; + NodeToscaArtifactsValidatorExecutor result; JanusGraphDao janusGraphDaoMock = mock(JanusGraphDao.class); ToscaOperationFacade toscaOperationFacade = mock(ToscaOperationFacade.class); diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/ArtifactValidatorExecuterTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/ArtifactValidatorExecuterTest.java deleted file mode 100644 index 46fae4312d..0000000000 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/ArtifactValidatorExecuterTest.java +++ /dev/null @@ -1,95 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * SDC - * ================================================================================ - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * 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. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.sdc.asdctool.impl.validator.executers; - -import org.junit.Test; -import org.openecomp.sdc.be.dao.jsongraph.JanusGraphDao; -import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum; -import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum; -import org.openecomp.sdc.be.model.Component; -import org.openecomp.sdc.be.model.Resource; -import org.openecomp.sdc.be.model.jsonjanusgraph.operations.ToscaOperationFacade; -import org.testng.Assert; - -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -import static org.mockito.Mockito.mock; - -public class ArtifactValidatorExecuterTest { - - private ArtifactValidatorExecuter createTestSubject() { - JanusGraphDao janusGraphDaoMock = mock(JanusGraphDao.class); - ToscaOperationFacade toscaOperationFacade = mock(ToscaOperationFacade.class); - - return new ArtifactValidatorExecuter(janusGraphDaoMock, toscaOperationFacade); - } - - @Test - public void testGetName() throws Exception { - ArtifactValidatorExecuter testSubject; - String result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getName(); - } - - @Test(expected = NullPointerException.class) - public void testGetVerticesToValidate() throws Exception { - ArtifactValidatorExecuter testSubject; - VertexTypeEnum type = null; - Map hasProps = null; - - // default test - testSubject = createTestSubject(); - testSubject.getVerticesToValidate(type, hasProps); - } - - @Test - public void testSetName() throws Exception { - ArtifactValidatorExecuter testSubject; - String name = ""; - - // default test - testSubject = createTestSubject(); - testSubject.setName(name); - } - - @Test - public void testValidate() { - ArtifactValidatorExecuter testSubject; - Map> vertices = new HashMap<>(); - LinkedList linkedList = new LinkedList(); - linkedList.add(new Resource()); - vertices.put("stam", linkedList); - boolean result; - - // default test - testSubject = createTestSubject(); - // 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 - result = testSubject.validate(vertices, null); - Assert.assertFalse(result); - } -} diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/ArtifactValidatorExecutorContract.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/ArtifactValidatorExecutorContract.java new file mode 100644 index 0000000000..8564bb8251 --- /dev/null +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/ArtifactValidatorExecutorContract.java @@ -0,0 +1,75 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdc.asdctool.impl.validator.executers; + +import static org.mockito.Mockito.mock; + +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.openecomp.sdc.be.dao.jsongraph.JanusGraphDao; +import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum; +import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.jsonjanusgraph.operations.ToscaOperationFacade; +import org.testng.Assert; + +public interface ArtifactValidatorExecutorContract { + + ArtifactValidatorExecutor createTestSubject( + JanusGraphDao janusGraphDao, + ToscaOperationFacade toscaOperationFacade + ); + + @Test + default void testGetVerticesToValidate() { + JanusGraphDao janusGraphDaoMock = mock(JanusGraphDao.class); + ToscaOperationFacade toscaOperationFacade = mock(ToscaOperationFacade.class); + final ArtifactValidatorExecutor testSubject = createTestSubject(janusGraphDaoMock, toscaOperationFacade); + + VertexTypeEnum type = null; + Map hasProps = null; + Assertions.assertThrows(NullPointerException.class, () -> + testSubject.getVerticesToValidate(type, hasProps) + ); + } + + @Test + default void testValidate() { + JanusGraphDao janusGraphDaoMock = mock(JanusGraphDao.class); + ToscaOperationFacade toscaOperationFacade = mock(ToscaOperationFacade.class); + final ArtifactValidatorExecutor testSubject = createTestSubject(janusGraphDaoMock, toscaOperationFacade); + + LinkedList linkedList = new LinkedList(); + linkedList.add(new Resource()); + + 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 + Assert.assertFalse(testSubject.validate(vertices, null)); + } +} diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/IArtifactValidatorExecutorContract.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/IArtifactValidatorExecutorContract.java new file mode 100644 index 0000000000..39a1bbef0c --- /dev/null +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/IArtifactValidatorExecutorContract.java @@ -0,0 +1,50 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2020 Bell Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdc.asdctool.impl.validator.executers; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.openecomp.sdc.be.dao.jsongraph.JanusGraphDao; +import org.openecomp.sdc.be.model.jsonjanusgraph.operations.ToscaOperationFacade; + +import static org.mockito.Mockito.mock; + +public abstract class IArtifactValidatorExecutorContract { + + protected abstract IArtifactValidatorExecutor createTestSubject( + JanusGraphDao janusGraphDao, + ToscaOperationFacade toscaOperationFacade + ); + + private IArtifactValidatorExecutor createTestSubject() { + return createTestSubject(mock(JanusGraphDao.class), mock(ToscaOperationFacade.class)); + } + + @Test + public void testExecuteValidations() { + Assertions.assertThrows(NullPointerException.class, () -> + // 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 + createTestSubject().executeValidations(null) + ); + } +} + diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/NodeToscaArtifactsValidatorExecuterTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/NodeToscaArtifactsValidatorExecuterTest.java deleted file mode 100644 index c9c90b2aa4..0000000000 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/NodeToscaArtifactsValidatorExecuterTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * SDC - * ================================================================================ - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * 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. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.sdc.asdctool.impl.validator.executers; - -import org.junit.Test; -import org.openecomp.sdc.be.dao.jsongraph.JanusGraphDao; -import org.openecomp.sdc.be.model.jsonjanusgraph.operations.ToscaOperationFacade; - -import static org.mockito.Mockito.mock; - -public class NodeToscaArtifactsValidatorExecuterTest { - - private NodeToscaArtifactsValidatorExecuter createTestSubject() { - JanusGraphDao janusGraphDaoMock = mock(JanusGraphDao.class); - ToscaOperationFacade toscaOperationFacade = mock(ToscaOperationFacade.class); - - return new NodeToscaArtifactsValidatorExecuter(janusGraphDaoMock, toscaOperationFacade); - } - - @Test(expected = NullPointerException.class) - public void testExecuteValidations() { - // 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 - createTestSubject().executeValidations(null); - } - - @Test - public void testGetName() throws Exception { - NodeToscaArtifactsValidatorExecuter testSubject; - String result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getName(); - } - - @Test - public void testSetName() throws Exception { - NodeToscaArtifactsValidatorExecuter testSubject; - String name = ""; - - // default test - testSubject = createTestSubject(); - testSubject.setName(name); - } -} diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/NodeToscaArtifactsValidatorExecutorTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/NodeToscaArtifactsValidatorExecutorTest.java new file mode 100644 index 0000000000..3870a98d78 --- /dev/null +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/NodeToscaArtifactsValidatorExecutorTest.java @@ -0,0 +1,36 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2020 Bell Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdc.asdctool.impl.validator.executers; + +import org.openecomp.sdc.be.dao.jsongraph.JanusGraphDao; +import org.openecomp.sdc.be.model.jsonjanusgraph.operations.ToscaOperationFacade; + +public class NodeToscaArtifactsValidatorExecutorTest + extends IArtifactValidatorExecutorContract implements ArtifactValidatorExecutorContract { + + @Override + public NodeToscaArtifactsValidatorExecutor createTestSubject( + JanusGraphDao janusGraphDao, + ToscaOperationFacade toscaOperationFacade + ) { + return new NodeToscaArtifactsValidatorExecutor(janusGraphDao, toscaOperationFacade); + } +} diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/ServiceToscaArtifactsValidatorExecutorTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/ServiceToscaArtifactsValidatorExecutorTest.java index 1e24867358..7998c52ea4 100644 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/ServiceToscaArtifactsValidatorExecutorTest.java +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/ServiceToscaArtifactsValidatorExecutorTest.java @@ -20,45 +20,17 @@ package org.openecomp.sdc.asdctool.impl.validator.executers; -import org.junit.Test; import org.openecomp.sdc.be.dao.jsongraph.JanusGraphDao; import org.openecomp.sdc.be.model.jsonjanusgraph.operations.ToscaOperationFacade; -import static org.mockito.Mockito.mock; +public class ServiceToscaArtifactsValidatorExecutorTest + extends IArtifactValidatorExecutorContract implements ArtifactValidatorExecutorContract { -public class ServiceToscaArtifactsValidatorExecutorTest { - - private ServiceToscaArtifactsValidatorExecutor createTestSubject() { - JanusGraphDao janusGraphDaoMock = mock(JanusGraphDao.class); - ToscaOperationFacade toscaOperationFacade = mock(ToscaOperationFacade.class); - - return new ServiceToscaArtifactsValidatorExecutor(janusGraphDaoMock, toscaOperationFacade); - } - - @Test(expected = NullPointerException.class) - public void testExecuteValidations() { - // 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 - createTestSubject().executeValidations(null); - } - - @Test - public void testGetName() throws Exception { - ServiceToscaArtifactsValidatorExecutor testSubject; - String result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getName(); - } - - @Test - public void testSetName() throws Exception { - ServiceToscaArtifactsValidatorExecutor testSubject; - String name = ""; - - // default test - testSubject = createTestSubject(); - testSubject.setName(name); + @Override + public ServiceToscaArtifactsValidatorExecutor createTestSubject( + JanusGraphDao janusGraphDao, + ToscaOperationFacade toscaOperationFacade + ) { + return new ServiceToscaArtifactsValidatorExecutor(janusGraphDao, toscaOperationFacade); } } diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/VFToscaArtifactValidatorExecutorTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/VFToscaArtifactValidatorExecutorTest.java index 783b888dec..ae6dcc1623 100644 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/VFToscaArtifactValidatorExecutorTest.java +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/VFToscaArtifactValidatorExecutorTest.java @@ -20,51 +20,17 @@ package org.openecomp.sdc.asdctool.impl.validator.executers; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; import org.openecomp.sdc.be.dao.jsongraph.JanusGraphDao; import org.openecomp.sdc.be.model.jsonjanusgraph.operations.ToscaOperationFacade; -import static org.mockito.Mockito.mock; +public class VFToscaArtifactValidatorExecutorTest + extends IArtifactValidatorExecutorContract implements ArtifactValidatorExecutorContract { -public class VFToscaArtifactValidatorExecutorTest { - - private VFToscaArtifactValidatorExecutor createTestSubject() { - JanusGraphDao janusGraphDaoMock = mock(JanusGraphDao.class); - ToscaOperationFacade toscaOperationFacade = mock(ToscaOperationFacade.class); - - return new VFToscaArtifactValidatorExecutor(janusGraphDaoMock, toscaOperationFacade); - } - - @Test - public void testExecuteValidations() { - VFToscaArtifactValidatorExecutor testSubject; - boolean result; - - // default test - testSubject = createTestSubject(); - // 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 - Assertions.assertThrows(NullPointerException.class, () -> testSubject.executeValidations(null)); - } - - @Test - public void testGetName() throws Exception { - VFToscaArtifactValidatorExecutor testSubject; - String result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getName(); - } - - @Test - public void testSetName() throws Exception { - VFToscaArtifactValidatorExecutor testSubject; - String name = ""; - - // default test - testSubject = createTestSubject(); - testSubject.setName(name); + @Override + public VFToscaArtifactValidatorExecutor createTestSubject( + JanusGraphDao janusGraphDao, + ToscaOperationFacade toscaOperationFacade + ) { + return new VFToscaArtifactValidatorExecutor(janusGraphDao, toscaOperationFacade); } } -- cgit 1.2.3-korg