diff options
author | vasraz <vasyl.razinkov@est.tech> | 2022-10-03 21:36:15 +0100 |
---|---|---|
committer | Michael Morris <michael.morris@est.tech> | 2022-10-04 10:03:39 +0000 |
commit | d073b803991a841ee8fef40aa0c3dd3febbd8e56 (patch) | |
tree | 5b1cda71baf99708fbc4909f7848ea39d5dff613 /catalog-be/src/test | |
parent | 425ebb15f5177f99103198aedc158b5691763fd9 (diff) |
Remove unused code
clean up 'UserBusinessLogic userBusinessLogic'
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech>
Change-Id: I868692b617e2efd4001121d8f2495e73f59c77a7
Issue-ID: SDC-4205
Diffstat (limited to 'catalog-be/src/test')
23 files changed, 922 insertions, 931 deletions
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ServiceImportBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ServiceImportBusinessLogicTest.java index faaa7e3162..f6656693d9 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ServiceImportBusinessLogicTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ServiceImportBusinessLogicTest.java @@ -134,7 +134,7 @@ class ServiceImportBusinessLogicTest extends ServiceImportBussinessLogicBaseTest private final ArtifactDefinition artifactDefinition = mock(ArtifactDefinition.class); private final ResourceImportManager resourceImportManager = mock(ResourceImportManager.class); private final ServletUtils servletUtils = mock(ServletUtils.class); - private final AbstractValidationsServlet servlet = new ArtifactExternalServlet(userBusinessLogic, + private final AbstractValidationsServlet servlet = new ArtifactExternalServlet( componentInstanceBusinessLogic, componentsUtils, servletUtils, resourceImportManager, artifactsBusinessLogic); private final ApplicationDataTypeCache applicationDataTypeCache = mock(ApplicationDataTypeCache.class); private final ArtifactTypeOperation artifactTypeOperation = mock(ArtifactTypeOperation.class); diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/AbstractTemplateServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/AbstractTemplateServletTest.java index 40dd38ad84..87cb31f39b 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/AbstractTemplateServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/AbstractTemplateServletTest.java @@ -244,7 +244,6 @@ class AbstractTemplateServletTest extends JerseyTest { private CrudExternalServlet createMockServlet() { return new CrudExternalServlet( - userBusinessLogic, componentInstanceBusinessLogic, componentsUtils, servletUtils, 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 a2673ea363..d11022a886 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 @@ -222,7 +222,7 @@ class AssetsDataServletTest extends JerseyTest { ApplicationContext context = new AnnotationConfigApplicationContext(SpringConfig.class); forceSet(TestProperties.CONTAINER_PORT, "0"); return new ResourceConfig() - .register(new CrudExternalServlet(userBusinessLogic, componentInstanceBusinessLogic, componentsUtils, + .register(new CrudExternalServlet(componentInstanceBusinessLogic, componentsUtils, servletUtils, resourceImportManager, elementBusinessLogic, assetMetadataConverter, lifecycleBusinessLogic, resourceBusinessLogic, serviceBusinessLogic)) .register(new AbstractBinder() { diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/ExternalRefsServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/ExternalRefsServletTest.java index 6264e349a1..b912891157 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/ExternalRefsServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/externalapi/servlet/ExternalRefsServletTest.java @@ -624,7 +624,7 @@ class ExternalRefsServletTest extends JerseyTest { @Bean ExternalRefsServlet externalRefsServlet() { - return new ExternalRefsServlet(userAdmin, componentUtils, externalRefsBusinessLogic()); + return new ExternalRefsServlet(componentUtils, externalRefsBusinessLogic()); } @Bean diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/AbstractValidationsServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/AbstractValidationsServletTest.java index ecc89af3f8..5e9bf0ebb4 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/AbstractValidationsServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/AbstractValidationsServletTest.java @@ -55,8 +55,8 @@ public class AbstractValidationsServletTest { private static ResourceImportManager resourceImportManager = mock(ResourceImportManager.class); private static ArtifactsBusinessLogic artifactsBusinessLogic = mock(ArtifactsBusinessLogic.class); - private static AbstractValidationsServlet servlet = new ArtifactExternalServlet(userBusinessLogic, - componentInstanceBL, componentsUtils, servletUtils, resourceImportManager, artifactsBusinessLogic); + private static AbstractValidationsServlet servlet = new ArtifactExternalServlet( + componentInstanceBL, componentsUtils, servletUtils, resourceImportManager, artifactsBusinessLogic); private static final String BASIC_TOSCA_TEMPLATE = "tosca_definitions_version: tosca_simple_yaml_%s"; diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/AdditionalInformationServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/AdditionalInformationServletTest.java index edc01e8800..c34fe7411c 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/AdditionalInformationServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/AdditionalInformationServletTest.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -20,178 +20,176 @@ package org.openecomp.sdc.be.servlets; +import static org.mockito.Mockito.mock; + +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.core.Response; import org.junit.Test; import org.openecomp.sdc.be.components.impl.AdditionalInformationBusinessLogic; import org.openecomp.sdc.be.impl.ComponentsUtils; import org.openecomp.sdc.be.user.UserBusinessLogic; -import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.core.Response; -import static org.mockito.Mockito.mock; +public class AdditionalInformationServletTest { + private AdditionalInformationServlet createTestSubject() { + UserBusinessLogic userBusinessLogic = mock(UserBusinessLogic.class); + ComponentsUtils componentsUtils = mock(ComponentsUtils.class); + AdditionalInformationBusinessLogic additionalInformationBusinessLogic = + mock(AdditionalInformationBusinessLogic.class); + return new AdditionalInformationServlet(componentsUtils, + additionalInformationBusinessLogic); + } -public class AdditionalInformationServletTest { - private AdditionalInformationServlet createTestSubject() { - UserBusinessLogic userBusinessLogic = mock(UserBusinessLogic.class); - ComponentsUtils componentsUtils = mock(ComponentsUtils.class); - AdditionalInformationBusinessLogic additionalInformationBusinessLogic = - mock(AdditionalInformationBusinessLogic.class); - return new AdditionalInformationServlet(userBusinessLogic, componentsUtils, - additionalInformationBusinessLogic); - } - - - @Test - public void testCreateResourceAdditionalInformationLabel() throws Exception { - AdditionalInformationServlet testSubject; - String resourceId = ""; - String data = ""; - HttpServletRequest request = null; - String userUserId = ""; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testCreateServiceAdditionalInformationLabel() throws Exception { - AdditionalInformationServlet testSubject; - String serviceId = ""; - String data = ""; - HttpServletRequest request = null; - String userUserId = ""; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testUpdateResourceAdditionalInformationLabel() throws Exception { - AdditionalInformationServlet testSubject; - String resourceId = ""; - String labelId = ""; - String data = ""; - HttpServletRequest request = null; - String userId = ""; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testUpdateServiceAdditionalInformationLabel() throws Exception { - AdditionalInformationServlet testSubject; - String serviceId = ""; - String labelId = ""; - String data = ""; - HttpServletRequest request = null; - String userId = ""; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testUpdateResourceAdditionalInformationLabel_1() throws Exception { - AdditionalInformationServlet testSubject; - String resourceId = ""; - String labelId = ""; - HttpServletRequest request = null; - String userId = ""; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testDeleteServiceAdditionalInformationLabel() throws Exception { - AdditionalInformationServlet testSubject; - String serviceId = ""; - String labelId = ""; - HttpServletRequest request = null; - String userId = ""; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testGetResourceAdditionalInformationLabel() throws Exception { - AdditionalInformationServlet testSubject; - String resourceId = ""; - String labelId = ""; - HttpServletRequest request = null; - String userId = ""; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testGetServiceAdditionalInformationLabel() throws Exception { - AdditionalInformationServlet testSubject; - String serviceId = ""; - String labelId = ""; - HttpServletRequest request = null; - String userId = ""; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testGetAllResourceAdditionalInformationLabel() throws Exception { - AdditionalInformationServlet testSubject; - String resourceId = ""; - HttpServletRequest request = null; - String userId = ""; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testGetAllServiceAdditionalInformationLabel() throws Exception { - AdditionalInformationServlet testSubject; - String serviceId = ""; - HttpServletRequest request = null; - String userId = ""; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - + @Test + public void testCreateResourceAdditionalInformationLabel() throws Exception { + AdditionalInformationServlet testSubject; + String resourceId = ""; + String data = ""; + HttpServletRequest request = null; + String userUserId = ""; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testCreateServiceAdditionalInformationLabel() throws Exception { + AdditionalInformationServlet testSubject; + String serviceId = ""; + String data = ""; + HttpServletRequest request = null; + String userUserId = ""; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testUpdateResourceAdditionalInformationLabel() throws Exception { + AdditionalInformationServlet testSubject; + String resourceId = ""; + String labelId = ""; + String data = ""; + HttpServletRequest request = null; + String userId = ""; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testUpdateServiceAdditionalInformationLabel() throws Exception { + AdditionalInformationServlet testSubject; + String serviceId = ""; + String labelId = ""; + String data = ""; + HttpServletRequest request = null; + String userId = ""; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testUpdateResourceAdditionalInformationLabel_1() throws Exception { + AdditionalInformationServlet testSubject; + String resourceId = ""; + String labelId = ""; + HttpServletRequest request = null; + String userId = ""; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testDeleteServiceAdditionalInformationLabel() throws Exception { + AdditionalInformationServlet testSubject; + String serviceId = ""; + String labelId = ""; + HttpServletRequest request = null; + String userId = ""; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testGetResourceAdditionalInformationLabel() throws Exception { + AdditionalInformationServlet testSubject; + String resourceId = ""; + String labelId = ""; + HttpServletRequest request = null; + String userId = ""; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testGetServiceAdditionalInformationLabel() throws Exception { + AdditionalInformationServlet testSubject; + String serviceId = ""; + String labelId = ""; + HttpServletRequest request = null; + String userId = ""; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testGetAllResourceAdditionalInformationLabel() throws Exception { + AdditionalInformationServlet testSubject; + String resourceId = ""; + HttpServletRequest request = null; + String userId = ""; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testGetAllServiceAdditionalInformationLabel() throws Exception { + AdditionalInformationServlet testSubject; + String serviceId = ""; + HttpServletRequest request = null; + String userId = ""; + Response result; + + // default test + testSubject = createTestSubject(); + + } + } 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 2b870baf62..40461830c6 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 @@ -151,7 +151,7 @@ class ArchiveEndpointTest extends JerseyTest { @Bean ArchiveEndpoint archiveEndpoint() { - return new ArchiveEndpoint(userAdmin, componentUtils, archiveBusinessLogic()); + return new ArchiveEndpoint(componentUtils, archiveBusinessLogic()); } @Bean diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ArtifactServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ArtifactServletTest.java index efa5b51041..5536b5ee21 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ArtifactServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ArtifactServletTest.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -20,346 +20,344 @@ package org.openecomp.sdc.be.servlets; +import static org.mockito.Mockito.mock; + +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.core.Response; import org.junit.Test; import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic; import org.openecomp.sdc.be.impl.ComponentsUtils; import org.openecomp.sdc.be.user.UserBusinessLogic; -import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.core.Response; -import static org.mockito.Mockito.mock; +public class ArtifactServletTest { + private ArtifactServlet createTestSubject() { + UserBusinessLogic userBusinessLogic = mock(UserBusinessLogic.class); + ComponentsUtils componentsUtils = mock(ComponentsUtils.class); + ArtifactsBusinessLogic artifactsBusinessLogic = mock(ArtifactsBusinessLogic.class); + return new ArtifactServlet(componentsUtils, artifactsBusinessLogic); + } -public class ArtifactServletTest { - private ArtifactServlet createTestSubject() { - UserBusinessLogic userBusinessLogic = mock(UserBusinessLogic.class); - ComponentsUtils componentsUtils = mock(ComponentsUtils.class); - ArtifactsBusinessLogic artifactsBusinessLogic = mock(ArtifactsBusinessLogic.class); - return new ArtifactServlet(userBusinessLogic, componentsUtils,artifactsBusinessLogic); - } - - - @Test - public void testLoadArtifact() throws Exception { - ArtifactServlet testSubject; - String resourceId = ""; - String data = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testUpdateArtifact() throws Exception { - ArtifactServlet testSubject; - String resourceId = ""; - String artifactId = ""; - String data = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testDeleteArtifact() throws Exception { - ArtifactServlet testSubject; - String resourceId = ""; - String artifactId = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testLoadInformationArtifact() throws Exception { - ArtifactServlet testSubject; - String serviceId = ""; - String data = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testUpdateInformationArtifact() throws Exception { - ArtifactServlet testSubject; - String serviceId = ""; - String artifactId = ""; - String data = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testUpdateApiArtifact() throws Exception { - ArtifactServlet testSubject; - String serviceId = ""; - String artifactId = ""; - String data = ""; - HttpServletRequest request = null; - String userId = ""; - String origMd5 = ""; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testDeleteApiArtifact() throws Exception { - ArtifactServlet testSubject; - String serviceId = ""; - String artifactId = ""; - HttpServletRequest request = null; - String userId = ""; - String origMd5 = ""; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testDeleteInformationalArtifact() throws Exception { - ArtifactServlet testSubject; - String serviceId = ""; - String artifactId = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testDownloadServiceArtifactBase64() throws Exception { - ArtifactServlet testSubject; - String serviceId = ""; - String artifactId = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testDownloadResourceArtifactBase64() throws Exception { - ArtifactServlet testSubject; - String resourceId = ""; - String artifactId = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testDownloadResourceInstanceArtifactBase64() throws Exception { - ArtifactServlet testSubject; - String containerComponentType = ""; - String componentId = ""; - String componentInstanceId = ""; - String artifactId = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testLoadArtifactToInterface() throws Exception { - ArtifactServlet testSubject; - String resourceId = ""; - String interfaceType = ""; - String operation = ""; - String userId = ""; - String origMd5 = ""; - String data = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testDeleteArtifactToInterface() throws Exception { - ArtifactServlet testSubject; - String resourceId = ""; - String interfaceType = ""; - String operation = ""; - String artifactId = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testUpdateArtifactToInterface() throws Exception { - ArtifactServlet testSubject; - String resourceId = ""; - String interfaceType = ""; - String operation = ""; - String artifactId = ""; - String userId = ""; - String origMd5 = ""; - HttpServletRequest request = null; - String data = ""; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testUpdateRIArtifact() throws Exception { - ArtifactServlet testSubject; - String containerComponentType = ""; - String componentId = ""; - String componentInstanceId = ""; - String artifactId = ""; - String data = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testUpdateComponentInstanceArtifact() throws Exception { - ArtifactServlet testSubject; - String userId = ""; - String origMd5 = ""; - String containerComponentType = ""; - String componentId = ""; - String componentInstanceId = ""; - String artifactId = ""; - String data = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testLoadComponentInstanceArtifact() throws Exception { - ArtifactServlet testSubject; - String userId = ""; - String origMd5 = ""; - String containerComponentType = ""; - String componentId = ""; - String componentInstanceId = ""; - String data = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testDeleteComponentInstanceArtifact() throws Exception { - ArtifactServlet testSubject; - String userId = ""; - String origMd5 = ""; - String containerComponentType = ""; - String componentId = ""; - String componentInstanceId = ""; - String artifactId = ""; - String data = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testGetComponentArtifacts() throws Exception { - ArtifactServlet testSubject; - String containerComponentType = ""; - String componentId = ""; - String artifactGroupType = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testGetComponentInstanceArtifacts() throws Exception { - ArtifactServlet testSubject; - String containerComponentType = ""; - String componentId = ""; - String componentInstanceId = ""; - String artifactGroupType = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - + @Test + public void testLoadArtifact() throws Exception { + ArtifactServlet testSubject; + String resourceId = ""; + String data = ""; + HttpServletRequest request = null; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testUpdateArtifact() throws Exception { + ArtifactServlet testSubject; + String resourceId = ""; + String artifactId = ""; + String data = ""; + HttpServletRequest request = null; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testDeleteArtifact() throws Exception { + ArtifactServlet testSubject; + String resourceId = ""; + String artifactId = ""; + HttpServletRequest request = null; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testLoadInformationArtifact() throws Exception { + ArtifactServlet testSubject; + String serviceId = ""; + String data = ""; + HttpServletRequest request = null; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testUpdateInformationArtifact() throws Exception { + ArtifactServlet testSubject; + String serviceId = ""; + String artifactId = ""; + String data = ""; + HttpServletRequest request = null; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testUpdateApiArtifact() throws Exception { + ArtifactServlet testSubject; + String serviceId = ""; + String artifactId = ""; + String data = ""; + HttpServletRequest request = null; + String userId = ""; + String origMd5 = ""; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testDeleteApiArtifact() throws Exception { + ArtifactServlet testSubject; + String serviceId = ""; + String artifactId = ""; + HttpServletRequest request = null; + String userId = ""; + String origMd5 = ""; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testDeleteInformationalArtifact() throws Exception { + ArtifactServlet testSubject; + String serviceId = ""; + String artifactId = ""; + HttpServletRequest request = null; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testDownloadServiceArtifactBase64() throws Exception { + ArtifactServlet testSubject; + String serviceId = ""; + String artifactId = ""; + HttpServletRequest request = null; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testDownloadResourceArtifactBase64() throws Exception { + ArtifactServlet testSubject; + String resourceId = ""; + String artifactId = ""; + HttpServletRequest request = null; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testDownloadResourceInstanceArtifactBase64() throws Exception { + ArtifactServlet testSubject; + String containerComponentType = ""; + String componentId = ""; + String componentInstanceId = ""; + String artifactId = ""; + HttpServletRequest request = null; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testLoadArtifactToInterface() throws Exception { + ArtifactServlet testSubject; + String resourceId = ""; + String interfaceType = ""; + String operation = ""; + String userId = ""; + String origMd5 = ""; + String data = ""; + HttpServletRequest request = null; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testDeleteArtifactToInterface() throws Exception { + ArtifactServlet testSubject; + String resourceId = ""; + String interfaceType = ""; + String operation = ""; + String artifactId = ""; + HttpServletRequest request = null; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testUpdateArtifactToInterface() throws Exception { + ArtifactServlet testSubject; + String resourceId = ""; + String interfaceType = ""; + String operation = ""; + String artifactId = ""; + String userId = ""; + String origMd5 = ""; + HttpServletRequest request = null; + String data = ""; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testUpdateRIArtifact() throws Exception { + ArtifactServlet testSubject; + String containerComponentType = ""; + String componentId = ""; + String componentInstanceId = ""; + String artifactId = ""; + String data = ""; + HttpServletRequest request = null; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testUpdateComponentInstanceArtifact() throws Exception { + ArtifactServlet testSubject; + String userId = ""; + String origMd5 = ""; + String containerComponentType = ""; + String componentId = ""; + String componentInstanceId = ""; + String artifactId = ""; + String data = ""; + HttpServletRequest request = null; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testLoadComponentInstanceArtifact() throws Exception { + ArtifactServlet testSubject; + String userId = ""; + String origMd5 = ""; + String containerComponentType = ""; + String componentId = ""; + String componentInstanceId = ""; + String data = ""; + HttpServletRequest request = null; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testDeleteComponentInstanceArtifact() throws Exception { + ArtifactServlet testSubject; + String userId = ""; + String origMd5 = ""; + String containerComponentType = ""; + String componentId = ""; + String componentInstanceId = ""; + String artifactId = ""; + String data = ""; + HttpServletRequest request = null; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testGetComponentArtifacts() throws Exception { + ArtifactServlet testSubject; + String containerComponentType = ""; + String componentId = ""; + String artifactGroupType = ""; + HttpServletRequest request = null; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testGetComponentInstanceArtifacts() throws Exception { + ArtifactServlet testSubject; + String containerComponentType = ""; + String componentId = ""; + String componentInstanceId = ""; + String artifactGroupType = ""; + HttpServletRequest request = null; + Response result; + + // default test + testSubject = createTestSubject(); + + } + } diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/AttributeServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/AttributeServletTest.java index 6184fa8d7e..c8a4a0209c 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/AttributeServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/AttributeServletTest.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -20,7 +20,11 @@ package org.openecomp.sdc.be.servlets; +import static org.mockito.Mockito.mock; + import com.google.common.base.Equivalence.Wrapper; +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.core.Response; import org.junit.Test; import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic; import org.openecomp.sdc.be.components.impl.ResourceImportManager; @@ -30,75 +34,70 @@ import org.openecomp.sdc.be.model.PropertyDefinition; import org.openecomp.sdc.be.user.UserBusinessLogic; import org.openecomp.sdc.exception.ResponseFormat; -import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.core.Response; +public class AttributeServletTest { -import static org.mockito.Mockito.mock; + private AttributeServlet createTestSubject() { + UserBusinessLogic userBusinessLogic = mock(UserBusinessLogic.class); + ComponentInstanceBusinessLogic componentInstanceBL = mock(ComponentInstanceBusinessLogic.class); + ComponentsUtils componentsUtils = mock(ComponentsUtils.class); + ServletUtils servletUtils = mock(ServletUtils.class); + ResourceImportManager resourceImportManager = mock(ResourceImportManager.class); -public class AttributeServletTest { + return new AttributeServlet(componentInstanceBL, componentsUtils, servletUtils, + resourceImportManager); + } + + + @Test + public void testCreateAttribute() throws Exception { + AttributeServlet testSubject; + String resourceId = ""; + String data = ""; + HttpServletRequest request = null; + String userId = ""; + Response result; + + // default test + testSubject = createTestSubject(); + } + + + @Test + public void testUpdateAttribute() throws Exception { + AttributeServlet testSubject; + String resourceId = ""; + String attributeId = ""; + String data = ""; + HttpServletRequest request = null; + String userId = ""; + Response result; + + // default test + testSubject = createTestSubject(); + } + + + @Test + public void testDeleteAttribute() throws Exception { + AttributeServlet testSubject; + String resourceId = ""; + String attributeId = ""; + HttpServletRequest request = null; + String userId = ""; + Response result; + + // default test + testSubject = createTestSubject(); + } + + + @Test + public void testBuildAttributeFromString() throws Exception { + AttributeServlet testSubject; + String data = ""; + Wrapper<PropertyDefinition> attributesWrapper = null; + Wrapper<ResponseFormat> errorWrapper = null; - private AttributeServlet createTestSubject() { - UserBusinessLogic userBusinessLogic = mock(UserBusinessLogic.class); - ComponentInstanceBusinessLogic componentInstanceBL = mock(ComponentInstanceBusinessLogic.class); - ComponentsUtils componentsUtils = mock(ComponentsUtils.class); - ServletUtils servletUtils = mock(ServletUtils.class); - ResourceImportManager resourceImportManager = mock(ResourceImportManager.class); - - return new AttributeServlet(userBusinessLogic, componentInstanceBL, componentsUtils, servletUtils, - resourceImportManager); - } - - - @Test - public void testCreateAttribute() throws Exception { - AttributeServlet testSubject; - String resourceId = ""; - String data = ""; - HttpServletRequest request = null; - String userId = ""; - Response result; - - // default test - testSubject = createTestSubject(); - } - - - @Test - public void testUpdateAttribute() throws Exception { - AttributeServlet testSubject; - String resourceId = ""; - String attributeId = ""; - String data = ""; - HttpServletRequest request = null; - String userId = ""; - Response result; - - // default test - testSubject = createTestSubject(); - } - - - @Test - public void testDeleteAttribute() throws Exception { - AttributeServlet testSubject; - String resourceId = ""; - String attributeId = ""; - HttpServletRequest request = null; - String userId = ""; - Response result; - - // default test - testSubject = createTestSubject(); - } - - - @Test - public void testBuildAttributeFromString() throws Exception { - AttributeServlet testSubject;String data = ""; - Wrapper<PropertyDefinition> attributesWrapper = null; - Wrapper<ResponseFormat> errorWrapper = null; - - - // default test - } + // default test + } } diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/AutomatedUpgradeEndpointTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/AutomatedUpgradeEndpointTest.java index 6149d8de7d..ba106798ed 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/AutomatedUpgradeEndpointTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/AutomatedUpgradeEndpointTest.java @@ -124,7 +124,7 @@ class AutomatedUpgradeEndpointTest extends JerseySpringBaseTest { UserBusinessLogic userBusinessLogic = mock(UserBusinessLogic.class); ComponentsUtils componentsUtils = mock(ComponentsUtils.class); - return new AutomatedUpgradeEndpoint(userBusinessLogic, componentsUtils, + return new AutomatedUpgradeEndpoint(componentsUtils, upgradeBusinessLogic()); } diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/CapabilityServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/CapabilityServletTest.java index cda5145ee7..8c025c7e03 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/CapabilityServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/CapabilityServletTest.java @@ -221,7 +221,7 @@ class CapabilityServletTest extends JerseyTest { } private void createTestObject() { - capabilityServlet = new CapabilityServlet(userBusinessLogic, componentInstanceBusinessLogic, + capabilityServlet = new CapabilityServlet(componentInstanceBusinessLogic, componentsUtils, servletUtils, resourceImportManager, capabilitiesBusinessLogic); } 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 2b0ffe91a9..82a5c833d3 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 @@ -75,7 +75,7 @@ class ComponentServletTest extends JerseySpringBaseTest { resourceBusinessLogic = mock(ResourceBusinessLogic.class); UserBusinessLogic userBusinessLogic = mock(UserBusinessLogic.class); ComponentsUtils componentsUtils = mock(ComponentsUtils.class); - ComponentServlet componentServlet = new ComponentServlet(userBusinessLogic, componentsUtils, + ComponentServlet componentServlet = new ComponentServlet(componentsUtils, new ComponentBusinessLogicProvider(resourceBusinessLogic, null, null)); return super.configure().register(componentServlet); } diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/DistributionServiceServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/DistributionServiceServletTest.java index 7a89a6bee5..7c6c8c10f0 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/DistributionServiceServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/DistributionServiceServletTest.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -20,71 +20,70 @@ package org.openecomp.sdc.be.servlets; +import static org.mockito.Mockito.mock; + +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.core.Response; import org.junit.Test; import org.openecomp.sdc.be.components.impl.DistributionMonitoringBusinessLogic; import org.openecomp.sdc.be.impl.ComponentsUtils; import org.openecomp.sdc.be.user.UserBusinessLogic; -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.core.Response; +public class DistributionServiceServletTest { -import static org.mockito.Mockito.mock; + private DistributionServiceServlet createTestSubject() { + UserBusinessLogic userBusinessLogic = mock(UserBusinessLogic.class); + ComponentsUtils componentsUtils = mock(ComponentsUtils.class); + DistributionMonitoringBusinessLogic distributionMonitoringLogic = mock(DistributionMonitoringBusinessLogic.class); + return new DistributionServiceServlet(componentsUtils, + distributionMonitoringLogic); + } -public class DistributionServiceServletTest { - private DistributionServiceServlet createTestSubject() { - UserBusinessLogic userBusinessLogic = mock(UserBusinessLogic.class); - ComponentsUtils componentsUtils = mock(ComponentsUtils.class); - DistributionMonitoringBusinessLogic distributionMonitoringLogic = mock(DistributionMonitoringBusinessLogic.class); - return new DistributionServiceServlet(userBusinessLogic, componentsUtils, - distributionMonitoringLogic); - } - - - @Test - public void testGetServiceById() throws Exception { - DistributionServiceServlet testSubject; - String serviceUUID = ""; - HttpServletRequest request = null; - String userId = ""; - Response result; - - // default test - testSubject = createTestSubject(); - } - - - @Test - public void testGetListOfDistributionStatuses() throws Exception { - DistributionServiceServlet testSubject; - String did = ""; - HttpServletRequest request = null; - String userId = ""; - Response result; - - // default test - testSubject = createTestSubject(); - } - - - @Test - public void testInit() throws Exception { - DistributionServiceServlet testSubject; - HttpServletRequest request = null; - - // default test - testSubject = createTestSubject(); - } - - - @Test - public void testGetDistributionBL() throws Exception { - DistributionServiceServlet testSubject; - ServletContext context = null; - DistributionMonitoringBusinessLogic result; - - // default test - testSubject = createTestSubject(); - } + @Test + public void testGetServiceById() throws Exception { + DistributionServiceServlet testSubject; + String serviceUUID = ""; + HttpServletRequest request = null; + String userId = ""; + Response result; + + // default test + testSubject = createTestSubject(); + } + + + @Test + public void testGetListOfDistributionStatuses() throws Exception { + DistributionServiceServlet testSubject; + String did = ""; + HttpServletRequest request = null; + String userId = ""; + Response result; + + // default test + testSubject = createTestSubject(); + } + + + @Test + public void testInit() throws Exception { + DistributionServiceServlet testSubject; + HttpServletRequest request = null; + + // default test + testSubject = createTestSubject(); + } + + + @Test + public void testGetDistributionBL() throws Exception { + DistributionServiceServlet testSubject; + ServletContext context = null; + DistributionMonitoringBusinessLogic result; + + // default test + testSubject = createTestSubject(); + } } 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 8b58702c08..1ba22695a9 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 @@ -54,7 +54,6 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; import org.openecomp.sdc.be.components.impl.GroupBusinessLogicNew; import org.openecomp.sdc.be.components.validation.AccessValidations; @@ -112,7 +111,7 @@ class GroupEndpointTest extends JerseySpringBaseTest { UserBusinessLogic userBusinessLogic = mock(UserBusinessLogic.class); ComponentsUtils componentsUtils = mock(ComponentsUtils.class); - return new GroupEndpoint(userBusinessLogic, componentsUtils, groupBusinessLogic()); + return new GroupEndpoint(componentsUtils, groupBusinessLogic()); } @Bean @@ -198,9 +197,9 @@ class GroupEndpointTest extends JerseySpringBaseTest { when(groupsOperation .updateGroupPropertiesOnComponent(eq(VALID_COMPONENT_ID), isA(GroupDefinition.class), anyList(), any(PromoteVersionEnum.class))).thenAnswer((Answer<Either>) invocationOnMock -> { - Object[] args = invocationOnMock.getArguments(); - return Either.left(Collections.singletonList(args[2])); - }); + Object[] args = invocationOnMock.getArguments(); + return Either.left(Collections.singletonList(args[2])); + }); } @Test diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/GroupServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/GroupServletTest.java index ddd5a2098d..e50025658a 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/GroupServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/GroupServletTest.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -20,6 +20,10 @@ package org.openecomp.sdc.be.servlets; +import static org.mockito.Mockito.mock; + +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.core.Response; import org.junit.Test; import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic; import org.openecomp.sdc.be.components.impl.GroupBusinessLogic; @@ -28,51 +32,46 @@ import org.openecomp.sdc.be.impl.ComponentsUtils; import org.openecomp.sdc.be.impl.ServletUtils; import org.openecomp.sdc.be.user.UserBusinessLogic; -import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.core.Response; +public class GroupServletTest { -import static org.mockito.Mockito.mock; + private GroupServlet createTestSubject() { + UserBusinessLogic userBusinessLogic = mock(UserBusinessLogic.class); + GroupBusinessLogic groupBL = mock(GroupBusinessLogic.class); + ComponentInstanceBusinessLogic componentInstanceBL = mock(ComponentInstanceBusinessLogic.class); + ComponentsUtils componentsUtils = mock(ComponentsUtils.class); + ServletUtils servletUtils = mock(ServletUtils.class); + ResourceImportManager resourceImportManager = mock(ResourceImportManager.class); + return new GroupServlet(groupBL, componentInstanceBL, componentsUtils, servletUtils, + resourceImportManager); + } -public class GroupServletTest { - private GroupServlet createTestSubject() { - UserBusinessLogic userBusinessLogic = mock(UserBusinessLogic.class); - GroupBusinessLogic groupBL = mock(GroupBusinessLogic.class); - ComponentInstanceBusinessLogic componentInstanceBL = mock(ComponentInstanceBusinessLogic.class); - ComponentsUtils componentsUtils = mock(ComponentsUtils.class); - ServletUtils servletUtils = mock(ServletUtils.class); - ResourceImportManager resourceImportManager = mock(ResourceImportManager.class); - return new GroupServlet(userBusinessLogic, groupBL, componentInstanceBL, componentsUtils, servletUtils, - resourceImportManager); - } + @Test + public void testGetGroupArtifactById() throws Exception { + GroupServlet testSubject; + String containerComponentType = ""; + String componentId = ""; + String groupId = ""; + HttpServletRequest request = null; + String userId = ""; + Response result; - - @Test - public void testGetGroupArtifactById() throws Exception { - GroupServlet testSubject; - String containerComponentType = ""; - String componentId = ""; - String groupId = ""; - HttpServletRequest request = null; - String userId = ""; - Response result; + // default test + } - // default test - } - - @Test - public void testUpdateGroupMetadata() throws Exception { - GroupServlet testSubject; - String containerComponentType = ""; - String componentId = ""; - String groupUniqueId = ""; - String data = ""; - HttpServletRequest request = null; - String userId = ""; - Response result; + @Test + public void testUpdateGroupMetadata() throws Exception { + GroupServlet testSubject; + String containerComponentType = ""; + String componentId = ""; + String groupUniqueId = ""; + String data = ""; + HttpServletRequest request = null; + String userId = ""; + Response result; - // default test - testSubject = createTestSubject(); - } + // default test + testSubject = createTestSubject(); + } } 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 a03f8d42c9..e4407cdcc4 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 @@ -103,7 +103,7 @@ class GroupTypesEndpointTest extends JerseySpringBaseTest { GroupTypesEndpoint groupTypesEndpoint() { UserBusinessLogic userBusinessLogic = mock(UserBusinessLogic.class); ComponentsUtils componentsUtils = mock(ComponentsUtils.class); - return new GroupTypesEndpoint(userBusinessLogic, componentsUtils, groupTypeBusinessLogic()); + return new GroupTypesEndpoint(componentsUtils, groupTypeBusinessLogic()); } @Bean 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 bd20471544..a86d4ca5f5 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 @@ -174,7 +174,7 @@ class InputsServletTest extends JerseyTest { @Override protected Application configure() { - InputsServlet inputsServlet = new InputsServlet(userBusinessLogic, inputsBusinessLogic, + InputsServlet inputsServlet = new InputsServlet(inputsBusinessLogic, componentInstanceBL, componentsUtils, servletUtils, resourceImportManager, dataTypeBusinessLogic); forceSet(TestProperties.CONTAINER_PORT, "0"); diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/OutputsServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/OutputsServletTest.java index 6b0cf70ecb..c678068d51 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/OutputsServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/OutputsServletTest.java @@ -240,7 +240,7 @@ class OutputsServletTest extends JerseyTest { } private OutputsServlet createTestObject() { - return new OutputsServlet(userBusinessLogic, outputsBusinessLogic, componentInstanceBL, componentsUtils, servletUtils, resourceImportManager); + return new OutputsServlet(outputsBusinessLogic, componentInstanceBL, componentsUtils, servletUtils, resourceImportManager); } @Override 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 469a73de58..c0d858a4e7 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 @@ -280,7 +280,8 @@ class PolicyServletTest extends JerseySpringBaseTest { assertThat(response.getStatus()).isEqualTo(Response.Status.FORBIDDEN.getStatusCode()); } - @Test//(expected = ComponentException.class) + @Test +//(expected = ComponentException.class) void getPolicyProperties_unHandledError_returnGeneralError() { when(businessLogic.getPolicyProperties(ComponentTypeEnum.SERVICE, SERVICE_ID, POLICY_ID, USER_ID)) .thenThrow(new RuntimeException()); @@ -515,7 +516,7 @@ class PolicyServletTest extends JerseySpringBaseTest { protected ResourceConfig configure() { forceSet(TestProperties.CONTAINER_PORT, "0"); return super.configure() - .register(new PolicyServlet(null, null, componentsUtils, + .register(new PolicyServlet(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 89d10322ed..5e888e6b69 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 @@ -69,7 +69,7 @@ class PolicyTypesEndpointTest extends JerseySpringBaseTest { UserBusinessLogic userBusinessLogic = mock(UserBusinessLogic.class); ComponentsUtils componentsUtils = mock(ComponentsUtils.class); return super.configure() - .register(new PolicyTypesEndpoint(userBusinessLogic, componentsUtils, policyTypeBusinessLogic)); + .register(new PolicyTypesEndpoint(componentsUtils, policyTypeBusinessLogic)); } @Test diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ResourcesServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ResourcesServletTest.java index 239e7232af..8f4f43fe3f 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ResourcesServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ResourcesServletTest.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -20,8 +20,14 @@ package org.openecomp.sdc.be.servlets; +import static org.mockito.Mockito.mock; + import com.google.common.base.Equivalence.Wrapper; import fj.data.Either; +import java.util.List; +import java.util.Map; +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.core.Response; import org.junit.Test; import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic; import org.openecomp.sdc.be.components.impl.ResourceBusinessLogic; @@ -34,240 +40,233 @@ import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.be.user.UserBusinessLogic; import org.openecomp.sdc.exception.ResponseFormat; -import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.core.Response; -import java.util.List; -import java.util.Map; +public class ResourcesServletTest { -import static org.mockito.Mockito.mock; + private ResourcesServlet createTestSubject() { + UserBusinessLogic userBusinessLogic = mock(UserBusinessLogic.class); + ComponentInstanceBusinessLogic componentInstanceBL = mock(ComponentInstanceBusinessLogic.class); + ResourceBusinessLogic resourceBusinessLogic = mock(ResourceBusinessLogic.class); + ComponentsUtils componentsUtils = mock(ComponentsUtils.class); + ServletUtils servletUtils = mock(ServletUtils.class); + ResourceImportManager resourceImportManager = mock(ResourceImportManager.class); -public class ResourcesServletTest { + return new ResourcesServlet(componentInstanceBL, resourceBusinessLogic, componentsUtils, servletUtils, + resourceImportManager); + } + + + @Test + public void testCreateResource() throws Exception { + ResourcesServlet testSubject; + String data = ""; + HttpServletRequest request = null; + String userId = ""; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testIsUIImport() throws Exception { + ResourcesServlet testSubject; + String data = ""; + boolean result; + + // default test + testSubject = createTestSubject(); + } + + + @Test + public void testPerformUIImport() throws Exception { + ResourcesServlet testSubject; + Wrapper<Response> responseWrapper = null; + String data = ""; + HttpServletRequest request = null; + String userId = ""; + String resourceUniqueId = ""; + + // default test + } + + + @Test + public void testParseToResource() throws Exception { + ResourcesServlet testSubject; + String resourceJson = ""; + User user = null; + Either<Resource, ResponseFormat> result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testParseToLightResource() throws Exception { + ResourcesServlet testSubject; + String resourceJson = ""; + User user = null; + Either<Resource, ResponseFormat> result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testDeleteResource() throws Exception { + ResourcesServlet testSubject; + String resourceId = ""; + HttpServletRequest request = null; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testDeleteResourceByNameAndVersion() throws Exception { + ResourcesServlet testSubject; + String resourceName = ""; + String version = ""; + HttpServletRequest request = null; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testGetResourceById() throws Exception { + ResourcesServlet testSubject; + String resourceId = ""; + HttpServletRequest request = null; + String userId = ""; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testGetResourceByNameAndVersion() throws Exception { + ResourcesServlet testSubject; + String resourceName = ""; + String resourceVersion = ""; + HttpServletRequest request = null; + String userId = ""; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testValidateResourceName() throws Exception { + ResourcesServlet testSubject; + String resourceName = ""; + String resourceType = ""; + HttpServletRequest request = null; + String userId = ""; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testGetCertifiedAbstractResources() throws Exception { + ResourcesServlet testSubject; + HttpServletRequest request = null; + String userId = ""; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testGetCertifiedNotAbstractResources() throws Exception { + ResourcesServlet testSubject; + HttpServletRequest request = null; + String userId = ""; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testUpdateResourceMetadata() throws Exception { + ResourcesServlet testSubject; + String resourceId = ""; + String data = ""; + HttpServletRequest request = null; + String userId = ""; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testUpdateResource() throws Exception { + ResourcesServlet testSubject; + String data = ""; + HttpServletRequest request = null; + String userId = ""; + String resourceId = ""; + Response result; + + // default test + testSubject = createTestSubject(); + + } + + + @Test + public void testConvertMapToList() throws Exception { + Map<String, PropertyDefinition> properties = null; + List<PropertyDefinition> result; + + // test 1 + properties = null; + + } + + + @Test + public void testGetResourceFromCsar() throws Exception { + ResourcesServlet testSubject; + HttpServletRequest request = null; + String userId = ""; + String csarUUID = ""; + Response result; + + // default test + testSubject = createTestSubject(); - private ResourcesServlet createTestSubject() { - UserBusinessLogic userBusinessLogic = mock(UserBusinessLogic.class); - ComponentInstanceBusinessLogic componentInstanceBL = mock(ComponentInstanceBusinessLogic.class); - ResourceBusinessLogic resourceBusinessLogic = mock(ResourceBusinessLogic.class); - ComponentsUtils componentsUtils = mock(ComponentsUtils.class); - ServletUtils servletUtils = mock(ServletUtils.class); - ResourceImportManager resourceImportManager = mock(ResourceImportManager.class); - - return new ResourcesServlet(userBusinessLogic, componentInstanceBL, resourceBusinessLogic, componentsUtils, servletUtils, - resourceImportManager); - } - - - @Test - public void testCreateResource() throws Exception { - ResourcesServlet testSubject; - String data = ""; - HttpServletRequest request = null; - String userId = ""; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testIsUIImport() throws Exception { - ResourcesServlet testSubject; - String data = ""; - boolean result; - - // default test - testSubject = createTestSubject(); - } - - - @Test - public void testPerformUIImport() throws Exception { - ResourcesServlet testSubject;Wrapper<Response> responseWrapper = null; - String data = ""; - HttpServletRequest request = null; - String userId = ""; - String resourceUniqueId = ""; - - - // default test - } - - - @Test - public void testParseToResource() throws Exception { - ResourcesServlet testSubject; - String resourceJson = ""; - User user = null; - Either<Resource, ResponseFormat> result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testParseToLightResource() throws Exception { - ResourcesServlet testSubject; - String resourceJson = ""; - User user = null; - Either<Resource, ResponseFormat> result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testDeleteResource() throws Exception { - ResourcesServlet testSubject; - String resourceId = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testDeleteResourceByNameAndVersion() throws Exception { - ResourcesServlet testSubject; - String resourceName = ""; - String version = ""; - HttpServletRequest request = null; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testGetResourceById() throws Exception { - ResourcesServlet testSubject; - String resourceId = ""; - HttpServletRequest request = null; - String userId = ""; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testGetResourceByNameAndVersion() throws Exception { - ResourcesServlet testSubject; - String resourceName = ""; - String resourceVersion = ""; - HttpServletRequest request = null; - String userId = ""; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testValidateResourceName() throws Exception { - ResourcesServlet testSubject; - String resourceName = ""; - String resourceType = ""; - HttpServletRequest request = null; - String userId = ""; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testGetCertifiedAbstractResources() throws Exception { - ResourcesServlet testSubject; - HttpServletRequest request = null; - String userId = ""; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testGetCertifiedNotAbstractResources() throws Exception { - ResourcesServlet testSubject; - HttpServletRequest request = null; - String userId = ""; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testUpdateResourceMetadata() throws Exception { - ResourcesServlet testSubject; - String resourceId = ""; - String data = ""; - HttpServletRequest request = null; - String userId = ""; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testUpdateResource() throws Exception { - ResourcesServlet testSubject; - String data = ""; - HttpServletRequest request = null; - String userId = ""; - String resourceId = ""; - Response result; - - // default test - testSubject = createTestSubject(); - - } - - - @Test - public void testConvertMapToList() throws Exception { - Map<String, PropertyDefinition> properties = null; - List<PropertyDefinition> result; - - // test 1 - properties = null; - - } - - - @Test - public void testGetResourceFromCsar() throws Exception { - ResourcesServlet testSubject; - HttpServletRequest request = null; - String userId = ""; - String csarUUID = ""; - Response result; - - // default test - testSubject = createTestSubject(); - - } + } } 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 72af772507..039207437b 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 @@ -242,7 +242,7 @@ class TypesUploadEndpointTest extends JerseySpringBaseTest { TypesUploadEndpoint typesUploadEndpoint() { UserBusinessLogic userBusinessLogic = mock(UserBusinessLogic.class); ComponentsUtils componentsUtils = mock(ComponentsUtils.class); - return new TypesUploadEndpoint(userBusinessLogic, componentsUtils, commonImportManager(), + return new TypesUploadEndpoint(componentsUtils, commonImportManager(), annotationTypeOperations(), accessValidations); } 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 ed9b9a4eff..9cc03dc9db 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 @@ -516,7 +516,7 @@ class TypesUploadServletTest extends JerseyTest { MockitoAnnotations.openMocks(this); forceSet(TestProperties.CONTAINER_PORT, "0"); - final TypesUploadServlet typesUploadServlet = new TypesUploadServlet(null, null, componentUtils, + final TypesUploadServlet typesUploadServlet = new TypesUploadServlet(null, componentUtils, servletUtils, null, capabilityTypeImportManager, interfaceLifecycleTypeImportManager, categoriesImportManager, dataTypeImportManager, groupTypeImportManager, policyTypeImportManager, relationshipTypeImportManager, artifactTypeImportManager); |