diff options
Diffstat (limited to 'common-be/src/test/java/org/openecomp/sdc/be/datatypes/components/ServiceMetadataDataDefinitionTest.java')
-rw-r--r-- | common-be/src/test/java/org/openecomp/sdc/be/datatypes/components/ServiceMetadataDataDefinitionTest.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/components/ServiceMetadataDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/components/ServiceMetadataDataDefinitionTest.java index 3842f0a00e..77b6871c92 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/components/ServiceMetadataDataDefinitionTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/components/ServiceMetadataDataDefinitionTest.java @@ -21,12 +21,34 @@ package org.openecomp.sdc.be.datatypes.components; import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; +import org.openecomp.sdc.be.config.Configuration; +import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; +import org.openecomp.sdc.be.utils.DummyConfigurationManager; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; public class ServiceMetadataDataDefinitionTest { + private Configuration.EnvironmentContext environmentContext = mock(Configuration.EnvironmentContext.class); + private static final String DEFAULT_ENVIRONMENT = "General_Revenue-Bearing"; + @BeforeClass + public static void setup() { + new DummyConfigurationManager(); + } + + @Before + public void beforeTest() { + when(environmentContext.getDefaultValue()).thenReturn(DEFAULT_ENVIRONMENT); + when(ConfigurationManager.getConfigurationManager().getConfiguration().getEnvironmentContext()) + .thenReturn(environmentContext); + } + private ServiceMetadataDataDefinition createTestSubject() { return new ServiceMetadataDataDefinition(); } |