From 70533b5c8fff3e9eb9e3b7bc6dd439d53036915a Mon Sep 17 00:00:00 2001 From: ChrisC Date: Fri, 12 Feb 2021 16:21:40 +0100 Subject: Fix build Fix catalog-be tests and Integration docker test this fix is not final as it just avoids concurrency issues on statics Fix Expired certificates on Vendorsoftwareproduct Issue-ID: SDC-3467 Signed-off-by: ChrisC Change-Id: I311470b305a29bebffbd74b6f2ad7b13193132e1 --- .../sdc/be/externalapi/servlet/AssetsDataServletTest.java | 2 +- .../sdc/be/externalapi/servlet/ExternalRefServletTest.java | 2 +- .../org/openecomp/sdc/be/servlets/ArchiveEndpointTest.java | 4 +++- .../sdc/be/servlets/ComponentInstanceServletTest.java | 14 ++++++++++++++ .../sdc/be/servlets/ComponentNodeFilterServletTest.java | 14 +++++++++++++- .../openecomp/sdc/be/servlets/ComponentServletTest.java | 2 ++ .../servlets/ComponentSubstitutionFilterServletTest.java | 14 +++++++++++++- .../org/openecomp/sdc/be/servlets/ElementServletTest.java | 4 +++- .../sdc/be/servlets/ExceptionHandlerEndpointTest.java | 2 ++ .../org/openecomp/sdc/be/servlets/GroupEndpointTest.java | 2 ++ .../openecomp/sdc/be/servlets/GroupTypesEndpointTest.java | 2 ++ .../org/openecomp/sdc/be/servlets/InputsServletTest.java | 2 ++ .../openecomp/sdc/be/servlets/JerseySpringBaseTest.java | 1 + .../org/openecomp/sdc/be/servlets/PolicyServletTest.java | 2 ++ .../openecomp/sdc/be/servlets/PolicyTypesEndpointTest.java | 2 ++ .../openecomp/sdc/be/servlets/TypesUploadEndpointTest.java | 2 ++ .../openecomp/sdc/be/servlets/TypesUploadServletTest.java | 3 ++- .../org/openecomp/sdc/be/servlets/UserEndpointTest.java | 2 ++ .../sdc/cucumber/runners/RunTenantIsolationTest.java | 1 - catalog-be/src/test/resources/cucumber.properties | 1 + 20 files changed, 70 insertions(+), 8 deletions(-) create mode 100644 catalog-be/src/test/resources/cucumber.properties (limited to 'catalog-be/src') diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/AssetsDataServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/AssetsDataServletTest.java index 2e62981820..ae8d2948e0 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/AssetsDataServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/AssetsDataServletTest.java @@ -135,7 +135,7 @@ public class AssetsDataServletTest extends JerseyTest { Mockito.doReturn(Either.left(resourceAssetMetadata)).when(assetMetadataConverter).convertToSingleAssetMetadata(Mockito.eq(resource), Mockito.anyString(), Mockito.eq(true)); - String appConfigDir = "src/test/resources/config"; + String appConfigDir = "src/test/resources/config/catalog-be"; ConfigurationSource configurationSource = new FSConfigurationSource(ExternalConfiguration.getChangeListener(), appConfigDir); ConfigurationManager configurationManager = new ConfigurationManager(configurationSource); diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/ExternalRefServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/ExternalRefServletTest.java index 7482c69c05..a7db4ba6c4 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/ExternalRefServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/ExternalRefServletTest.java @@ -346,7 +346,7 @@ public class ExternalRefServletTest extends JerseyTest { when(userAdmin.getUser(otherUser.getUserId(), false)).thenReturn(otherUser); //======================================================================================================================== - String appConfigDir = "src/test/resources/config"; + String appConfigDir = "src/test/resources/config/catalog-be"; ConfigurationSource configurationSource = new FSConfigurationSource(ExternalConfiguration.getChangeListener(), appConfigDir); ConfigurationManager configurationManager = new ConfigurationManager(configurationSource); diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ArchiveEndpointTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ArchiveEndpointTest.java index 009fa82b9e..d879b46439 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ArchiveEndpointTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ArchiveEndpointTest.java @@ -25,6 +25,7 @@ package org.openecomp.sdc.be.servlets; import fj.data.Either; import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.test.JerseyTest; +import org.glassfish.jersey.test.TestProperties; import org.junit.BeforeClass; import org.junit.Test; import org.mockito.Mockito; @@ -330,7 +331,7 @@ public class ArchiveEndpointTest extends JerseyTest { when(userAdmin.getUser(otherUser.getUserId(), false)).thenReturn(otherUser); //======================================================================================================================== - String appConfigDir = "src/test/resources/config"; + String appConfigDir = "src/test/resources/config/catalog-be"; ConfigurationSource configurationSource = new FSConfigurationSource(ExternalConfiguration.getChangeListener(), appConfigDir); ConfigurationManager configurationManager = new ConfigurationManager(configurationSource); @@ -508,6 +509,7 @@ public class ArchiveEndpointTest extends JerseyTest { @Override protected Application configure() { ApplicationContext context = new AnnotationConfigApplicationContext(TestSpringConfig.class); + forceSet(TestProperties.CONTAINER_PORT, "0"); return new ResourceConfig(ArchiveEndpoint.class) .register(DefaultExceptionMapper.class) .register(ComponentExceptionMapper.class) diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentInstanceServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentInstanceServletTest.java index 0eee7a1238..b49ed1763a 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentInstanceServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentInstanceServletTest.java @@ -57,6 +57,8 @@ import org.openecomp.sdc.be.components.impl.ComponentNodeFilterBusinessLogic; import org.openecomp.sdc.be.components.impl.GroupBusinessLogic; import org.openecomp.sdc.be.components.impl.ResourceImportManager; import org.openecomp.sdc.be.components.impl.ServiceBusinessLogic; +import org.openecomp.sdc.be.config.Configuration; +import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.config.SpringConfig; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; @@ -72,11 +74,15 @@ import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum; import org.openecomp.sdc.be.user.UserBusinessLogic; import org.openecomp.sdc.common.api.Constants; +import org.openecomp.sdc.common.api.ConfigurationSource; +import org.openecomp.sdc.common.impl.ExternalConfiguration; +import org.openecomp.sdc.common.impl.FSConfigurationSource; import org.openecomp.sdc.exception.ResponseFormat; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.web.context.WebApplicationContext; + /** * The test suite designed for test functionality of ComponentInstanceServlet class */ @@ -97,11 +103,19 @@ public class ComponentInstanceServletTest extends JerseyTest { private static ResourceImportManager resourceImportManager; private static ServiceBusinessLogic serviceBusinessLogic; private static ComponentNodeFilterBusinessLogic componentNodeFilterBusinessLogic; + private static ConfigurationManager configurationManager; @BeforeClass public static void setup() { createMocks(); stubMethods(); + String appConfigDir = "src/test/resources/config/catalog-be"; + ConfigurationSource configurationSource = new FSConfigurationSource(ExternalConfiguration.getChangeListener(), appConfigDir); + configurationManager = new ConfigurationManager(configurationSource); + org.openecomp.sdc.be.config.Configuration configuration = new org.openecomp.sdc.be.config.Configuration(); + configuration.setJanusGraphInMemoryGraph(true); + configurationManager.setConfiguration(configuration); + ExternalConfiguration.setAppName("catalog-be"); } @Test diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentNodeFilterServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentNodeFilterServletTest.java index 4109f6222c..7674ea9698 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentNodeFilterServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentNodeFilterServletTest.java @@ -64,6 +64,8 @@ import org.openecomp.sdc.be.components.impl.ResourceImportManager; import org.openecomp.sdc.be.components.impl.exceptions.BusinessLogicException; import org.openecomp.sdc.be.components.impl.utils.NodeFilterConstraintAction; import org.openecomp.sdc.be.components.validation.UserValidations; +import org.openecomp.sdc.be.config.Configuration; +import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.config.SpringConfig; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.datamodel.utils.ConstraintConvertor; @@ -82,6 +84,9 @@ import org.openecomp.sdc.be.ui.model.UIConstraint; import org.openecomp.sdc.be.user.Role; import org.openecomp.sdc.be.user.UserBusinessLogic; import org.openecomp.sdc.common.api.Constants; +import org.openecomp.sdc.common.api.ConfigurationSource; +import org.openecomp.sdc.common.impl.ExternalConfiguration; +import org.openecomp.sdc.common.impl.FSConfigurationSource; import org.openecomp.sdc.exception.ResponseFormat; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; @@ -112,7 +117,7 @@ public class ComponentNodeFilterServletTest extends JerseyTest { private static ComponentNodeFilterBusinessLogic componentNodeFilterBusinessLogic; private static ResponseFormat responseFormat; private static UserValidations userValidations; - + private static ConfigurationManager configurationManager; private CINodeFilterDataDefinition ciNodeFilterDataDefinition; private UIConstraint uiConstraint; private String constraint; @@ -130,6 +135,13 @@ public class ComponentNodeFilterServletTest extends JerseyTest { when(request.getHeader("USER_ID")).thenReturn(USER_ID); when(webApplicationContext.getBean(ServletUtils.class)).thenReturn(servletUtils); when(servletUtils.getComponentsUtils()).thenReturn(componentsUtils); + String appConfigDir = "src/test/resources/config/catalog-be"; + ConfigurationSource configurationSource = new FSConfigurationSource(ExternalConfiguration.getChangeListener(), appConfigDir); + configurationManager = new ConfigurationManager(configurationSource); + org.openecomp.sdc.be.config.Configuration configuration = new org.openecomp.sdc.be.config.Configuration(); + configuration.setJanusGraphInMemoryGraph(true); + configurationManager.setConfiguration(configuration); + ExternalConfiguration.setAppName("catalog-be"); } @BeforeEach diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentServletTest.java index 0e444fee92..77b90ad1de 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentServletTest.java @@ -22,6 +22,7 @@ package org.openecomp.sdc.be.servlets; import fj.data.Either; import org.glassfish.jersey.server.ResourceConfig; +import org.glassfish.jersey.test.TestProperties; import org.json.JSONArray; import org.json.JSONObject; import org.junit.Before; @@ -65,6 +66,7 @@ public class ComponentServletTest extends JerseySpringBaseTest{ @Override protected ResourceConfig configure() { + forceSet(TestProperties.CONTAINER_PORT, "0"); resourceBusinessLogic = mock(ResourceBusinessLogic.class); UserBusinessLogic userBusinessLogic = mock(UserBusinessLogic.class); ComponentsUtils componentsUtils = mock(ComponentsUtils.class); diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentSubstitutionFilterServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentSubstitutionFilterServletTest.java index 2da9efbb6d..bcc0f2eadb 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentSubstitutionFilterServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentSubstitutionFilterServletTest.java @@ -62,6 +62,8 @@ import org.openecomp.sdc.be.components.impl.ComponentSubstitutionFilterBusinessL import org.openecomp.sdc.be.components.impl.ResourceImportManager; import org.openecomp.sdc.be.components.impl.exceptions.BusinessLogicException; import org.openecomp.sdc.be.components.validation.UserValidations; +import org.openecomp.sdc.be.config.Configuration; +import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.config.SpringConfig; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.datamodel.utils.ConstraintConvertor; @@ -77,6 +79,9 @@ import org.openecomp.sdc.be.ui.model.UIConstraint; import org.openecomp.sdc.be.user.Role; import org.openecomp.sdc.be.user.UserBusinessLogic; import org.openecomp.sdc.common.api.Constants; +import org.openecomp.sdc.common.api.ConfigurationSource; +import org.openecomp.sdc.common.impl.ExternalConfiguration; +import org.openecomp.sdc.common.impl.FSConfigurationSource; import org.openecomp.sdc.exception.ResponseFormat; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; @@ -107,7 +112,7 @@ public class ComponentSubstitutionFilterServletTest extends JerseyTest { private static ComponentSubstitutionFilterBusinessLogic componentSubstitutionFilterBusinessLogic; private static ResponseFormat responseFormat; private static UserValidations userValidations; - + private static ConfigurationManager configurationManager; private SubstitutionFilterDataDefinition substitutionFilterDataDefinition; private RequirementSubstitutionFilterPropertyDataDefinition requirementSubstitutionFilterPropertyDataDefinition; private UIConstraint uiConstraint; @@ -128,6 +133,13 @@ public class ComponentSubstitutionFilterServletTest extends JerseyTest { when(request.getHeader("USER_ID")).thenReturn(USER_ID); when(webApplicationContext.getBean(ServletUtils.class)).thenReturn(servletUtils); when(servletUtils.getComponentsUtils()).thenReturn(componentsUtils); + String appConfigDir = "src/test/resources/config/catalog-be"; + ConfigurationSource configurationSource = new FSConfigurationSource(ExternalConfiguration.getChangeListener(), appConfigDir); + configurationManager = new ConfigurationManager(configurationSource); + org.openecomp.sdc.be.config.Configuration configuration = new org.openecomp.sdc.be.config.Configuration(); + configuration.setJanusGraphInMemoryGraph(true); + configurationManager.setConfiguration(configuration); + ExternalConfiguration.setAppName("catalog-be"); } @BeforeEach diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ElementServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ElementServletTest.java index 974f286098..af7199c9e6 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ElementServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ElementServletTest.java @@ -28,6 +28,7 @@ import org.apache.http.HttpStatus; import org.glassfish.hk2.utilities.binding.AbstractBinder; import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.test.JerseyTest; +import org.glassfish.jersey.test.TestProperties; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; @@ -171,7 +172,7 @@ public class ElementServletTest extends JerseyTest { when(userAdmin.getUser(designerUser.getUserId(), false)).thenReturn(designerUser); - String appConfigDir = "src/test/resources/config"; + String appConfigDir = "src/test/resources/config/catalog-be"; ConfigurationSource configurationSource = new FSConfigurationSource(ExternalConfiguration.getChangeListener(), appConfigDir); configurationManager = new ConfigurationManager(configurationSource); @@ -1051,6 +1052,7 @@ public class ElementServletTest extends JerseyTest { @Override protected Application configure() { ApplicationContext context = new AnnotationConfigApplicationContext(SpringConfig.class); + forceSet(TestProperties.CONTAINER_PORT, "0"); return new ResourceConfig(ElementServlet.class) .register(new AbstractBinder() { diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ExceptionHandlerEndpointTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ExceptionHandlerEndpointTest.java index 07435c4e03..34ff686323 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ExceptionHandlerEndpointTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ExceptionHandlerEndpointTest.java @@ -26,6 +26,7 @@ import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.jackson.internal.jackson.jaxrs.json.JacksonJaxbJsonProvider; import org.glassfish.jersey.jackson.internal.jackson.jaxrs.json.JacksonJsonProvider; import org.glassfish.jersey.server.ResourceConfig; +import org.glassfish.jersey.test.TestProperties; import org.junit.Test; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.impl.ComponentsUtils; @@ -62,6 +63,7 @@ public class ExceptionHandlerEndpointTest extends JerseySpringBaseTest { @Override protected ResourceConfig configure() { + forceSet(TestProperties.CONTAINER_PORT, "0"); componentUtils = mock(ComponentsUtils.class); return super.configure(ExceptionHandlerConfig.class) diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/GroupEndpointTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/GroupEndpointTest.java index 742382155a..957fba244e 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/GroupEndpointTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/GroupEndpointTest.java @@ -28,6 +28,7 @@ import org.glassfish.jersey.jackson.internal.jackson.jaxrs.json.JacksonJaxbJsonP import org.glassfish.jersey.jackson.internal.jackson.jaxrs.json.JacksonJsonProvider; import org.glassfish.jersey.logging.LoggingFeature; import org.glassfish.jersey.server.ResourceConfig; +import org.glassfish.jersey.test.TestProperties; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; @@ -141,6 +142,7 @@ public class GroupEndpointTest extends JerseySpringBaseTest { @Override protected ResourceConfig configure() { + forceSet(TestProperties.CONTAINER_PORT, "0"); return super.configure(GroupEndpointTestConfig.class) .register(GroupEndpoint.class) .property(LoggingFeature.LOGGING_FEATURE_LOGGER_LEVEL_SERVER, "WARNING"); diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/GroupTypesEndpointTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/GroupTypesEndpointTest.java index 286c1a0656..00e7768ce8 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/GroupTypesEndpointTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/GroupTypesEndpointTest.java @@ -28,6 +28,7 @@ import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.jackson.internal.jackson.jaxrs.json.JacksonJaxbJsonProvider; import org.glassfish.jersey.jackson.internal.jackson.jaxrs.json.JacksonJsonProvider; import org.glassfish.jersey.server.ResourceConfig; +import org.glassfish.jersey.test.TestProperties; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; @@ -142,6 +143,7 @@ public class GroupTypesEndpointTest extends JerseySpringBaseTest { @Override protected ResourceConfig configure() { + forceSet(TestProperties.CONTAINER_PORT, "0"); return super.configure(GroupTypesTestConfig.class) .register(GroupTypesEndpoint.class); } diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/InputsServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/InputsServletTest.java index 0974bd5dd4..9b8b984e30 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/InputsServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/InputsServletTest.java @@ -25,6 +25,7 @@ import org.glassfish.grizzly.http.util.HttpStatus; import org.glassfish.hk2.utilities.binding.AbstractBinder; import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.test.JerseyTest; +import org.glassfish.jersey.test.TestProperties; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; @@ -168,6 +169,7 @@ public class InputsServletTest extends JerseyTest { InputsServlet inputsServlet = new InputsServlet(userBusinessLogic, inputsBusinessLogic, componentInstanceBL, componentsUtils, servletUtils, resourceImportManager, dataTypeBusinessLogic); + forceSet(TestProperties.CONTAINER_PORT, "0"); ResourceConfig resourceConfig = new ResourceConfig() .register(inputsServlet) .register(new ComponentExceptionMapper(componentsUtils)) diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/JerseySpringBaseTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/JerseySpringBaseTest.java index af5c421078..38eef3c877 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/JerseySpringBaseTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/JerseySpringBaseTest.java @@ -77,6 +77,7 @@ public abstract class JerseySpringBaseTest extends JerseyTest { } protected ResourceConfig configure() { + forceSet(TestProperties.CONTAINER_PORT, "0"); return configure(BaseTestConfig.class); } diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/PolicyServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/PolicyServletTest.java index 1ba2c44a24..4d1b611465 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/PolicyServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/PolicyServletTest.java @@ -27,6 +27,7 @@ import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.jackson.internal.jackson.jaxrs.json.JacksonJaxbJsonProvider; import org.glassfish.jersey.jackson.internal.jackson.jaxrs.json.JacksonJsonProvider; import org.glassfish.jersey.server.ResourceConfig; +import org.glassfish.jersey.test.TestProperties; import org.json.simple.JSONObject; import org.junit.Before; import org.junit.BeforeClass; @@ -489,6 +490,7 @@ public class PolicyServletTest extends JerseySpringBaseTest{ @Override protected ResourceConfig configure() { + forceSet(TestProperties.CONTAINER_PORT, "0"); return super.configure() .register(new PolicyServlet(null, null, componentsUtils, servletUtils, null, businessLogic)); diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/PolicyTypesEndpointTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/PolicyTypesEndpointTest.java index d9f00f4f36..d84ac902fe 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/PolicyTypesEndpointTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/PolicyTypesEndpointTest.java @@ -22,6 +22,7 @@ package org.openecomp.sdc.be.servlets; import org.apache.http.HttpStatus; import org.glassfish.jersey.server.ResourceConfig; +import org.glassfish.jersey.test.TestProperties; import org.junit.Test; import org.openecomp.sdc.be.components.impl.PolicyTypeBusinessLogic; import org.openecomp.sdc.be.components.utils.PolicyTypeBuilder; @@ -51,6 +52,7 @@ public class PolicyTypesEndpointTest extends JerseySpringBaseTest { @Override protected ResourceConfig configure() { + forceSet(TestProperties.CONTAINER_PORT, "0"); policyTypeBusinessLogic = mock(PolicyTypeBusinessLogic.class); componentUtils = mock(ComponentsUtils.class); UserBusinessLogic userBusinessLogic = mock(UserBusinessLogic.class); diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/TypesUploadEndpointTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/TypesUploadEndpointTest.java index 825b4d8883..c649f71f00 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/TypesUploadEndpointTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/TypesUploadEndpointTest.java @@ -33,6 +33,7 @@ import org.glassfish.jersey.media.multipart.MultiPart; import org.glassfish.jersey.media.multipart.MultiPartFeature; import org.glassfish.jersey.media.multipart.file.FileDataBodyPart; import org.glassfish.jersey.server.ResourceConfig; +import org.glassfish.jersey.test.TestProperties; import org.junit.BeforeClass; import org.junit.Test; import org.mockito.Mockito; @@ -129,6 +130,7 @@ public class TypesUploadEndpointTest extends JerseySpringBaseTest { @Override protected ResourceConfig configure() { + forceSet(TestProperties.CONTAINER_PORT, "0"); return super.configure(TypesUploadEndpointTest.TypesUploadTestConfig.class) .register(TypesUploadEndpoint.class) .property(LoggingFeature.LOGGING_FEATURE_LOGGER_LEVEL_SERVER, "WARNING"); diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/TypesUploadServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/TypesUploadServletTest.java index a247bd4b35..5c6b7c9f74 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/TypesUploadServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/TypesUploadServletTest.java @@ -31,6 +31,7 @@ import org.glassfish.jersey.media.multipart.MultiPartFeature; import org.glassfish.jersey.media.multipart.file.FileDataBodyPart; import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.test.JerseyTest; +import org.glassfish.jersey.test.TestProperties; import org.junit.BeforeClass; import org.junit.Test; import org.mockito.Mockito; @@ -123,7 +124,7 @@ public class TypesUploadServletTest extends JerseyTest { protected ResourceConfig configure() { - + forceSet(TestProperties.CONTAINER_PORT, "0"); TypesUploadServlet typesUploadServlet = new TypesUploadServlet(null, null, componentUtils, servletUtils, null, importManager, null, null, null, diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/UserEndpointTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/UserEndpointTest.java index fc18459608..3e83199a4c 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/UserEndpointTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/UserEndpointTest.java @@ -29,6 +29,7 @@ import org.glassfish.jersey.jackson.internal.jackson.jaxrs.json.JacksonJsonProvi import org.glassfish.jersey.logging.LoggingFeature; import org.glassfish.jersey.media.multipart.MultiPartFeature; import org.glassfish.jersey.server.ResourceConfig; +import org.glassfish.jersey.test.TestProperties; import org.janusgraph.graphdb.types.system.EmptyVertex; import org.junit.Before; import org.junit.BeforeClass; @@ -149,6 +150,7 @@ public class UserEndpointTest extends JerseySpringBaseTest { @Override protected ResourceConfig configure() { + forceSet(TestProperties.CONTAINER_PORT, "0"); return super.configure(UserEndpointTest.UserTestConfig.class) .register(UserAdminServlet.class) .property(LoggingFeature.LOGGING_FEATURE_LOGGER_LEVEL_SERVER, "WARNING"); diff --git a/catalog-be/src/test/java/org/openecomp/sdc/cucumber/runners/RunTenantIsolationTest.java b/catalog-be/src/test/java/org/openecomp/sdc/cucumber/runners/RunTenantIsolationTest.java index 0abcf9eb4d..540a2affcf 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/cucumber/runners/RunTenantIsolationTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/cucumber/runners/RunTenantIsolationTest.java @@ -27,7 +27,6 @@ import org.junit.runner.RunWith; import org.openecomp.sdc.be.components.BeConfDependentTest; // TODO - investigate NPE -@Ignore @RunWith(Cucumber.class) @CucumberOptions(features = "classpath:cucumber/tenantIsolation.feature", glue = "org.openecomp.sdc.be.components.distribution.engine") public class RunTenantIsolationTest extends BeConfDependentTest { diff --git a/catalog-be/src/test/resources/cucumber.properties b/catalog-be/src/test/resources/cucumber.properties new file mode 100644 index 0000000000..aa51b352be --- /dev/null +++ b/catalog-be/src/test/resources/cucumber.properties @@ -0,0 +1 @@ +cucumber.publish.quiet=true \ No newline at end of file -- cgit 1.2.3-korg