Fix problem with singleton and parallel unit tests 69/48869/1
authorBogumil Zebek <bogumil.zebek@nokia.com>
Thu, 24 May 2018 08:57:54 +0000 (10:57 +0200)
committerBogumil Zebek <bogumil.zebek@nokia.com>
Thu, 24 May 2018 08:57:54 +0000 (10:57 +0200)
Change-Id: If4236506978795933564fc6507e780212edbfd5d
Issue-ID: SO-641
Signed-off-by: Bogumil Zebek <bogumil.zebek@nokia.com>
bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/PropertyConfiguration.java
bpmn/MSOCoreBPMN/src/test/java/org/openecomp/mso/bpmn/core/PropertyConfigurationTest.java

index b627205..f75722e 100644 (file)
@@ -115,6 +115,10 @@ public class PropertyConfiguration {
                return PropertyConfigurationInstanceHolder.instance;
        }
 
+       static void resetPropertyConfigurationSingletonInstance(){
+               PropertyConfigurationInstanceHolder.instance = new PropertyConfiguration();
+       }
+
        /**
         * Returns the list of supported files.
         */
index 506dba2..57a5128 100644 (file)
@@ -51,6 +51,8 @@ import org.junit.Test;
 public class PropertyConfigurationTest {
        @Before
        public void beforeTest() throws IOException {
+               PropertyConfiguration.resetPropertyConfigurationSingletonInstance();
+
                Map<String, String> defaultProperties = PropertyConfigurationSetup.createBpmnProperties();
                defaultProperties.put("testValue", "testKey");
                PropertyConfigurationSetup.init(defaultProperties);