From 8c8bfa90b0e6e894e5119fb02c0de7eebf3a1368 Mon Sep 17 00:00:00 2001 From: ebo Date: Thu, 22 Aug 2019 11:38:01 +0000 Subject: 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 --- .../services/workflow/DGWorkflowExecutionServiceTest.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'ms/blueprintsprocessor') 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 { -- cgit 1.2.3-korg