From: ebo Date: Thu, 22 Aug 2019 11:38:01 +0000 (+0000) Subject: CCSDK-1637: Fix DGWorkflowExecutionServiceTest fail if run 1st X-Git-Tag: 0.6.0~8^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F04%2F94104%2F1;p=ccsdk%2Fcds.git CCSDK-1637: Fix DGWorkflowExecutionServiceTest fail if run 1st The failure depends on the ordering of the test classes, which in turn depends on the file system ordering (Surefire plugin's default. See https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#runOrder) This class is sharing the same SB context configuration of the BlueprintServiceLogicTest, but the later manually changes the global BluePrintDependencyService. It was fixed by repeating the same change on the DGWorkflowExecutionServiceTest. Change-Id: I6f76948a766f8d56446a987cb61a781dc0d3f501 Issue-ID: CCSDK-1637 Signed-off-by: ebo --- diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/DGWorkflowExecutionServiceTest.kt b/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/DGWorkflowExecutionServiceTest.kt index ac2d7d62c..6e7e3cb8d 100644 --- a/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/DGWorkflowExecutionServiceTest.kt +++ b/ms/blueprintsprocessor/modules/services/workflow-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/workflow/DGWorkflowExecutionServiceTest.kt @@ -18,14 +18,18 @@ package org.onap.ccsdk.cds.blueprintsprocessor.services.workflow import kotlinx.coroutines.runBlocking +import org.junit.Before import org.junit.Test import org.junit.runner.RunWith import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput import org.onap.ccsdk.cds.blueprintsprocessor.services.workflow.executor.ComponentExecuteNodeExecutor import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonReactorUtils import org.springframework.beans.factory.annotation.Autowired +import org.springframework.context.ApplicationContext +import org.springframework.test.annotation.DirtiesContext import org.springframework.test.context.ContextConfiguration import org.springframework.test.context.junit4.SpringRunner import kotlin.test.assertEquals @@ -35,10 +39,18 @@ import kotlin.test.assertNotNull @ContextConfiguration(classes = [WorkflowServiceConfiguration::class, ComponentExecuteNodeExecutor::class]) class DGWorkflowExecutionServiceTest { + @Autowired + lateinit var applicationContext: ApplicationContext + @Autowired lateinit var dgWorkflowExecutionService: DGWorkflowExecutionService + @Before + fun init() { + BluePrintDependencyService.inject(applicationContext) + } + @Test fun testExecuteDirectedGraph() { runBlocking {