Update licenses to match approved text; add where missing.
Improve code coverage with additional tests.
Use OParent.
Drop ecomp-portal-BE-common-test entirely; tests merged to ecomp-portal-BE-common.
All code from LF repo branch master_dev_amsterdam_1_3_0
Issue: PORTAL-42, PORTAL-50, PORTAL-90, PORTAL-96
Change-Id: I09d98bbf072411d2efed6fb34f378f7cc8d049ad
Signed-off-by: Christopher Lott (cl778h) <clott@research.att.com>
/.settings
/dmaapbc
/sdk
+/target
WMS_IMG_NAME=portal-wms
# Tag all images with this
-PORTAL_TAG=1.1.0
+PORTAL_TAG=1.3.0
NEXUS_REPO=nexus3.onap.org:10003
# docker-compose for ONAP portal containers: database, microservice, portal apps.
-# Only exposes the portal apps on host network, not the database or WMS.
-# Works in multiple environments; does not pull from a Nexus repository.
# Relies on .env file in current directory.
+# Works in multiple environments; does not pull from a Nexus registry.
+# Exposes the portal apps docker (but not DB nor WMS dockers) on the host network.
+# Images must be pulled from ONAP Nexus registry after logging in like this:
+# docker login -u USER -p PASS nexus3.onap.org:10001
version: '2.0'
services:
- # Available from ONAP Nexus repository:
- # docker login -u USER -p PASS nexus3.onap.org:10001
- # docker pull nexus3.onap.org:10001/onap/cli:1.1-STAGING-latest
cli:
image: onap/cli:${PORTAL_TAG}
environment:
set -x
TIMESTAMP=$(date +%C%y%m%dT%H%M%S)
-export VERSION="1.1.0-SNAPSHOT-${TIMESTAMP}"
+export VERSION="1.3.0-SNAPSHOT-${TIMESTAMP}"
export LATEST="latest"
exec ./os_docker_base.sh
set -x
TIMESTAMP=$(date +%C%y%m%dT%H%M%S)
-export VERSION="1.1.0-STAGING-${TIMESTAMP}"
-export LATEST="1.1-STAGING-latest"
+export VERSION="1.3.0-STAGING-${TIMESTAMP}"
+export LATEST="1.3-STAGING-latest"
exec ./os_docker_base.sh
+++ /dev/null
-/.classpath
-/.project
-/.settings/
-/bin/
-/java/
-/debug/
-/debug/logs/
-/target/
+++ /dev/null
-# ECOMP Portal Web Application Tests
-
-## Overview
-
-This is a Maven project with the ECOMP Portal web application back-end test files
-containing test cases for controllers, interceptors and other Java classes.
-Use Apache Maven to build.
-
-## Release Notes
-
-Version 1.1.0, November 2017
-- Initial release
+++ /dev/null
-my_license=My license
+++ /dev/null
-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.
-See the License for the specific language governing permissions and
-limitations under the License.
+++ /dev/null
-name=my_license
-description=<null>
-licenseURL=<null>
-headerURL=<null>
\ No newline at end of file
+++ /dev/null
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org.onap.portal</groupId>
- <artifactId>ecomp-portal-BE-common-test</artifactId>
- <version>1.3.0-SNAPSHOT</version>
- <packaging>jar</packaging>
- <name>ecompportal-be-common-test</name>
-
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <!-- <skipTests>true</skipTests> -->
- <sonar.exclusions>**.js</sonar.exclusions>
- </properties>
-
- <build>
- <sourceDirectory>src/main/java</sourceDirectory>
- <!-- The war file name carries no version number -->
- <finalName>${project.artifactId}</finalName>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.1</version>
- <configuration>
- <source>1.8</source>
- <target>1.8</target>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-war-plugin</artifactId>
- <version>2.6</version>
- <configuration>
- <skipTests>true</skipTests>
- <failOnMissingWebXml>false</failOnMissingWebXml>
- <archive>
- <manifest>
- <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
- </manifest>
- <manifestEntries>
- <Build-Number>${project.version}.${build.number}</Build-Number>
- <Build-Time>${maven.build.timestamp}</Build-Time>
- </manifestEntries>
- </archive>
- <overlays>
- <!-- specify the order in which these should be applied -->
- <overlay>
- <groupId>org.openecomp.portal</groupId>
- <artifactId>ecompportal-be-common</artifactId>
- </overlay>
- </overlays>
- </configuration>
- </plugin>
- <!-- No deployment step for this project -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-deploy-plugin</artifactId>
- <version>2.8</version>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- </plugins>
-
- <resources>
- <resource>
- <directory>src/test/java</directory>
- <includes>
- <include>**/*Test*.*</include>
- </includes>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- <includes>
- <include>**/**</include>
- </includes>
- </resource>
- </resources>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.11</version>
- </dependency>
- <dependency>
- <groupId>org.powermock</groupId>
- <artifactId>powermock-api-mockito</artifactId>
- <version>1.6.1</version>
- </dependency>
- <dependency>
- <groupId>org.powermock</groupId>
- <artifactId>powermock-core</artifactId>
- <version>1.6.1</version>
- </dependency>
- <dependency>
- <groupId>org.powermock</groupId>
- <artifactId>powermock-module-junit4</artifactId>
- <version>1.6.1</version>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <version>1.8.5</version>
- </dependency>
- <dependency>
- <groupId>org.onap.portal</groupId>
- <artifactId>ecompportal-be-common</artifactId>
- <version>${project.version}</version>
- <type>jar</type>
- <classifier>classes</classifier>
- </dependency>
- </dependencies>
-
-</project>
+++ /dev/null
-package com.openecomp.portalapp.portal.ecomp.test.model;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.ecomp.model.AppCatalogItem;
-
-public class AppCatalogItemTest {
-
- public AppCatalogItem mockAppCatalogItem(){
- AppCatalogItem appCatalogItem = new AppCatalogItem();
-
- appCatalogItem.setAlternateUrl("test");
- appCatalogItem.setMlAppName("test");
-
- return appCatalogItem;
- }
-
- @Test
- public void appCatalogItemTest(){
- AppCatalogItem appCatalogItem = mockAppCatalogItem();
-
- AppCatalogItem appCatalogItem1 = new AppCatalogItem();
- appCatalogItem1.setAlternateUrl("test");
- appCatalogItem1.setMlAppName("test");
-
- assertEquals(appCatalogItem.getAlternateUrl(), appCatalogItem1.getAlternateUrl());
- assertEquals(appCatalogItem.getMlAppName(), appCatalogItem1.getMlAppName());
-
- assertEquals(appCatalogItem.toString(), "AppCatalogItem [id=null, name=null, access=null, select=null, pending=null]");
- assertEquals(appCatalogItem.hashCode(), appCatalogItem1.hashCode());
- assertTrue(appCatalogItem.equals(appCatalogItem1));
-
- }
-}
+++ /dev/null
-package com.openecomp.portalapp.portal.ecomp.test.model;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.ecomp.model.AppCategoryFunctionsItem;
-
-public class AppCategoryFunctionsItemTest {
-
- public AppCategoryFunctionsItem mockAppCategoryFunctionsItem(){
- AppCategoryFunctionsItem appCategoryFunctionsItem = new AppCategoryFunctionsItem();
-
- appCategoryFunctionsItem.setRowId("test");
- appCategoryFunctionsItem.setAppId("test");
- appCategoryFunctionsItem.setApplication("test");
- appCategoryFunctionsItem.setFunctions("test");
-
- return appCategoryFunctionsItem;
- }
-
- @Test
- public void appCategoryFunctionsItemTest(){
- AppCategoryFunctionsItem appCategoryFunctionsItem = mockAppCategoryFunctionsItem();
-
- AppCategoryFunctionsItem appCategoryFunctionsItem1 = new AppCategoryFunctionsItem();
-
- appCategoryFunctionsItem1.setRowId("test");
- appCategoryFunctionsItem1.setAppId("test");
- appCategoryFunctionsItem1.setApplication("test");
- appCategoryFunctionsItem1.setFunctions("test");
-
- assertEquals(appCategoryFunctionsItem.getRowId(), appCategoryFunctionsItem1.getRowId());
- assertEquals(appCategoryFunctionsItem.getAppId(), appCategoryFunctionsItem1.getAppId());
- assertEquals(appCategoryFunctionsItem.getApplication(), appCategoryFunctionsItem1.getApplication());
- assertEquals(appCategoryFunctionsItem.getFunctions(), appCategoryFunctionsItem1.getFunctions());
- assertEquals(appCategoryFunctionsItem.toString(), "AppCategoryFunctionsItem [rowId=test, appId=test, application=test, category=null, functions=test]");
- assertEquals(appCategoryFunctionsItem.hashCode(), appCategoryFunctionsItem1.hashCode());
- assertTrue(appCategoryFunctionsItem.equals(appCategoryFunctionsItem1));
-
- }
-}
+++ /dev/null
-package com.openecomp.portalapp.portal.ecomp.test.model;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.ecomp.model.AppContactUsItem;
-
-public class AppContactUsItemTest {
-
- public AppContactUsItem mockAppContactUsItem(){
- AppContactUsItem appContactUsItem = new AppContactUsItem();
-
- appContactUsItem.setAppId((long)1);
- appContactUsItem.setAppName("test");
- appContactUsItem.setDescription("test");
- appContactUsItem.setContactName("test");
- appContactUsItem.setContactEmail("test");
- appContactUsItem.setUrl("test");
- appContactUsItem.setActiveYN("test");
-
- return appContactUsItem;
- }
-
- @Test
- public void appContactUsItemTest(){
- AppContactUsItem appContactUsItem = mockAppContactUsItem();
-
- AppContactUsItem appContactUsItem1 = new AppContactUsItem();
- appContactUsItem1.setAppId((long)1);
- appContactUsItem1.setAppName("test");
- appContactUsItem1.setDescription("test");
- appContactUsItem1.setContactName("test");
- appContactUsItem1.setContactEmail("test");
- appContactUsItem1.setUrl("test");
- appContactUsItem1.setActiveYN("test");
-
- assertEquals(appContactUsItem.getAppId(), appContactUsItem1.getAppId());
- assertEquals(appContactUsItem.getAppName(), appContactUsItem1.getAppName());
- assertEquals(appContactUsItem.getDescription(), appContactUsItem1.getDescription());
- assertEquals(appContactUsItem.getContactName(), appContactUsItem1.getContactName());
- assertEquals(appContactUsItem.getContactEmail(), appContactUsItem1.getContactEmail());
- assertEquals(appContactUsItem.getUrl(), appContactUsItem1.getUrl());
- assertEquals(appContactUsItem.getActiveYN(), appContactUsItem1.getActiveYN());
- assertEquals(appContactUsItem.toString(), "AppContactUsItem [appId=1, appName=test, description=test, contactName=test, contactEmail=test, url=test, activeYN=test]");
- assertEquals(appContactUsItem.hashCode(), appContactUsItem1.hashCode());
- assertTrue(appContactUsItem.equals(appContactUsItem1));
- }
-}
+++ /dev/null
-package com.openecomp.portalapp.portal.ecomp.test.model;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.ecomp.model.SearchResultItem;
-
-public class SearchResultItemTest {
-
- public SearchResultItem mockSearchResultItem(){
- SearchResultItem searchResultItem = new SearchResultItem();
-
- searchResultItem.setRowId("test");
- searchResultItem.setCategory("test");
- searchResultItem.setName("test");
- searchResultItem.setTarget("test");
- searchResultItem.setUuid("test");
-
- return searchResultItem;
- }
-
- @Test
- public void searchResultItemTest(){
- SearchResultItem searchResultItem = mockSearchResultItem();
-
- SearchResultItem searchResultItem1 = new SearchResultItem();
- searchResultItem1.setRowId("test");
- searchResultItem1.setCategory("test");
- searchResultItem1.setName("test");
- searchResultItem1.setTarget("test");
- searchResultItem1.setUuid("test");
-
- assertEquals(searchResultItem.getRowId(), searchResultItem.getRowId());
- assertEquals(searchResultItem.getCategory(), searchResultItem.getCategory());
- assertEquals(searchResultItem.getName(), searchResultItem.getName());
- assertEquals(searchResultItem.getTarget(), searchResultItem.getTarget());
- assertEquals(searchResultItem.getUuid(), searchResultItem.getUuid());
- assertEquals(searchResultItem.toString(), searchResultItem.toString());
-
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.lm;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.Date;
-
-import org.junit.Test;
-
-public class FusionLicenseManagerImplTest {
-
-
- @Test
- public void FusionLicenseManagerImplTest(){
- FusionLicenseManagerImpl fusionLicenseManagerImpl = new FusionLicenseManagerImpl();
-
- String nvlReturn = null;
-
- int installLicenseInt = fusionLicenseManagerImpl.installLicense();
- nvlReturn = fusionLicenseManagerImpl.nvl("test");
- Date expiredDateReturn = fusionLicenseManagerImpl.getExpiredDate();
-
- assertEquals(installLicenseInt, 0);
- assertEquals(nvlReturn, null);
- assertEquals(expiredDateReturn, null);
-
- }
-
-}
+++ /dev/null
-package org.openecomp.portalapp.lm;
-
-import static org.junit.Assert.assertEquals;
-
-import java.io.FileNotFoundException;
-
-import org.junit.Test;
-
-public class LicenseableClassImplTest {
-
- @Test
- public void licenseableClassImplTest() throws FileNotFoundException{
- LicenseableClassImpl licenseableClassImpl = new LicenseableClassImpl();
-
- String appNameReturn = licenseableClassImpl.getApplicationName();
- java.io.InputStream inputStream = licenseableClassImpl.getPublicKeystoreAsInputStream();
- String aliasReturn = licenseableClassImpl.getAlias();
- String pswdReturn = licenseableClassImpl.getKeyPasswd();
- String pkPswd = licenseableClassImpl.getPublicKeystorePassword();
- String cpPswd = licenseableClassImpl.getCipherParamPassword();
-
- assertEquals(appNameReturn, "");
- assertEquals(inputStream, null);
- assertEquals(aliasReturn, "");
- assertEquals(pswdReturn, "");
- assertEquals(pkPswd, "");
- assertEquals(cpPswd, "");
-
- }
-}
+++ /dev/null
-/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ================================================================================
- */
-package org.openecomp.portalapp.portal.test.controller;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.controller.AppCatalogController;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.ecomp.model.AppCatalogItem;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.AdminRolesServiceImpl;
-import org.openecomp.portalapp.portal.service.EPAppCommonServiceImpl;
-import org.openecomp.portalapp.portal.service.EPAppService;
-import org.openecomp.portalapp.portal.service.PersUserAppService;
-import org.openecomp.portalapp.portal.service.PersUserAppServiceImpl;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
-import org.openecomp.portalapp.portal.transport.AppCatalogPersonalization;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.FieldsValidator.FieldName;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-
-public class AppCatalogControllerTest extends MockitoTestSuite {
-
- @Mock
- AdminRolesService adminRolesService = new AdminRolesServiceImpl();
-
- @Mock
- EPAppService appService = new EPAppCommonServiceImpl();
-
- @InjectMocks
- AppCatalogController appCatalogController = new AppCatalogController();
-
- PersUserAppService persUserAppService = Mockito.spy(new PersUserAppServiceImpl());
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-
- @Mock
- EPUserUtils ePUserUtils = new EPUserUtils();
-
- @Mock
- EPUser epuser;
-
- NullPointerException nullPointerException = new NullPointerException();
-
- MockEPUser mockUser = new MockEPUser();
-
- public AppCatalogItem mockAppCatalogItem() {
- AppCatalogItem appCatalogItem = new AppCatalogItem();
- appCatalogItem.setId((long) 1);
- appCatalogItem.setName("Ecomp Portal");
- appCatalogItem.setImageUrl("Test_URL");
- appCatalogItem.setDescription("Testing");
- appCatalogItem.setNotes("Test");
- appCatalogItem.setUrl("test");
- appCatalogItem.setAlternateUrl("test");
- appCatalogItem.setRestricted(false);
- appCatalogItem.setOpen(false);
- appCatalogItem.setAccess(true);
- appCatalogItem.setSelect(true);
- appCatalogItem.setPending(false);
-
- return appCatalogItem;
- }
-
- @Test
- public void getAppCatalogTestIfUserNotAdmin() throws IOException {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- List<AppCatalogItem> actualAppCatalogList = null;
-
- List<AppCatalogItem> expectedAppCatalog = new ArrayList<>();
-
- AppCatalogItem appCatalogItem = mockAppCatalogItem();
- expectedAppCatalog.add(appCatalogItem);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
- Mockito.when(appService.getUserAppCatalog(user)).thenReturn(expectedAppCatalog);
- actualAppCatalogList = appCatalogController.getAppCatalog(mockedRequest, mockedResponse);
-
- assertTrue(actualAppCatalogList.contains(appCatalogItem));
-
- }
-
- @Test
- public void getAppCatalogTestIfUserIsAdmin() throws IOException {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- List<AppCatalogItem> actualAppCatalogList = null;
-
- List<AppCatalogItem> expectedAppCatalog = new ArrayList<>();
-
- AppCatalogItem appCatalogItem = mockAppCatalogItem();
-
- expectedAppCatalog.add(appCatalogItem);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(appService.getAdminAppCatalog(user)).thenReturn(expectedAppCatalog);
- actualAppCatalogList = appCatalogController.getAppCatalog(mockedRequest, mockedResponse);
-
- assertTrue(actualAppCatalogList.contains(appCatalogItem));
-
- }
-
- @Test
- public void getAppCatalogTestIfUserisNull() throws IOException {
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(null);
- List<AppCatalogItem> actualAppCatalogList = new ArrayList<>();
- ;
- actualAppCatalogList = appCatalogController.getAppCatalog(mockedRequest, mockedResponse);
- assertNull(actualAppCatalogList);
-
- }
-
- @Test
- public void getAppCatalogTestIfUserThrowsExceptionTest() throws IOException {
- EPUser user = new EPUser();
- user.setFirstName("test");
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- List<AppCatalogItem> actualAppCatalogList = new ArrayList<>();
- ;
-
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-
- Mockito.when(appCatalogController.getAppCatalog(mockedRequest, mockedResponse)).thenThrow(nullPointerException);
-
- actualAppCatalogList = appCatalogController.getAppCatalog(mockedRequest, mockedResponse);
- assertNull(actualAppCatalogList);
-
- }
-
- @Test
- public void putAppCatalogSelectionTestWhenAppIsNull() throws IOException {
-
- AppCatalogPersonalization persRequest = new AppCatalogPersonalization();
- persRequest.setAppId((long) 1);
- persRequest.setPending(false);
- persRequest.setSelect(false);
-
- EPUser user = mockUser.mockEPUser();
-
- FieldsValidator expectedFieldValidator = new FieldsValidator();
-
- FieldsValidator actualFieldValidator = new FieldsValidator();
- List<FieldName> fields = new ArrayList<>();
- ;
-
- expectedFieldValidator.setHttpStatusCode((long) 200);
- expectedFieldValidator.setFields(fields);
- expectedFieldValidator.setErrorCode(null);
-
- EPApp app = null;
-
- Mockito.when(appService.getApp(persRequest.getAppId())).thenReturn(app);
-
- HttpSession session = mockedRequest.getSession();
- session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
-
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- actualFieldValidator = appCatalogController.putAppCatalogSelection(mockedRequest, persRequest, mockedResponse);
- assertEquals(expectedFieldValidator, actualFieldValidator);
-
- }
-
- @Test
- public void putAppCatalogSelectionTest() throws IOException {
-
- AppCatalogPersonalization persRequest = new AppCatalogPersonalization();
- persRequest.setAppId((long) 1);
- persRequest.setPending(false);
- persRequest.setSelect(false);
-
- EPUser user = mockUser.mockEPUser();
-
- FieldsValidator expectedFieldValidator = new FieldsValidator();
-
- FieldsValidator actualFieldValidator = new FieldsValidator();
- List<FieldName> fields = new ArrayList<>();
- ;
-
- expectedFieldValidator.setHttpStatusCode((long) 200);
- expectedFieldValidator.setFields(fields);
- expectedFieldValidator.setErrorCode(null);
-
- EPApp app = new EPApp();
-
- app.setName("Test");
- app.setImageUrl("test");
- app.setDescription("test");
- app.setNotes("test");
- app.setUrl("test");
- app.setId((long) 1);
- app.setAppRestEndpoint("test");
- app.setAlternateUrl("test");
- app.setName("test");
- app.setMlAppName("test");
- app.setMlAppAdminId("test");
- app.setUsername("test");
- app.setAppPassword("test");
- app.setOpen(false);
- app.setEnabled(false);
- app.setUebKey("test");
- app.setUebSecret("test");
- app.setUebTopicName("test");
- app.setAppType(1);
-
- Mockito.when(appService.getApp(persRequest.getAppId())).thenReturn(app);
-
- HttpSession session = mockedRequest.getSession();
- session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
-
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.doNothing().when(persUserAppService).setPersUserAppValue(user, app, persRequest.getSelect(),
- persRequest.getPending());
-
- actualFieldValidator = appCatalogController.putAppCatalogSelection(mockedRequest, persRequest, mockedResponse);
-
- assertEquals(expectedFieldValidator, actualFieldValidator);
-
- }
-
-}
+++ /dev/null
-/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ================================================================================
- */
-package org.openecomp.portalapp.portal.test.controller;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.controller.AppContactUsController;
-import org.openecomp.portalapp.portal.ecomp.model.AppCategoryFunctionsItem;
-import org.openecomp.portalapp.portal.ecomp.model.AppContactUsItem;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.service.AppContactUsService;
-import org.openecomp.portalapp.portal.service.AppContactUsServiceImpl;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.openecomp.portalapp.util.EPUserUtils;
-
-public class AppContactUsControllerTest extends MockitoTestSuite{
-
- @Mock
- AppContactUsService contactUsService = new AppContactUsServiceImpl();
-
- @InjectMocks
- AppContactUsController appContactUsController = new AppContactUsController();
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
- NullPointerException nullPointerException = new NullPointerException();
-
- @Mock
- EPUserUtils ePUserUtils = new EPUserUtils();
-
- public List<AppContactUsItem> mockResponse() {
- List<AppContactUsItem> appContactUsItemList = new ArrayList<AppContactUsItem>();
- AppContactUsItem appContactUsItem = new AppContactUsItem();
- appContactUsItem.setAppId((long) 1);
- appContactUsItem.setAppName("ECOMP Portal");
- appContactUsItem.setDescription("Test");
- appContactUsItem.setContactName("Test");
- appContactUsItem.setContactEmail("person@onap.org");
- appContactUsItem.setUrl("Test_URL");
- appContactUsItem.setActiveYN("Y");
- appContactUsItemList.add(appContactUsItem);
-
- return appContactUsItemList;
-
- }
-
- public PortalRestResponse<List<AppContactUsItem>> successPortalRestResponse() {
- PortalRestResponse<List<AppContactUsItem>> expectedportalRestResponse = new PortalRestResponse<List<AppContactUsItem>>();
- List<AppContactUsItem> appContactUsItemList = mockResponse();
- expectedportalRestResponse.setMessage("success");
- expectedportalRestResponse.setResponse(appContactUsItemList);
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.OK);
- return expectedportalRestResponse;
-
- }
-
- public PortalRestResponse<List<AppContactUsItem>> exceptionPortalRestResponse() {
- PortalRestResponse<List<AppContactUsItem>> expectedportalRestResponse = new PortalRestResponse<List<AppContactUsItem>>();
- expectedportalRestResponse.setMessage(null);
- expectedportalRestResponse.setResponse(null);
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
- return expectedportalRestResponse;
-
- }
-
- @Test
- public void getAppContactUsList() throws Exception {
- PortalRestResponse<List<AppContactUsItem>> expectedportalRestResponse = successPortalRestResponse();
- List<AppContactUsItem> appContactUsItemList = mockResponse();
- PortalRestResponse<List<AppContactUsItem>> actualPortalRestResponse = new PortalRestResponse<List<AppContactUsItem>>();
- Mockito.when(contactUsService.getAppContactUs()).thenReturn(appContactUsItemList);
- actualPortalRestResponse = appContactUsController.getAppContactUsList(mockedRequest);
- assertEquals(actualPortalRestResponse, expectedportalRestResponse);
- }
-
- @Test
- public void getAppContactUsListCatchesExeptionTest() throws Exception {
-
- PortalRestResponse<List<AppContactUsItem>> expectedportalRestResponse = exceptionPortalRestResponse();
- PortalRestResponse<List<AppContactUsItem>> actualPortalRestResponse = new PortalRestResponse<List<AppContactUsItem>>();
- Mockito.when(contactUsService.getAppContactUs()).thenThrow(nullPointerException);
- actualPortalRestResponse = appContactUsController.getAppContactUsList(mockedRequest);
- assertEquals(actualPortalRestResponse, expectedportalRestResponse);
- }
-
- @Test
- public void getAppsAndContactsTest() throws Exception {
- PortalRestResponse<List<AppContactUsItem>> expectedportalRestResponse = successPortalRestResponse();
- List<AppContactUsItem> appContactUsItemList = mockResponse();
- PortalRestResponse<List<AppContactUsItem>> actualPortalRestResponse = new PortalRestResponse<List<AppContactUsItem>>();
- Mockito.when(contactUsService.getAppsAndContacts()).thenReturn(appContactUsItemList);
- actualPortalRestResponse = appContactUsController.getAppsAndContacts(mockedRequest);
- assertEquals(actualPortalRestResponse, expectedportalRestResponse);
-
- }
-
- @Test
- public void getAppsAndContactsCatchesExceptionTest() throws Exception {
- PortalRestResponse<List<AppContactUsItem>> expectedportalRestResponse = exceptionPortalRestResponse();
- PortalRestResponse<List<AppContactUsItem>> actualPortalRestResponse = new PortalRestResponse<List<AppContactUsItem>>();
- Mockito.when(contactUsService.getAppsAndContacts()).thenThrow(nullPointerException);
- actualPortalRestResponse = appContactUsController.getAppsAndContacts(mockedRequest);
- assertEquals(actualPortalRestResponse, expectedportalRestResponse);
-
- }
-
- @Test
- public void getAppCategoryFunctionsTest() throws Exception {
- PortalRestResponse<List<AppCategoryFunctionsItem>> actualportalRestResponse = null;
-
- List<AppCategoryFunctionsItem> contents = new ArrayList<AppCategoryFunctionsItem>();
-
- AppCategoryFunctionsItem appCategoryFunctionsItem = new AppCategoryFunctionsItem();
- AppCategoryFunctionsItem appCategoryFunctionsItem1 = new AppCategoryFunctionsItem();
-
- appCategoryFunctionsItem.setRowId("1");
- appCategoryFunctionsItem.setAppId("1");
- appCategoryFunctionsItem.setApplication("Ecomp-portal");
- appCategoryFunctionsItem.setCategory("test");
- appCategoryFunctionsItem.setFunctions("test");
-
- appCategoryFunctionsItem1.setRowId("2");
- appCategoryFunctionsItem1.setAppId("2");
- appCategoryFunctionsItem1.setApplication("Ecomp-portal-test");
- appCategoryFunctionsItem1.setCategory("test");
- appCategoryFunctionsItem1.setFunctions("test");
- contents.add(appCategoryFunctionsItem);
- contents.add(appCategoryFunctionsItem1);
-
- PortalRestResponse<List<AppCategoryFunctionsItem>> expectedportalRestResponse = new PortalRestResponse<List<AppCategoryFunctionsItem>>();
- expectedportalRestResponse.setMessage("success");
- expectedportalRestResponse.setResponse(contents);
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.OK);
-
- Mockito.when(contactUsService.getAppCategoryFunctions()).thenReturn(contents);
- actualportalRestResponse = appContactUsController.getAppCategoryFunctions(mockedRequest);
- assertEquals(actualportalRestResponse, expectedportalRestResponse);
-
- }
-
- @Test
- public void getAppCategoryFunctionsCatchesExceptionTest() throws Exception {
- PortalRestResponse<List<AppCategoryFunctionsItem>> actualportalRestResponse = null;
- PortalRestResponse<List<AppContactUsItem>> expectedportalRestResponse = exceptionPortalRestResponse();
- Mockito.when(contactUsService.getAppCategoryFunctions()).thenThrow(nullPointerException);
- actualportalRestResponse = appContactUsController.getAppCategoryFunctions(mockedRequest);
- assertEquals(actualportalRestResponse, expectedportalRestResponse);
-
- }
-
- @Test
- public void saveTest() throws Exception {
- PortalRestResponse<String> actualSaveAppContactUS = null;
-
- AppContactUsItem contactUs = new AppContactUsItem();
- contactUs.setAppId((long) 1);
- contactUs.setAppName("Ecomp Portal");
- contactUs.setDescription("Test");
- contactUs.setContactName("Test");
- contactUs.setContactEmail("person@onap.org");
- contactUs.setUrl("Test_URL");
- contactUs.setActiveYN("Y");
-
- Mockito.when(contactUsService.saveAppContactUs(contactUs)).thenReturn("SUCCESS");
- actualSaveAppContactUS = appContactUsController.save(contactUs);
- assertEquals(actualSaveAppContactUS.getMessage(), "SUCCESS");
- }
-
- @Test
- public void saveExceptionTest() throws Exception {
- PortalRestResponse<String> actualSaveAppContactUS = null;
-
- AppContactUsItem contactUs = new AppContactUsItem();
- contactUs.setAppId((long) 1);
- contactUs.setAppName("Ecomp Portal");
- contactUs.setDescription("Test");
- contactUs.setContactName("Test");
- contactUs.setContactEmail("person@onap.org");
- contactUs.setUrl("Test_URL");
- contactUs.setActiveYN("Y");
-
- Mockito.when(contactUsService.saveAppContactUs(contactUs)).thenThrow(new Exception());
- actualSaveAppContactUS = appContactUsController.save(contactUs);
- assertEquals(actualSaveAppContactUS.getMessage(), "failure");
- }
-
- @Test
- public void saveWhenAppContactUsItemNullTest() throws Exception {
- PortalRestResponse<String> actualSaveAppContactUS = null;
- AppContactUsItem contactUs = null;
- actualSaveAppContactUS = appContactUsController.save(contactUs);
- assertEquals(actualSaveAppContactUS.getMessage(), "failure");
-
- }
-
- @Test
- public void saveAllTest() throws Exception {
-
- List<AppContactUsItem> contactUs = mockResponse();
- PortalRestResponse<String> actualSaveAppContactUS = null;
- Mockito.when(contactUsService.saveAppContactUs(contactUs)).thenReturn("SUCCESS");
- actualSaveAppContactUS = appContactUsController.save(contactUs);
- assertEquals(actualSaveAppContactUS.getMessage(), "SUCCESS");
- }
-
- @Test
- public void saveAllExceptionTest() throws Exception {
-
- List<AppContactUsItem> contactUs = mockResponse();
- PortalRestResponse<String> actualSaveAppContactUS = null;
- Mockito.when(contactUsService.saveAppContactUs(contactUs)).thenThrow(new Exception());
- actualSaveAppContactUS = appContactUsController.save(contactUs);
- assertEquals(actualSaveAppContactUS.getMessage(), "failure");
- }
-
- @Test
- public void deleteTest() throws Exception {
-
- PortalRestResponse<String> actualSaveAppContactUS = null;
- Long id = (long) 1;
- String saveAppContactUs = "SUCCESS";
- Mockito.when(contactUsService.deleteContactUs(id)).thenReturn(saveAppContactUs);
- actualSaveAppContactUS = appContactUsController.delete(id);
- assertEquals(actualSaveAppContactUS.getMessage(), "SUCCESS");
- }
-
- @Test
- public void deleteExceptionTest() throws Exception {
-
- PortalRestResponse<String> actualSaveAppContactUS = null;
- Long id = (long) 1;
- Mockito.when(contactUsService.deleteContactUs(id)).thenThrow(new Exception());
- actualSaveAppContactUS = appContactUsController.delete(id);
- assertEquals(actualSaveAppContactUS.getMessage(), "failure");
- }
-
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.controller;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.controller.AppsControllerExternalRequest;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.EPAppService;
-import org.openecomp.portalapp.portal.service.PortalAdminService;
-import org.openecomp.portalapp.portal.service.UserService;
-import org.openecomp.portalapp.portal.service.UserServiceImpl;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.OnboardingApp;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.openecomp.portalapp.util.EPUserUtils;
-
-public class AppsControllerExternalRequestTest extends MockitoTestSuite {
-
- @Mock
- AdminRolesService adminRolesService;
-
- @Mock
- EPAppService appService;
-
- @Mock
- PortalAdminService portalAdminService;
-
- @Mock
- UserService userService = new UserServiceImpl();
-
- @InjectMocks
- AppsControllerExternalRequest appsControllerExternalRequest = new AppsControllerExternalRequest();
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
- NullPointerException nullPointerException = new NullPointerException();
-
- MockEPUser mockUser = new MockEPUser();
- @Mock
- EPUserUtils ePUserUtils = new EPUserUtils();
-
- @Test
- public void postPortalAdminIfUSerNullTest() {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("Missing required field: email, loginId, or loginPwd");
- expectedportalRestResponse.setResponse(null);
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
- EPUser user = mockUser.mockEPUser();
- user.setEmail("guestT@test.portal.onap.org");
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
- .postPortalAdmin(mockedRequest, mockedResponse, user);
- assertEquals(actualPortalRestResponse, expectedportalRestResponse);
- }
-
- @Test
- public void postPortalAdminTest() {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("java.lang.NullPointerException");
- expectedportalRestResponse.setResponse(null);
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
- EPUser user = mockUser.mockEPUser();
- user.setEmail("guestT@test.portal.onap.org");
- user.setLoginPwd("pwd");
- user.setLoginId("Test");
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(userService.getUserByUserId(user.getOrgUserId())).thenThrow(nullPointerException);
- PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
- .postPortalAdmin(mockedRequest, mockedResponse, user);
- assertEquals(actualPortalRestResponse, expectedportalRestResponse);
- }
-
- @Test
- public void postPortalAdminCreateUserIfNotFoundTest() throws Exception {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage(null);
- expectedportalRestResponse.setResponse(null);
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
- EPUser user = mockUser.mockEPUser();
- user.setEmail("guestT@test.portal.onap.org");
- user.setLoginPwd("pwd");
- user.setLoginId("Test");
- List<EPUser> expectedList = null;
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(userService.getUserByUserId(user.getOrgUserId())).thenReturn(expectedList);
- Mockito.when(userService.saveNewUser(user, "Yes")).thenReturn(null);
- PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
- .postPortalAdmin(mockedRequest, mockedResponse, user);
- assertEquals(actualPortalRestResponse, expectedportalRestResponse);
- }
-
- @Test
- public void postPortalAdminCreateUserIfFoundTest() throws Exception {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage(null);
- expectedportalRestResponse.setResponse(null);
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.OK);
- EPUser user = mockUser.mockEPUser();
- user.setEmail("guestT@test.portal.onap.org");
- user.setLoginPwd("pwd");
- user.setLoginId("Test");
- List<EPUser> expectedList = new ArrayList<EPUser>();
- expectedList.add(user);
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(userService.getUserByUserId(user.getOrgUserId())).thenReturn(expectedList);
- Mockito.when(userService.saveNewUser(user, "Yes")).thenReturn(null);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
- .postPortalAdmin(mockedRequest, mockedResponse, user);
- assertEquals(actualPortalRestResponse, expectedportalRestResponse);
- }
-
- @Test
- public void postPortalAdminCreateUserIfNotSuperAdminTest() throws Exception {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage(null);
- expectedportalRestResponse.setResponse(null);
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.OK);
- EPUser user = mockUser.mockEPUser();
- user.setEmail("guestT@test.portal.onap.org");
- user.setLoginPwd("pwd");
- user.setLoginId("Test");
- List<EPUser> expectedList = new ArrayList<EPUser>();
- expectedList.add(user);
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(userService.getUserByUserId(user.getOrgUserId())).thenReturn(expectedList);
- Mockito.when(userService.saveNewUser(user, "Yes")).thenReturn(null);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-
- FieldsValidator expectedFieldValidator = new FieldsValidator();
- expectedFieldValidator.setHttpStatusCode((long) 200);
- expectedFieldValidator.setFields(null);
- expectedFieldValidator.setErrorCode(null);
- Mockito.when(portalAdminService.createPortalAdmin(user.getOrgUserId())).thenReturn(expectedFieldValidator);
-
- PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
- .postPortalAdmin(mockedRequest, mockedResponse, user);
- assertEquals(actualPortalRestResponse, expectedportalRestResponse);
- }
-
- @Test
- public void postPortalAdminCreateUserIfFieldValidatorErrorTest() throws Exception {
- FieldsValidator expectedFieldValidator = new FieldsValidator();
- expectedFieldValidator.setHttpStatusCode((long) 500);
- expectedFieldValidator.setFields(null);
- expectedFieldValidator.setErrorCode(null);
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("FieldsValidator [httpStatusCode=500, errorCode=null, fields=null]");
- expectedportalRestResponse.setResponse(null);
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
- EPUser user = mockUser.mockEPUser();
- user.setEmail("guestT@test.portal.onap.org");
- user.setLoginPwd("pwd");
- user.setLoginId("Test");
- List<EPUser> expectedList = new ArrayList<EPUser>();
- expectedList.add(user);
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(userService.getUserByUserId(user.getOrgUserId())).thenReturn(expectedList);
- Mockito.when(userService.saveNewUser(user, "Yes")).thenReturn(null);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
- Mockito.when(portalAdminService.createPortalAdmin(user.getOrgUserId())).thenReturn(expectedFieldValidator);
- PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
- .postPortalAdmin(mockedRequest, mockedResponse, user);
- assertEquals(actualPortalRestResponse, expectedportalRestResponse);
- }
-
- @Test
- public void getOnboardAppExternalTest() {
- EPApp epApp = new EPApp();
- Long appId = (long) 1;
- Mockito.when(appService.getApp(appId)).thenReturn(epApp);
- OnboardingApp expectedApp = new OnboardingApp();
- Mockito.doNothing().when(appService).createOnboardingFromApp(epApp, expectedApp);
- OnboardingApp actualApp = appsControllerExternalRequest.getOnboardAppExternal(mockedRequest, mockedResponse,
- appId);
- assertEquals(expectedApp.getClass(), actualApp.getClass());
- }
-
- @Test
- public void postOnboardAppExternalExceptionTest() {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("Unexpected field: id");
- expectedportalRestResponse.setResponse(null);
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
-
- OnboardingApp expectedOnboardingApp = new OnboardingApp();
- expectedOnboardingApp.id = (long) 1;
-
- PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
- .postOnboardAppExternal(mockedRequest, mockedResponse, expectedOnboardingApp);
- assertEquals(actualPortalRestResponse, expectedportalRestResponse);
- }
-
- @Test
- public void postOnboardAppExternalTest() {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage(
- "Missing required field: name, url, restUrl, restrictedApp, isOpen, isEnabled, myLoginsAppOwner");
- expectedportalRestResponse.setResponse(null);
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
-
- OnboardingApp expectedOnboardingApp = new OnboardingApp();
- expectedOnboardingApp.id = null;
-
- PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
- .postOnboardAppExternal(mockedRequest, mockedResponse, expectedOnboardingApp);
- assertEquals(actualPortalRestResponse, expectedportalRestResponse);
-
- }
-
- @Test
- public void putOnboardAppExternalifAppNullTest() {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("Unexpected value for field: id");
- expectedportalRestResponse.setResponse(null);
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
- Long appId = null;
- OnboardingApp expectedOnboardingApp = new OnboardingApp();
- expectedOnboardingApp.id = null;
-
- PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
- .putOnboardAppExternal(mockedRequest, mockedResponse, appId, expectedOnboardingApp);
- assertEquals(actualPortalRestResponse, expectedportalRestResponse);
- }
-
- @Test
- public void putOnboardAppExternalIfOnboardingAppDetailsNullTest() {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage(
- "Missing required field: name, url, restUrl, restrictedApp, isOpen, isEnabled, myLoginsAppOwner");
- expectedportalRestResponse.setResponse(null);
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
- Long appId = (long) 1;
- OnboardingApp expectedOnboardingApp = new OnboardingApp();
- expectedOnboardingApp.id = (long) 1;
- PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
- .putOnboardAppExternal(mockedRequest, mockedResponse, appId, expectedOnboardingApp);
- assertEquals(actualPortalRestResponse, expectedportalRestResponse);
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.controller;
-
-import static org.junit.Assert.*;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.controller.AppsController;
-import org.openecomp.portalapp.portal.domain.AdminUserApplications;
-import org.openecomp.portalapp.portal.domain.AppIdAndNameTransportModel;
-import org.openecomp.portalapp.portal.domain.AppsResponse;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.EcompApp;
-import org.openecomp.portalapp.portal.domain.UserRole;
-import org.openecomp.portalapp.portal.domain.UserRoles;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.AdminRolesServiceImpl;
-import org.openecomp.portalapp.portal.service.EPAppCommonServiceImpl;
-import org.openecomp.portalapp.portal.service.EPAppService;
-import org.openecomp.portalapp.portal.service.EPLeftMenuService;
-import org.openecomp.portalapp.portal.service.EPLeftMenuServiceImpl;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
-import org.openecomp.portalapp.portal.transport.EPAppsManualPreference;
-import org.openecomp.portalapp.portal.transport.EPAppsSortPreference;
-import org.openecomp.portalapp.portal.transport.EPDeleteAppsManualSortPref;
-import org.openecomp.portalapp.portal.transport.EPWidgetsSortPreference;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.LocalRole;
-import org.openecomp.portalapp.portal.transport.OnboardingApp;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.portalsdk.core.web.support.AppUtils;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.MediaType;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({SystemProperties.class,AppUtils.class, EPUserUtils.class, MediaType.class})
-public class AppsControllerTest extends MockitoTestSuite{
-
- @InjectMocks
- AppsController appsController = new AppsController();
-
- @Mock
- AdminRolesService adminRolesService = new AdminRolesServiceImpl();
-
- @Mock
- EPAppService appService = new EPAppCommonServiceImpl();
-
- @Mock
- EPLeftMenuService leftMenuService = new EPLeftMenuServiceImpl();
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
- NullPointerException nullPointerException = new NullPointerException();
-
- @Mock
- EPUserUtils ePUserUtils = new EPUserUtils();
-
- @Mock
- AppUtils appUtils = new AppUtils();
-
- MockEPUser mockUser = new MockEPUser();
-
- @Test
- public void getUserAppsTest() {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- List<EcompApp> expectedEcompApps = new ArrayList<EcompApp>();
-
- EcompApp ecompApp = new EcompApp();
- ecompApp.setId((long) 1);
- ecompApp.setName("Test_app");
- ecompApp.setUrl("Test_URL");
- ecompApp.setUebKey("Test_key");
- ecompApp.setAlternateUrl("Test_alt_URL");
- expectedEcompApps.add(ecompApp);
- List<EcompApp> actualEcompApps = new ArrayList<EcompApp>();
- Mockito.when(appService.transformAppsToEcompApps(appService.getUserApps(user))).thenReturn(expectedEcompApps);
- actualEcompApps = appsController.getUserApps(mockedRequest, mockedResponse);
- assertEquals(expectedEcompApps, actualEcompApps);
- }
-
- @Test
- public void getUserAppsNoUserTest() {
- EPUser user = null;
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(appService.transformAppsToEcompApps(appService.getUserApps(user))).thenReturn(null);
- assertNull(appsController.getUserApps(mockedRequest, mockedResponse));
-
- }
-
- @Test
- public void getUserAppsExceptionTest() {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(appService.transformAppsToEcompApps(appService.getUserApps(user))).thenThrow(nullPointerException);
- assertNull(appsController.getUserApps(mockedRequest, mockedResponse));
-
- }
-
- @Test
- public void getPersUserAppsIfUserIsAdminTest() throws IOException {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- List<EcompApp> expectedEcompApps = new ArrayList<EcompApp>();
-
- EcompApp ecompApp = new EcompApp();
- ecompApp.setId((long) 1);
- ecompApp.setName("Test_app");
- ecompApp.setUrl("Test_URL");
- ecompApp.setUebKey("Test_key");
- ecompApp.setAlternateUrl("Test_alt_URL");
- expectedEcompApps.add(ecompApp);
- List<EcompApp> actualEcompApps = new ArrayList<EcompApp>();
-
- List<EPApp> expectedApps = new ArrayList<EPApp>();
-
- EPApp app = new EPApp();
-
- app.setName("Test");
- app.setImageUrl("test");
- app.setDescription("test");
- app.setNotes("test");
- app.setUrl("test");
- app.setId((long) 1);
- app.setAppRestEndpoint("test");
- app.setAlternateUrl("test");
- app.setName("test");
- app.setMlAppName("test");
- app.setMlAppAdminId("test");
- app.setUsername("test");
- app.setAppPassword("test");
- app.setOpen(false);
- app.setEnabled(false);
- app.setUebKey("test");
- app.setUebSecret("test");
- app.setUebTopicName("test");
- app.setAppType(1);
-
- expectedApps.add(app);
-
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(appService.getPersAdminApps(user)).thenReturn(expectedApps);
-
- Mockito.when(appService.transformAppsToEcompApps(expectedApps)).thenReturn(expectedEcompApps);
- actualEcompApps = appsController.getPersUserApps(mockedRequest, mockedResponse);
- assertEquals(expectedEcompApps, actualEcompApps);
- }
-
- @Test
- public void getPersUserAppsIfUserNotAdminTest() throws IOException {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- List<EcompApp> expectedEcompApps = new ArrayList<EcompApp>();
-
- EcompApp ecompApp = new EcompApp();
- ecompApp.setId((long) 1);
- ecompApp.setName("Test_app");
- ecompApp.setUrl("Test_URL");
- ecompApp.setUebKey("Test_key");
- ecompApp.setAlternateUrl("Test_alt_URL");
- expectedEcompApps.add(ecompApp);
- List<EcompApp> actualEcompApps = new ArrayList<EcompApp>();
-
- List<EPApp> expectedApps = new ArrayList<EPApp>();
-
- EPApp app = new EPApp();
-
- app.setName("Test");
- app.setImageUrl("test");
- app.setDescription("test");
- app.setNotes("test");
- app.setUrl("test");
- app.setId((long) 1);
- app.setAppRestEndpoint("test");
- app.setAlternateUrl("test");
- app.setName("test");
- app.setMlAppName("test");
- app.setMlAppAdminId("test");
- app.setUsername("test");
- app.setAppPassword("test");
- app.setOpen(false);
- app.setEnabled(false);
- app.setUebKey("test");
- app.setUebSecret("test");
- app.setUebTopicName("test");
- app.setAppType(1);
-
- expectedApps.add(app);
-
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
- Mockito.when(appService.getPersUserApps(user)).thenReturn(expectedApps);
- Mockito.when(appService.transformAppsToEcompApps(expectedApps)).thenReturn(expectedEcompApps);
- actualEcompApps = appsController.getPersUserApps(mockedRequest, mockedResponse);
- assertEquals(expectedEcompApps, actualEcompApps);
- }
-
- @Test
- public void getPersUserAppsIfUserNullTest() throws IOException {
- EPUser user = null;
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- assertNull(appsController.getPersUserApps(mockedRequest, mockedResponse));
- }
-
- @Test
- public void getPersUserAppsExceptionTest() throws IOException {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(appService.getPersAdminApps(user)).thenThrow(nullPointerException);
- assertNull(appsController.getPersUserApps(mockedRequest, mockedResponse));
- }
-
- @Test
- public void getAdminAppsIfNotAdminTest() {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(false);
- assertNull(appsController.getAdminApps(mockedRequest, mockedResponse));
- }
-
- @Test
- public void getAdminAppsTest() {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- List<AppIdAndNameTransportModel> expectedAdminApps = new ArrayList<AppIdAndNameTransportModel>();
- AppIdAndNameTransportModel appIdAndNameTransportModel = new AppIdAndNameTransportModel();
- appIdAndNameTransportModel.setId((long) 1);
- appIdAndNameTransportModel.setName("Test_app");
- expectedAdminApps.add(appIdAndNameTransportModel);
- List<AppIdAndNameTransportModel> actualAdminApps = new ArrayList<AppIdAndNameTransportModel>();
- Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(true);
- Mockito.when(appService.getAdminApps(user)).thenReturn(expectedAdminApps);
- actualAdminApps = appsController.getAdminApps(mockedRequest, mockedResponse);
- assertEquals(actualAdminApps, expectedAdminApps);
-
- }
-
- @Test
- public void getAdminAppsExceptionTest() {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(true);
- Mockito.when(appService.getAdminApps(user)).thenThrow(nullPointerException);
- assertNull(appsController.getAdminApps(mockedRequest, mockedResponse));
- }
-
- @Test
- public void getAppsForSuperAdminAndAccountAdminifOnlyAccountAdminTest() {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
- Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(false);
- assertNull(appsController.getAppsForSuperAdminAndAccountAdmin(mockedRequest, mockedResponse));
- }
-
- @Test
- public void getAppsForSuperAdminAndAccountAdminTest() {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- List<AppIdAndNameTransportModel> expectedAdminApps = new ArrayList<AppIdAndNameTransportModel>();
- AppIdAndNameTransportModel appIdAndNameTransportModel = new AppIdAndNameTransportModel();
- appIdAndNameTransportModel.setId((long) 1);
- appIdAndNameTransportModel.setName("Test_app");
- expectedAdminApps.add(appIdAndNameTransportModel);
- List<AppIdAndNameTransportModel> actualAdminApps = new ArrayList<AppIdAndNameTransportModel>();
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(true);
- Mockito.when(appService.getAppsForSuperAdminAndAccountAdmin(user)).thenReturn(expectedAdminApps);
- actualAdminApps = appsController.getAppsForSuperAdminAndAccountAdmin(mockedRequest, mockedResponse);
- assertEquals(actualAdminApps, expectedAdminApps);
-
- }
-
- @Test
- public void getAppsForSuperAdminExceptionTest() {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(false);
- Mockito.when(appService.getAppsForSuperAdminAndAccountAdmin(user)).thenThrow(nullPointerException);
- assertNull(appsController.getAppsForSuperAdminAndAccountAdmin(mockedRequest, mockedResponse));
- }
-
- @Test
- public void putUserAppsSortingManualTest() throws IOException {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- List<EPAppsManualPreference> ePAppsManualPreference = new ArrayList<EPAppsManualPreference>();
- FieldsValidator expectedFieldValidator = new FieldsValidator();
- expectedFieldValidator.setHttpStatusCode((long) 200);
- expectedFieldValidator.setFields(null);
- expectedFieldValidator.setErrorCode(null);
- FieldsValidator actualFieldValidator = new FieldsValidator();
- Mockito.when(appService.saveAppsSortManual(ePAppsManualPreference, user)).thenReturn(expectedFieldValidator);
- actualFieldValidator = appsController.putUserAppsSortingManual(mockedRequest, ePAppsManualPreference,
- mockedResponse);
- assertEquals(actualFieldValidator, expectedFieldValidator);
- }
-
- @Test
- public void putUserAppsSortingManualExceptionTest() throws IOException {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- List<EPAppsManualPreference> ePAppsManualPreference = new ArrayList<EPAppsManualPreference>();
- Mockito.when(appService.saveAppsSortManual(ePAppsManualPreference, user)).thenThrow(nullPointerException);
- assertNull(appsController.putUserAppsSortingManual(mockedRequest, ePAppsManualPreference, mockedResponse));
- }
-
- @Test
- public void putUserWidgetsSortManualTest() throws IOException {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- List<EPWidgetsSortPreference> ePWidgetsSortPreference = new ArrayList<EPWidgetsSortPreference>();
- FieldsValidator expectedFieldValidator = new FieldsValidator();
- expectedFieldValidator.setHttpStatusCode((long) 200);
- expectedFieldValidator.setFields(null);
- expectedFieldValidator.setErrorCode(null);
- FieldsValidator actualFieldValidator = new FieldsValidator();
- Mockito.when(appService.saveWidgetsSortManual(ePWidgetsSortPreference, user))
- .thenReturn(expectedFieldValidator);
- actualFieldValidator = appsController.putUserWidgetsSortManual(mockedRequest, ePWidgetsSortPreference,
- mockedResponse);
- assertEquals(actualFieldValidator, expectedFieldValidator);
- }
-
- @Test
- public void putUserWidgetsSortManualExceptionTest() throws IOException {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- List<EPAppsManualPreference> ePAppsManualPreference = new ArrayList<EPAppsManualPreference>();
- Mockito.when(appService.saveAppsSortManual(ePAppsManualPreference, user)).thenThrow(nullPointerException);
- assertNull(appsController.putUserAppsSortingManual(mockedRequest, ePAppsManualPreference, mockedResponse));
- }
-
- @Test
- public void putUserWidgetsSortPrefTest() throws IOException {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- List<EPWidgetsSortPreference> ePWidgetsSortPreference = new ArrayList<EPWidgetsSortPreference>();
- FieldsValidator expectedFieldValidator = new FieldsValidator();
- expectedFieldValidator.setHttpStatusCode((long) 200);
- expectedFieldValidator.setFields(null);
- expectedFieldValidator.setErrorCode(null);
- FieldsValidator actualFieldValidator = new FieldsValidator();
- Mockito.when(appService.deleteUserWidgetSortPref(ePWidgetsSortPreference, user))
- .thenReturn(expectedFieldValidator);
- actualFieldValidator = appsController.putUserWidgetsSortPref(mockedRequest, ePWidgetsSortPreference,
- mockedResponse);
- assertEquals(actualFieldValidator, expectedFieldValidator);
- }
-
- @Test
- public void putUserWidgetsSortPrefExceptionTest() throws IOException {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- List<EPWidgetsSortPreference> ePWidgetsSortPreference = new ArrayList<EPWidgetsSortPreference>();
- Mockito.when(appService.deleteUserWidgetSortPref(ePWidgetsSortPreference, user))
- .thenThrow(nullPointerException);
- assertNull(appsController.putUserWidgetsSortPref(mockedRequest, ePWidgetsSortPreference, mockedResponse));
- }
-
- @Test
- public void deleteUserAppSortManualTest() throws IOException {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- EPDeleteAppsManualSortPref epDeleteAppsManualSortPref = new EPDeleteAppsManualSortPref();
-
- FieldsValidator expectedFieldValidator = new FieldsValidator();
- expectedFieldValidator.setHttpStatusCode((long) 200);
- expectedFieldValidator.setFields(null);
- expectedFieldValidator.setErrorCode(null);
- FieldsValidator actualFieldValidator = new FieldsValidator();
- Mockito.when(appService.deleteUserAppSortManual(epDeleteAppsManualSortPref, user))
- .thenReturn(expectedFieldValidator);
- actualFieldValidator = appsController.deleteUserAppSortManual(mockedRequest, epDeleteAppsManualSortPref,
- mockedResponse);
- assertEquals(actualFieldValidator, expectedFieldValidator);
- }
-
- @Test
- public void deleteUserAppSortManualExceptionTest() throws IOException {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- EPDeleteAppsManualSortPref epDeleteAppsManualSortPref = new EPDeleteAppsManualSortPref();
- Mockito.when(appService.deleteUserAppSortManual(epDeleteAppsManualSortPref, user))
- .thenThrow(nullPointerException);
- assertNull(appsController.deleteUserAppSortManual(mockedRequest, epDeleteAppsManualSortPref, mockedResponse));
- }
-
- @Test
- public void putUserAppsSortingPreferenceTest() throws IOException {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- EPAppsSortPreference userAppsValue = new EPAppsSortPreference();
-
- FieldsValidator expectedFieldValidator = new FieldsValidator();
- expectedFieldValidator.setHttpStatusCode((long) 200);
- expectedFieldValidator.setFields(null);
- expectedFieldValidator.setErrorCode(null);
- FieldsValidator actualFieldValidator = new FieldsValidator();
- Mockito.when(appService.saveAppsSortPreference(userAppsValue, user)).thenReturn(expectedFieldValidator);
- actualFieldValidator = appsController.putUserAppsSortingPreference(mockedRequest, userAppsValue,
- mockedResponse);
- assertEquals(actualFieldValidator, expectedFieldValidator);
- }
-
- @Test
- public void putUserAppsSortingPreferenceExceptionTest() throws IOException {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- EPAppsSortPreference userAppsValue = new EPAppsSortPreference();
- Mockito.when(appService.saveAppsSortPreference(userAppsValue, user)).thenThrow(nullPointerException);
- assertNull(appsController.putUserAppsSortingPreference(mockedRequest, userAppsValue, mockedResponse));
- }
-
- @Test
- public void getUserAppsSortTypePreferenceTest() throws IOException {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- String expectedUserSortPreference = "TEST_DECE";
- String actualUserSortPreference = new String();
- Mockito.when(appService.getUserAppsSortTypePreference(user)).thenReturn(expectedUserSortPreference);
- actualUserSortPreference = appsController.getUserAppsSortTypePreference(mockedRequest, mockedResponse);
- assertEquals(actualUserSortPreference, expectedUserSortPreference);
- }
-
- @Test
- public void getUserAppsSortTypePreferenceExceptionTest() throws IOException {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(appService.getUserAppsSortTypePreference(user)).thenThrow(nullPointerException);
- assertNull(appsController.getUserAppsSortTypePreference(mockedRequest, mockedResponse));
- }
-
- @Test
- public void getUserAppsSortTypePreferenceIfUserNullTest() throws IOException {
- EPUser user = null;
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(appService.getUserAppsSortTypePreference(user)).thenThrow(nullPointerException);
- assertNull(appsController.getUserAppsSortTypePreference(mockedRequest, mockedResponse));
- }
-
- @Test
- public void getAppsAdministratorsTest() throws IOException {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- List<AdminUserApplications> expecteAdminUserApplications = new ArrayList<AdminUserApplications>();
- List<AdminUserApplications> actualAdminUserApplications = new ArrayList<AdminUserApplications>();
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(appService.getAppsAdmins()).thenReturn(expecteAdminUserApplications);
- actualAdminUserApplications = appsController.getAppsAdministrators(mockedRequest, mockedResponse);
- assertEquals(expecteAdminUserApplications, actualAdminUserApplications);
- }
-
- @Test
- public void getAppsAdministratorsIfUserNotSuperAdminTest() throws IOException {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
- assertNull(appsController.getUserAppsSortTypePreference(mockedRequest, mockedResponse));
- }
-
- @Test
- public void getAppsAdministratorsExceptionTest() throws IOException {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(appService.getAppsAdmins()).thenThrow(nullPointerException);
- assertNull(appsController.getUserAppsSortTypePreference(mockedRequest, mockedResponse));
- }
-
- @Test
- public void getAppsTest() throws IOException {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- List<AppsResponse> expectedApps = new ArrayList<AppsResponse>();
- AppsResponse apps = new AppsResponse((long) 1, "test", true, true);
- expectedApps.add(apps);
-
- List<AppsResponse> atualApps = new ArrayList<AppsResponse>();
-
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(appService.getAllApps(false)).thenReturn(expectedApps);
- atualApps = appsController.getApps(mockedRequest, mockedResponse);
- assertEquals(expectedApps, atualApps);
- }
-
- @Test
- public void getAppsExceptionTest() throws IOException {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
- assertNull(appsController.getApps(mockedRequest, mockedResponse));
- }
-
- @Test
- public void getAppsIfUserNotSuperAdminTest() throws IOException {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(appService.getAllApps(false)).thenThrow(nullPointerException);
- assertNull(appsController.getApps(mockedRequest, mockedResponse));
- }
-
- @Test
- public void getAllAppsTest() throws IOException {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- List<AppsResponse> expectedApps = new ArrayList<AppsResponse>();
- AppsResponse apps = new AppsResponse((long) 1, "test", true, true);
- expectedApps.add(apps);
- List<AppsResponse> atualApps = new ArrayList<AppsResponse>();
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(appService.getAllApps(true)).thenReturn(expectedApps);
- atualApps = appsController.getAllApps(mockedRequest, mockedResponse);
- assertEquals(expectedApps, atualApps);
- }
-
- @Test
- public void getAllAppsExceptionTest() throws IOException {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
- assertNull(appsController.getAllApps(mockedRequest, mockedResponse));
- }
-
- @Test
- public void getAllAppsIfUserNotSuperAdminTest() throws IOException {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(appService.getAllApps(true)).thenThrow(nullPointerException);
- assertNull(appsController.getAllApps(mockedRequest, mockedResponse));
- }
-
- @Test
- public void getAppsFullListTest() {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- List<EcompApp> expectedEcompApps = new ArrayList<EcompApp>();
-
- EcompApp ecompApp = new EcompApp();
- ecompApp.setId((long) 1);
- ecompApp.setName("Test_app");
- ecompApp.setUrl("Test_URL");
- ecompApp.setUebKey("Test_key");
- ecompApp.setAlternateUrl("Test_alt_URL");
- expectedEcompApps.add(ecompApp);
- List<EcompApp> actualEcompApps = new ArrayList<EcompApp>();
- Mockito.when(appService.getEcompAppAppsFullList()).thenReturn(expectedEcompApps);
- actualEcompApps = appsController.getAppsFullList(mockedRequest, mockedResponse);
- assertEquals(expectedEcompApps, actualEcompApps);
- }
-
-// @Test
-// public void getAppsFullListNoUserTest() {
-// EPUser user = null;
-// Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-// Mockito.when(appService.getEcompAppAppsFullList()).thenReturn(null);
-// assertNull(appsController.getAppsFullList(mockedRequest, mockedResponse));
-//
-// }
-
- @Test
- public void getUserProfileTest() {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-
- UserRole userRole = new UserRole();
- userRole.setUser_Id((long) 1);
- userRole.setOrgUserId("guest");
- userRole.setFirstName("Test_User_FirstName");
- userRole.setLastName("Test_User_LastName");
- userRole.setRoleId((long) 1);
- userRole.setRoleName("test");
-
- UserRoles unexpectedserAndRoles = new UserRoles(userRole);
- unexpectedserAndRoles.setFirstName("Test_User_FirstName");
- unexpectedserAndRoles.setLastName("Test_User_LastName");
- unexpectedserAndRoles.setGuestSession(false);
- unexpectedserAndRoles.setOrgUserId("guest");
- List<String> roles = new ArrayList<String>();
- roles.add("Test");
- unexpectedserAndRoles.setRoles(roles);
- Mockito.when(appService.getUserProfileNormalized(user)).thenReturn(unexpectedserAndRoles);
- UserRoles actualUserAndRoles = appsController.getUserProfile(mockedRequest, mockedResponse);
- assertEquals(unexpectedserAndRoles, actualUserAndRoles);
- }
-
- @Test
- public void getUserProfileIfUserNullTest() throws IOException {
- EPUser user = null;
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(appService.getUserProfileNormalized(user)).thenReturn(null);
- assertNull(appsController.getUserAppsSortTypePreference(mockedRequest, mockedResponse));
- }
-
- @Test
- public void getUserProfileExcpetionTest() throws IOException {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(appService.getUserProfileNormalized(user)).thenThrow(nullPointerException);
- assertNull(appsController.getUserAppsSortTypePreference(mockedRequest, mockedResponse));
- }
-
- @Test
- public void getAppRolesTest() {
- List<LocalRole> expectedRoleList = new ArrayList<LocalRole>();
- LocalRole localRole = new LocalRole();
- localRole.setRoleId(1);
- localRole.setRolename("test");
- expectedRoleList.add(localRole);
- long appId = 1;
- Mockito.when(appService.getAppRoles(appId)).thenReturn(expectedRoleList);
- List<LocalRole> actualRoleList = appsController.getAppRoles(mockedRequest, appId);
- assertEquals(actualRoleList, expectedRoleList);
- }
-
- @Test
- public void getAppRolesExceptionTest() {
- long appId = 1;
- Mockito.when(appService.getAppRoles(appId)).thenThrow(nullPointerException);
- assertNull(appsController.getAppRoles(mockedRequest, appId));
- }
-
- @Test
- public void getOnboardingAppsTest() {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- List<OnboardingApp> expectedOnboardingApps = new ArrayList<OnboardingApp>();
- OnboardingApp onboardingApp = new OnboardingApp();
- onboardingApp.setUebKey("test");
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(appService.getOnboardingApps()).thenReturn(expectedOnboardingApps);
- List<OnboardingApp> actualOnboardingApps = appsController.getOnboardingApps(mockedRequest, mockedResponse);
- assertEquals(expectedOnboardingApps, actualOnboardingApps);
- }
-
- @Test
- public void getOnboardingAppsifSuperAdiminTest() {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
- assertNull(appsController.getOnboardingApps(mockedRequest, mockedResponse));
- }
-
- @Test
- public void getOnboardingAppsExceptionTest() {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(!adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(appService.getOnboardingApps()).thenThrow(nullPointerException);
- assertNull(appsController.getOnboardingApps(mockedRequest, mockedResponse));
- }
-
- @Test
- public void putOnboardingAppTest() {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- OnboardingApp OnboardingApp = new OnboardingApp();
- FieldsValidator expectedFieldValidator = new FieldsValidator();
- expectedFieldValidator.setHttpStatusCode((long) 200);
- expectedFieldValidator.setFields(null);
- expectedFieldValidator.setErrorCode(null);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(appService.modifyOnboardingApp(OnboardingApp, user)).thenReturn(expectedFieldValidator);
- FieldsValidator actualFieldValidator = appsController.putOnboardingApp(mockedRequest, OnboardingApp,
- mockedResponse);
- assertEquals(expectedFieldValidator, actualFieldValidator);
- }
-
- @Test
- public void putOnboardingAppIfSuperAdminTest() {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- FieldsValidator expectedFieldValidator = null;
- OnboardingApp OnboardingApp = new OnboardingApp();
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
- Mockito.when(appService.modifyOnboardingApp(OnboardingApp, user)).thenReturn(expectedFieldValidator);
- assertNull(appsController.putOnboardingApp(mockedRequest, OnboardingApp, mockedResponse));
- }
-
- @Test
- public void putOnboardingAppExceptionTest() {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- OnboardingApp OnboardingApp = new OnboardingApp();
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(appService.modifyOnboardingApp(OnboardingApp, user)).thenThrow(nullPointerException);
- assertNull(appsController.putOnboardingApp(mockedRequest, OnboardingApp, mockedResponse));
- }
-
- @Test
- public void postOnboardingAppTest() {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- OnboardingApp OnboardingApp = new OnboardingApp();
- FieldsValidator expectedFieldValidator = new FieldsValidator();
- expectedFieldValidator.setHttpStatusCode((long) 200);
- expectedFieldValidator.setFields(null);
- expectedFieldValidator.setErrorCode(null);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(appService.addOnboardingApp(OnboardingApp, user)).thenReturn(expectedFieldValidator);
- FieldsValidator actualFieldValidator = appsController.postOnboardingApp(mockedRequest, OnboardingApp,
- mockedResponse);
- assertEquals(expectedFieldValidator, actualFieldValidator);
- }
-
- @Test
- public void postOnboardingAppIfSuperAdminTest() {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- FieldsValidator expectedFieldValidator = null;
- OnboardingApp OnboardingApp = new OnboardingApp();
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
- Mockito.when(appService.addOnboardingApp(OnboardingApp, user)).thenReturn(expectedFieldValidator);
- assertNull(appsController.postOnboardingApp(mockedRequest, OnboardingApp, mockedResponse));
- }
-
- @Test
- public void postOnboardingAppExceptionTest() {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- OnboardingApp OnboardingApp = new OnboardingApp();
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(appService.addOnboardingApp(OnboardingApp, user)).thenThrow(nullPointerException);
- assertNull(appsController.postOnboardingApp(mockedRequest, OnboardingApp, mockedResponse));
- }
-
- @Test
- public void deleteOnboardingAppTest() {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- FieldsValidator expectedFieldValidator = new FieldsValidator();
- expectedFieldValidator.setHttpStatusCode((long) 200);
- expectedFieldValidator.setFields(null);
- expectedFieldValidator.setErrorCode(null);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- long appId = 1;
- Mockito.when(appService.deleteOnboardingApp(user,appId )).thenReturn(expectedFieldValidator);
- FieldsValidator actualFieldValidator = appsController.deleteOnboardingApp(mockedRequest,appId,
- mockedResponse);
- assertEquals(expectedFieldValidator, actualFieldValidator);
- }
-
- @Test
- public void deleteOnboardingAppIfSuperAdminTest() {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- FieldsValidator expectedFieldValidator = null;
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
- long appId = 1;
- Mockito.when(appService.deleteOnboardingApp(user,appId)).thenReturn(expectedFieldValidator);
- assertNull(appsController.deleteOnboardingApp(mockedRequest,appId,mockedResponse));
- }
-
- @Test
- public void deleteOnboardingAppExceptionTest() {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- long appId = 1;
- Mockito.when(appService.deleteOnboardingApp(user,appId)).thenThrow(nullPointerException);
- assertNull(appsController.deleteOnboardingApp(mockedRequest,appId,mockedResponse));
- }
-
- @Test
- public void getLeftMenuItemsTest()
- {
- EPUser user = mockUser.mockEPUser();
- String menuList = "Test";
- PowerMockito.mockStatic(EPUserUtils.class);
- PowerMockito.mockStatic(SystemProperties.class);
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Set menuSet = new HashSet<>();
- menuSet.add(1);
- Mockito.when(AppUtils.getSession(mockedRequest)
- .getAttribute(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME))).thenReturn(menuSet);
- Mockito.when(AppUtils.getSession(mockedRequest)
- .getAttribute(SystemProperties.getProperty(SystemProperties.ROLE_FUNCTIONS_ATTRIBUTE_NAME))).thenReturn(menuSet);
- Mockito.when(leftMenuService.getLeftMenuItems(user, menuSet, menuSet)).thenReturn(menuList);
- String response = appsController.getLeftMenuItems(mockedRequest, mockedResponse);
- assertTrue(response.equals("Test"));
- }
-
- @Test
- public void getLeftMenuItemsExceptionTest()
- {
- EPUser user = mockUser.mockEPUser();
- String menuList = "Test";
- PowerMockito.mockStatic(EPUserUtils.class);
- PowerMockito.mockStatic(SystemProperties.class);
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Set menuSet = new HashSet<>();
- menuSet.add(1);
- Mockito.when(AppUtils.getSession(mockedRequest)
- .getAttribute(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME))).thenReturn(menuSet);
- Mockito.when(AppUtils.getSession(mockedRequest)
- .getAttribute(SystemProperties.getProperty(SystemProperties.ROLE_FUNCTIONS_ATTRIBUTE_NAME))).thenReturn(menuSet);
- Mockito.when(leftMenuService.getLeftMenuItems(user, menuSet, menuSet)).thenThrow(nullPointerException);
- assertNull(appsController.getLeftMenuItems(mockedRequest, mockedResponse));
- }
-
- @Test
- public void getAppThumbnailExceptionTest()
- {
- EPApp app = null;
- assertNull(appsController.getAppThumbnail(mockedRequest, (long) 1, mockedResponse));
- }
-
- @Test
- public void getAppThumbnailTest()
- {
- EPApp app = new EPApp();
- app.setName("Test");
- app.setImageUrl("test");
- app.setDescription("test");
- app.setNotes("test");
- app.setUrl("test");
- app.setId((long) 1);
- app.setAppType(1);
- app.setImageUrl("www.ecomp.com");
- app.setThumbnail(new byte[] {1, 6, 3});
- Mockito.when(appService.getApp((long) 1)).thenReturn(app);
- HttpEntity<byte[]> response = appsController.getAppThumbnail(mockedRequest, (long) 1, mockedResponse);
- assertEquals(response.getHeaders().getContentLength(), 3);
- }
-
- @Test
- public void getAppThumbnailForMediaTypePngTest()
- {
-
- EPApp app = new EPApp();
- app.setName("Test");
- app.setImageUrl("test");
- app.setDescription("test");
- app.setNotes("test");
- app.setUrl("test");
- app.setId((long) 1);
- app.setAppType(1);
- app.setImageUrl("www.ecomp.png");
- app.setThumbnail(new byte[] {1, 6, 3});
- Mockito.when(appService.getApp((long) 1)).thenReturn(app);
- PowerMockito.mockStatic(MediaType.class);
- HttpEntity<byte[]> response = appsController.getAppThumbnail(mockedRequest, (long) 1, mockedResponse);
- assertEquals(response.getHeaders().getContentLength(), 3);
- }
-
- @Test
- public void getUserAppsOrderBySortPrefIfUSerNullTest(){
- List<EcompApp> listOfApps = new ArrayList<EcompApp>();
-
- EcompApp app = new EcompApp();
- listOfApps.add(app);
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(null);
- assertNull(appsController.getUserAppsOrderBySortPref(mockedRequest, mockedResponse));
- }
-
- @Test
- public void getUserAppsOrderBySortPrefTest(){
- List<EcompApp> listOfApps = new ArrayList<EcompApp>();
-
- EcompApp app = new EcompApp();
- listOfApps.add(app);
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(mockedRequest.getParameter("mparams")).thenReturn("");
- Mockito.when(appService.transformAppsToEcompApps(appService.getAppsOrderByName(user))).thenReturn(listOfApps);
- List<EcompApp> listOfActualApps = appsController.getUserAppsOrderBySortPref(mockedRequest, mockedResponse);
- assertEquals(listOfActualApps.size(), 1);
- }
-
- @Test
- public void getUserAppsOrderBySortPrefIfusrSortPrefIsMTest(){
- List<EcompApp> listOfApps = new ArrayList<EcompApp>();
-
- EcompApp app = new EcompApp();
- listOfApps.add(app);
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(mockedRequest.getParameter("mparams")).thenReturn("M");
- Mockito.when(appService.transformAppsToEcompApps(appService.getAppsOrderByName(user))).thenReturn(listOfApps);
- List<EcompApp> listOfActualApps = appsController.getUserAppsOrderBySortPref(mockedRequest, mockedResponse);
- assertEquals(listOfActualApps.size(), 1);
- }
-
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.controller;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.controller.AuditLogController;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.service.AuditService;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest(EPUserUtils.class)
-public class AuditLogControllerTest {
-
-
- @Mock
- AuditService auditService;
-
- @InjectMocks
- AuditLogController auditLogController = new AuditLogController();
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
-
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
- NullPointerException nullPointerException = new NullPointerException();
- MockEPUser mockUser = new MockEPUser();
- @Test
- public void auditLogTest()
- {
- PowerMockito.mockStatic(EPUserUtils.class);
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(EPUserUtils.getUserId(mockedRequest)).thenReturn((int)1);
- auditLogController.auditLog(mockedRequest, "1", "app", "test");
- }
-
- @Test
- public void auditLogTabTest()
- {
- PowerMockito.mockStatic(EPUserUtils.class);
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(EPUserUtils.getUserId(mockedRequest)).thenReturn((int)1);
- auditLogController.auditLog(mockedRequest, "1", "tab", "test");
- }
-
- @Test
- public void auditLogfunctionalTest()
- {
- PowerMockito.mockStatic(EPUserUtils.class);
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(EPUserUtils.getUserId(mockedRequest)).thenReturn((int)1);
- auditLogController.auditLog(mockedRequest, "1", "functional", "test");
- }
-
- @Test
- public void auditLogleftMenuTest()
- {
- PowerMockito.mockStatic(EPUserUtils.class);
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(EPUserUtils.getUserId(mockedRequest)).thenReturn((int)1);
- auditLogController.auditLog(mockedRequest, "1", "leftMenu", "test");
- }
-
- @Test(expected = NumberFormatException.class)
- public void auditLogExceptionTest()
- {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(EPUserUtils.getUserId(mockedRequest)).thenReturn((int)1);
- auditLogController.auditLog(mockedRequest, "1", "app", "test");
- }
-
- @Test
- public void auditLogerrorTest()
- {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenThrow(nullPointerException);
- auditLogController.auditLog(mockedRequest, "1", "app", "test");
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.controller;
-
-import static org.junit.Assert.assertTrue;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.controller.BEPropertyReaderController;
-import org.openecomp.portalapp.portal.domain.BEProperty;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest(SystemProperties.class)
-public class BEPropertyReaderControllerTest extends MockitoTestSuite {
-
- @InjectMocks
- BEPropertyReaderController bEPropertyReaderController = new BEPropertyReaderController();
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-
- NullPointerException nullPointerException = new NullPointerException();
-
- @Test
- public void readPropertyTest() {
- String key = "DOMAIN_CLASS_LOCATION";
- BEProperty beProperty = new BEProperty("DOMAIN_CLASS_LOCATION", "domain_class_location");
- PortalRestResponse<BEProperty> ecpectedPortalRestResponse = new PortalRestResponse<BEProperty>();
- ecpectedPortalRestResponse.setMessage("success");
- ecpectedPortalRestResponse.setResponse(beProperty);
- ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
- PortalRestResponse<BEProperty> actualPortalRestResponse = null;
- PowerMockito.mockStatic(SystemProperties.class);
- Mockito.when(SystemProperties.getProperty("DOMAIN_CLASS_LOCATION")).thenReturn("domain_class_location");
- actualPortalRestResponse = bEPropertyReaderController.readProperty(mockedRequest, key);
- assertTrue(actualPortalRestResponse.equals(ecpectedPortalRestResponse));
-
- }
-
- @Test
- public void readPropertyExceptionTest() {
- String key =null;
- //BEProperty beProperty = new BEProperty("DOMAIN_CLASS_LOCATION", "domain_class_location");
- PortalRestResponse<BEProperty> ecpectedPortalRestResponse = new PortalRestResponse<BEProperty>();
- ecpectedPortalRestResponse.setMessage("java.lang.NullPointerException");
- ecpectedPortalRestResponse.setResponse(null);
- ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
- PortalRestResponse<BEProperty> actualPortalRestResponse = null;
- PowerMockito.mockStatic(SystemProperties.class);
- Mockito.when(new BEProperty(key, SystemProperties.getProperty(key))).thenThrow(nullPointerException);
- actualPortalRestResponse = bEPropertyReaderController.readProperty(mockedRequest, key);
- assertTrue(actualPortalRestResponse.equals(ecpectedPortalRestResponse));
-
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.controller;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.controller.BasicAuthAccountController;
-import org.openecomp.portalapp.portal.domain.BasicAuthCredentials;
-import org.openecomp.portalapp.portal.domain.EPEndpoint;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.AdminRolesServiceImpl;
-import org.openecomp.portalapp.portal.service.BasicAuthAccountService;
-import org.openecomp.portalapp.portal.service.BasicAuthAccountServiceImpl;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.openecomp.portalapp.util.EPUserUtils;
-
-public class BasicAuthAccountControllerTest extends MockitoTestSuite {
-
- @Mock
- BasicAuthAccountService basicAuthAccountService = new BasicAuthAccountServiceImpl();
-
- @Mock
- AdminRolesService adminRolesService = new AdminRolesServiceImpl();
-
- @InjectMocks
- BasicAuthAccountController basicAuthAccountController = new BasicAuthAccountController();
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
- NullPointerException nullPointerException = new NullPointerException();
-
- @Mock
- EPUserUtils ePUserUtils = new EPUserUtils();
-
- MockEPUser mockUser = new MockEPUser();
-
- public BasicAuthCredentials basicAuthCredentials() {
- BasicAuthCredentials basicAuthCredentials = new BasicAuthCredentials();
-
- basicAuthCredentials.setId((long) 1);
- basicAuthCredentials.setApplicationName("test");
- basicAuthCredentials.setUsername("Test");
- basicAuthCredentials.setPassword("Password");
- basicAuthCredentials.setIsActive("YES");
-
- List<EPEndpoint> endpoints = new ArrayList<EPEndpoint>();
-
- EPEndpoint ePEndpoint = new EPEndpoint();
- ePEndpoint.setId((long) 1);
- ePEndpoint.setName("Test");
- endpoints.add(ePEndpoint);
- basicAuthCredentials.setEndpoints(endpoints);
-
- return basicAuthCredentials;
-
- }
-
- @Test
- public void createBasicAuthAccountTest() throws Exception {
- BasicAuthCredentials basicAuthCredentials = basicAuthCredentials();
-
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
- expectedResponse.setMessage("SUCCESS");
- expectedResponse.setResponse("");
- expectedResponse.setStatus(PortalRestStatusEnum.OK);
- long accountd = 1;
-
- Mockito.when(basicAuthAccountService.saveBasicAuthAccount(basicAuthCredentials)).thenReturn(accountd);
-
- PortalRestResponse<String> actualResponse = basicAuthAccountController.createBasicAuthAccount(mockedRequest,
- mockedResponse, basicAuthCredentials);
- assertEquals(actualResponse, expectedResponse);
- }
-
- @Test
- public void createBasicAuthAccountAdminTest() throws Exception {
- BasicAuthCredentials basicAuthCredentials = basicAuthCredentials();
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
- PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
- expectedResponse.setMessage("Authorization Required");
- expectedResponse.setResponse("Admin Only Operation! ");
- expectedResponse.setStatus(PortalRestStatusEnum.ERROR);
-
- PortalRestResponse<String> actualResponse = basicAuthAccountController.createBasicAuthAccount(mockedRequest,
- mockedResponse, basicAuthCredentials);
- assertEquals(actualResponse, expectedResponse);
- }
-
- @Test
- public void createBasicAuthAccountIfInputNullTest() throws Exception {
- BasicAuthCredentials basicAuthCredentials = null;
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
- expectedResponse.setMessage("FAILURE");
- expectedResponse.setResponse("newBasicAuthAccount cannot be null or empty");
- expectedResponse.setStatus(PortalRestStatusEnum.ERROR);
- PortalRestResponse<String> actualResponse = basicAuthAccountController.createBasicAuthAccount(mockedRequest,
- mockedResponse, basicAuthCredentials);
- assertEquals(actualResponse, expectedResponse);
- }
-
- @Test
- public void getBasicAuthAccountTest() throws Exception {
- PortalRestResponse<List<BasicAuthCredentials>> expectedPortalResponse = new PortalRestResponse<List<BasicAuthCredentials>>();
- List<BasicAuthCredentials> basicAuthCredentialsList = new ArrayList<BasicAuthCredentials>();
- BasicAuthCredentials basicAuthCredentials = basicAuthCredentials();
- basicAuthCredentialsList.add(basicAuthCredentials);
-
- expectedPortalResponse.setMessage("Success");
- expectedPortalResponse.setResponse(null);
- expectedPortalResponse.setStatus(PortalRestStatusEnum.OK);
-
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(basicAuthAccountService.getAccountData()).thenReturn(null);
- PortalRestResponse<List<BasicAuthCredentials>> actualResponse = basicAuthAccountController
- .getBasicAuthAccount(mockedRequest, mockedResponse);
- assertEquals(expectedPortalResponse, actualResponse);
- }
-
- @Test
- public void getBasicAuthAccountIfSuperAdminTest() throws Exception {
- PortalRestResponse<List<BasicAuthCredentials>> expectedPortalResponse = new PortalRestResponse<List<BasicAuthCredentials>>();
- List<BasicAuthCredentials> basicAuthCredentialsList = new ArrayList<BasicAuthCredentials>();
- BasicAuthCredentials basicAuthCredentials = basicAuthCredentials();
- basicAuthCredentialsList.add(basicAuthCredentials);
-
- expectedPortalResponse.setMessage("UnAuthorized! Admin Only Operation");
- expectedPortalResponse.setResponse(new ArrayList<>());
- expectedPortalResponse.setStatus(PortalRestStatusEnum.ERROR);
-
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
- Mockito.when(basicAuthAccountService.getAccountData()).thenReturn(null);
- PortalRestResponse<List<BasicAuthCredentials>> actualResponse = basicAuthAccountController
- .getBasicAuthAccount(mockedRequest, mockedResponse);
- assertEquals(expectedPortalResponse, actualResponse);
- }
-
- @Test
- public void updateAccountTest() throws Exception {
- BasicAuthCredentials basicAuthCredentials = basicAuthCredentials();
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
- expectedResponse.setMessage("SUCCESS");
- expectedResponse.setResponse("");
- expectedResponse.setStatus(PortalRestStatusEnum.OK);
- long accountd = 1;
- PortalRestResponse<String> actualResponse = basicAuthAccountController.updateAccount(mockedRequest,
- mockedResponse, accountd, basicAuthCredentials);
- assertEquals(actualResponse, expectedResponse);
- }
-
- @Test
- public void updateAccountIfSuperAdminTest() throws Exception {
- BasicAuthCredentials basicAuthCredentials = basicAuthCredentials();
-
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
- PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
- expectedResponse.setMessage("Authorization Required");
- expectedResponse.setResponse("Admin Only Operation! ");
- expectedResponse.setStatus(PortalRestStatusEnum.ERROR);
- long accountd = 1;
- PortalRestResponse<String> actualResponse = basicAuthAccountController.updateAccount(mockedRequest,
- mockedResponse, accountd, basicAuthCredentials);
- assertEquals(actualResponse, expectedResponse);
- }
-
- @Test
- public void updateAccountIfInputNullTest() throws Exception {
- BasicAuthCredentials basicAuthCredentials = null;
-
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
- expectedResponse.setMessage("FAILURE");
- expectedResponse.setResponse("BasicAuthCredentials cannot be null or empty");
- expectedResponse.setStatus(PortalRestStatusEnum.ERROR);
- long accountd = 1;
- PortalRestResponse<String> actualResponse = basicAuthAccountController.updateAccount(mockedRequest,
- mockedResponse, accountd, basicAuthCredentials);
- assertEquals(actualResponse, expectedResponse);
- }
-
- @Test
- public void deleteAccountTest() throws Exception {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-
- PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
- expectedResponse.setMessage("SUCCESS");
- expectedResponse.setResponse("");
- expectedResponse.setStatus(PortalRestStatusEnum.OK);
- long accountd = 1;
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- PortalRestResponse<String> actualResponse = basicAuthAccountController.deleteAccount(mockedRequest,
- mockedResponse, accountd);
- assertEquals(actualResponse, expectedResponse);
- }
-
- @Test
- public void deleteAccountIfNotSuperAdminTest() throws Exception {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-
- PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
- expectedResponse.setMessage("Authorization Required");
- expectedResponse.setResponse("Admin Only Operation! ");
- expectedResponse.setStatus(PortalRestStatusEnum.ERROR);
- long accountd = 1;
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
- PortalRestResponse<String> actualResponse = basicAuthAccountController.deleteAccount(mockedRequest,
- mockedResponse, accountd);
- System.out.println(actualResponse);
- assertEquals(actualResponse, expectedResponse);
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.controller;
-
-import static org.junit.Assert.assertTrue;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.controller.CommonWidgetController;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.service.DashboardSearchService;
-import org.openecomp.portalapp.portal.service.DashboardSearchServiceImpl;
-import org.openecomp.portalapp.portal.transport.CommonWidgetMeta;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-
-public class CommonWidgetControllerTest {
-
- @Mock
- DashboardSearchService dashboardSearchService = new DashboardSearchServiceImpl();
-
- @InjectMocks
- CommonWidgetController commonWidgetController = new CommonWidgetController();
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
- NullPointerException nullPointerException = new NullPointerException();
-
- @SuppressWarnings("unchecked")
- @Test
- public void getWidgetDataTest() {
- String resourceType = "Test";
- PortalRestResponse<CommonWidgetMeta> acutualPoratlRestResponse = null;
- @SuppressWarnings("rawtypes")
- PortalRestResponse ecpectedPortalRestResponse = new PortalRestResponse();
- ecpectedPortalRestResponse.setMessage("Unexpected resource type Test");
- ecpectedPortalRestResponse.setResponse(null);
- ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
- acutualPoratlRestResponse = commonWidgetController.getWidgetData(mockedRequest, resourceType);
- assertTrue(acutualPoratlRestResponse.equals(ecpectedPortalRestResponse));
-
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void getWidgetDataTestNew() {
- String resourceType = "EVENTS";
- PortalRestResponse<CommonWidgetMeta> acutualPoratlRestResponse = null;
- @SuppressWarnings("rawtypes")
- PortalRestResponse ecpectedPortalRestResponse = new PortalRestResponse();
- ecpectedPortalRestResponse.setMessage("success");
- ecpectedPortalRestResponse.setResponse(null);
- ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
- acutualPoratlRestResponse = commonWidgetController.getWidgetData(mockedRequest, resourceType);
- assertTrue(acutualPoratlRestResponse.equals(ecpectedPortalRestResponse));
-
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void getWidgetDataExceptionTest() {
- String resourceType = "null";
- PortalRestResponse<CommonWidgetMeta> acutualPoratlRestResponse = null;
- @SuppressWarnings("rawtypes")
- PortalRestResponse ecpectedPortalRestResponse = new PortalRestResponse();
- ecpectedPortalRestResponse.setMessage("Unexpected resource type null");
- ecpectedPortalRestResponse.setResponse(null);
- ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
- acutualPoratlRestResponse = commonWidgetController.getWidgetData(mockedRequest, resourceType);
- assertTrue(acutualPoratlRestResponse.equals(ecpectedPortalRestResponse));
-
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.controller;
-
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.controller.ConsulClientController;
-import org.openecomp.portalapp.portal.domain.BEProperty;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.service.ConsulHealthService;
-import org.openecomp.portalapp.portal.service.ConsulHealthServiceImpl;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-
-import com.orbitz.consul.ConsulException;
-import com.orbitz.consul.model.health.ServiceHealth;
-
-import io.searchbox.client.config.exception.NoServerConfiguredException;
-
-public class ConsulClientControllerTest {
-
- @Mock
- ConsulHealthService consulHealthService = new ConsulHealthServiceImpl();
-
- @InjectMocks
- ConsulClientController consulClientController = new ConsulClientController();
-
- NoServerConfiguredException noServerConfiguredException = new NoServerConfiguredException(null);
-
- String service = "Test";
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
- NullPointerException nullPointerException = new NullPointerException();
- ConsulException consulException = new ConsulException(nullPointerException);
-
- @Test
- public void getServiceLocationTest() {
- PortalRestResponse<BEProperty> ecpectedPortalRestResponse = new PortalRestResponse<BEProperty>();
- ecpectedPortalRestResponse.setMessage("Success!");
- ecpectedPortalRestResponse.setResponse(null);
- ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
- PortalRestResponse<String> actualPortalRestRespone = new PortalRestResponse<String>();
- actualPortalRestRespone = consulClientController.getServiceLocation(mockedRequest, mockedResponse, service);
- assertTrue(actualPortalRestRespone.equals(ecpectedPortalRestResponse));
- }
-
- @Test
- public void getServiceLocationExceptionTest() {
- PortalRestResponse<BEProperty> ecpectedPortalRestResponse = new PortalRestResponse<BEProperty>();
- ecpectedPortalRestResponse.setMessage("Warning!");
- ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.WARN);
- PortalRestResponse<String> actualPortalRestRespone = new PortalRestResponse<String>();
- Mockito.when(consulHealthService.getServiceLocation(service, null)).thenThrow(noServerConfiguredException);
- actualPortalRestRespone = consulClientController.getServiceLocation(mockedRequest, mockedResponse, service);
- assertTrue(actualPortalRestRespone.getMessage().equals(ecpectedPortalRestResponse.getMessage()));
- assertTrue(actualPortalRestRespone.getStatus().equals(ecpectedPortalRestResponse.getStatus()));
-
- }
-
- @Test
- public void getServiceLocationExceptionConsulExceptionTest() {
- PortalRestResponse<BEProperty> ecpectedPortalRestResponse = new PortalRestResponse<BEProperty>();
- ecpectedPortalRestResponse.setMessage("Error!");
- ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
- PortalRestResponse<String> actualPortalRestRespone = new PortalRestResponse<String>();
- Mockito.when(consulHealthService.getServiceLocation(service, null)).thenThrow(consulException);
- actualPortalRestRespone = consulClientController.getServiceLocation(mockedRequest, mockedResponse, service);
- assertTrue(actualPortalRestRespone.getMessage().equals(ecpectedPortalRestResponse.getMessage()));
- assertTrue(actualPortalRestRespone.getStatus().equals(ecpectedPortalRestResponse.getStatus()));
- }
-
- public PortalRestResponse<List<ServiceHealth>> successResponse() {
- PortalRestResponse<List<ServiceHealth>> ecpectedPortalRestResponse = new PortalRestResponse<List<ServiceHealth>>();
- List<ServiceHealth> healths = new ArrayList<ServiceHealth>();
- ecpectedPortalRestResponse.setMessage("Success!");
- ecpectedPortalRestResponse.setResponse(healths);
- ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
- return ecpectedPortalRestResponse;
- }
-
- public PortalRestResponse<List<ServiceHealth>> errorResponse() {
- PortalRestResponse<List<ServiceHealth>> ecpectedPortalRestResponse = new PortalRestResponse<List<ServiceHealth>>();
- List<ServiceHealth> healths = new ArrayList<ServiceHealth>();
- ecpectedPortalRestResponse.setMessage("Error!");
- ecpectedPortalRestResponse.setResponse(healths);
- ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
- return ecpectedPortalRestResponse;
- }
-
- @Test
- public void getAllHealthyNodesTest() {
- PortalRestResponse<List<ServiceHealth>> ecpectedPortalRestResponse = successResponse();
- PortalRestResponse<List<ServiceHealth>> actualPortalRestRespone = new PortalRestResponse<List<ServiceHealth>>();
- actualPortalRestRespone = consulClientController.getAllHealthyNodes(mockedRequest, mockedResponse, service);
- assertTrue(actualPortalRestRespone.equals(ecpectedPortalRestResponse));
-
- }
-
- @Test
- public void getAllHealthyNodesExceptionTest() {
- PortalRestResponse<List<ServiceHealth>> ecpectedPortalRestResponse = errorResponse();
- PortalRestResponse<List<ServiceHealth>> actualPortalRestRespone = new PortalRestResponse<List<ServiceHealth>>();
- Mockito.when(consulHealthService.getAllHealthyNodes(service)).thenThrow(consulException);
- actualPortalRestRespone = consulClientController.getAllHealthyNodes(mockedRequest, mockedResponse, service);
- assertTrue(actualPortalRestRespone.equals(ecpectedPortalRestResponse));
- }
-
- @Test
- public void getAllNodesTest() {
- PortalRestResponse<List<ServiceHealth>> ecpectedPortalRestResponse = successResponse();
- PortalRestResponse<List<ServiceHealth>> actualPortalRestRespone = new PortalRestResponse<List<ServiceHealth>>();
- actualPortalRestRespone = consulClientController.getAllNodes(mockedRequest, mockedResponse, service);
- assertTrue(actualPortalRestRespone.equals(ecpectedPortalRestResponse));
- }
-
- @Test
- public void getAllNodesExceptionTest() {
- PortalRestResponse<List<ServiceHealth>> ecpectedPortalRestResponse = errorResponse();
- PortalRestResponse<List<ServiceHealth>> actualPortalRestRespone = new PortalRestResponse<List<ServiceHealth>>();
- Mockito.when(consulHealthService.getAllNodes(service)).thenThrow(consulException);
- actualPortalRestRespone = consulClientController.getAllNodes(mockedRequest, mockedResponse, service);
- assertTrue(actualPortalRestRespone.equals(ecpectedPortalRestResponse));
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.controller;
-
-import static org.junit.Assert.assertEquals;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.controller.DashboardController;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.service.DashboardSearchService;
-import org.openecomp.portalapp.portal.service.DashboardSearchServiceImpl;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
-import org.openecomp.portalapp.portal.transport.CommonWidget;
-import org.openecomp.portalapp.portal.transport.CommonWidgetMeta;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.domain.support.CollaborateList;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({EPUserUtils.class, CollaborateList.class, SystemProperties.class, EPCommonSystemProperties.class})
-public class DashboardControllerTest {
-
- @Mock
- DashboardSearchService searchService = new DashboardSearchServiceImpl();
-
- @InjectMocks
- DashboardController dashboardController = new DashboardController();
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-
- NullPointerException nullPointerException = new NullPointerException();
-
- MockEPUser mockUser = new MockEPUser();
-
- public CommonWidgetMeta mockCommonWidgetMeta() {
- CommonWidgetMeta commonWidgetMeta= new CommonWidgetMeta();
- List<CommonWidget> widgetList = new ArrayList<>();
- CommonWidget commonWidget = new CommonWidget();
- commonWidget.setId((long) 1);
- commonWidget.setCategory("test");
- commonWidget.setHref("testhref");
- commonWidget.setTitle("testTitle");
- commonWidget.setContent("testcontent");
- commonWidget.setEventDate("testDate");
- commonWidget.setSortOrder(1);
- widgetList.add(commonWidget);
- commonWidgetMeta.setItems(widgetList);
-
- return commonWidgetMeta;
- }
-
- public CommonWidget mockCommonWidget() {
-
- CommonWidget commonWidget = new CommonWidget();
- commonWidget.setId((long) 1);
- commonWidget.setCategory("test");
- commonWidget.setHref("testhref");
- commonWidget.setTitle("testTitle");
- commonWidget.setContent("testcontent");
- commonWidget.setEventDate("testDate");
- commonWidget.setSortOrder(1);
-
- return commonWidget;
- }
-
-
- @Test
- public void getWidgetDataTest() throws IOException {
-
- String resourceType = null;
- PortalRestResponse<CommonWidgetMeta> expectedData = new PortalRestResponse<CommonWidgetMeta>();
- expectedData.setStatus(PortalRestStatusEnum.ERROR);
- expectedData.setMessage("Unexpected resource type null");
- expectedData.setResponse(null);
-
- PortalRestResponse<CommonWidgetMeta> actualResponse = dashboardController.getWidgetData(mockedRequest, resourceType);
- assertEquals(expectedData,actualResponse);
- }
-
- @Test
- public void getWidgetDataWithValidResourceTest() throws IOException {
- String resourceType = "EVENTS";
- CommonWidgetMeta commonWidgetMeta= mockCommonWidgetMeta();
- commonWidgetMeta.setCategory(null);
-
- Mockito.when(searchService.getWidgetData(resourceType)).thenReturn(commonWidgetMeta);
- PortalRestResponse<CommonWidgetMeta> expectedData = new PortalRestResponse<CommonWidgetMeta>();
- expectedData.setStatus(PortalRestStatusEnum.OK);
- expectedData.setMessage("success");
- expectedData.setResponse(commonWidgetMeta);
-
- PortalRestResponse<CommonWidgetMeta> actualResponse = dashboardController.getWidgetData(mockedRequest, resourceType);
- System.out.println(actualResponse);
- assertEquals(expectedData,actualResponse);
- }
-
- @Test
- public void saveWidgetDataBulkNullTest() throws IOException {
- CommonWidgetMeta commonWidgetMeta= mockCommonWidgetMeta();
- commonWidgetMeta.setCategory(null);
-
- PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
- expectedData.setStatus(PortalRestStatusEnum.ERROR);
- expectedData.setMessage("ERROR");
- expectedData.setResponse("Category cannot be null or empty");
-
- PortalRestResponse<String> actualResponse = dashboardController.saveWidgetDataBulk(commonWidgetMeta);
- assertEquals(expectedData,actualResponse);
- }
-
- @Test
- public void saveWidgetUnexpectedDataBulkTest() throws IOException {
- CommonWidgetMeta commonWidgetMeta= mockCommonWidgetMeta();
- commonWidgetMeta.setCategory("Unexpected Data");
-
- PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
- expectedData.setStatus(PortalRestStatusEnum.ERROR);
- expectedData.setMessage("Unexpected resource type Unexpected Data");
- expectedData.setResponse(null);
-
- PortalRestResponse<String> actualResponse = dashboardController.saveWidgetDataBulk(commonWidgetMeta);
- assertEquals(expectedData,actualResponse);
-
- }
-
- @Test
- public void saveWidgetInvalidDataBulkTest() throws IOException {
- CommonWidgetMeta commonWidgetMeta= mockCommonWidgetMeta();
- commonWidgetMeta.setCategory("EVENTS");
-
- PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
- expectedData.setStatus(PortalRestStatusEnum.ERROR);
- expectedData.setMessage("Invalid category: test");
- expectedData.setResponse(null);
-
- PortalRestResponse<String> actualResponse = dashboardController.saveWidgetDataBulk(commonWidgetMeta);
- assertEquals(expectedData,actualResponse);
- }
-
- @Test
- public void saveWidgetDataBulkTest() throws IOException {
-
- List<CommonWidget> widgetList = new ArrayList<>();
- CommonWidget commonWidget = new CommonWidget("EVENTS", "http://test.com", "testTitle", "testcontent", "2017-07-01", 1);
- widgetList.add(commonWidget);
- CommonWidgetMeta commonWidgetMeta= new CommonWidgetMeta("EVENTS", widgetList);
-
-
-
- /* commonWidgetMeta.setItems(widgetList);
-
- commonWidgetMeta.setCategory("EVENTS");*/
-
- PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
- expectedData.setStatus(PortalRestStatusEnum.OK);
- expectedData.setMessage("success");
- expectedData.setResponse("success");
-
- Mockito.when(searchService.saveWidgetDataBulk(commonWidgetMeta)).thenReturn("success");
-
- PortalRestResponse<String> actualResponse = dashboardController.saveWidgetDataBulk(commonWidgetMeta);
- assertEquals(expectedData,actualResponse);
- }
-
- @Test
- public void saveWidgetDataNullTest() throws IOException {
-
- CommonWidget commonWidget = mockCommonWidget();
- commonWidget.setId((long)1);
- commonWidget.setContent("test");
- commonWidget.setCategory(null);
- PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
- expectedData.setStatus(PortalRestStatusEnum.ERROR);
- expectedData.setMessage("ERROR");
- expectedData.setResponse("Category cannot be null or empty");
-
- PortalRestResponse<String> actualResponse = dashboardController.saveWidgetData(commonWidget);
- assertEquals(expectedData,actualResponse);
-
- }
-
- @Test
- public void saveWidgetDataErrorTest() throws IOException {
-
- CommonWidget commonWidget = mockCommonWidget();
- PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
- expectedData.setStatus(PortalRestStatusEnum.ERROR);
- expectedData.setMessage("Invalid category: test");
- expectedData.setResponse(null);
-
- PortalRestResponse<String> actualResponse = dashboardController.saveWidgetData(commonWidget);
- assertEquals(expectedData,actualResponse);
- }
-
- @Test
- public void saveWidgetDataTest() throws IOException {
-
- CommonWidgetMeta commonWidgetMeta= new CommonWidgetMeta();
- List<CommonWidget> widgetList = new ArrayList<>();
- CommonWidget commonWidget = new CommonWidget();
- commonWidget.setId((long) 1);
- commonWidget.setCategory("EVENTS");
- commonWidget.setHref("http://test.com");
- commonWidget.setTitle("testTitle");
- commonWidget.setContent("testcontent");
- commonWidget.setEventDate("2017-07-01");
- commonWidget.setSortOrder(1);
- widgetList.add(commonWidget);
- commonWidgetMeta.setItems(widgetList);
-
- commonWidgetMeta.setCategory("EVENTS");
-
- PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
- expectedData.setStatus(PortalRestStatusEnum.OK);
- expectedData.setMessage("success");
- expectedData.setResponse("success");
-
- Mockito.when(searchService.saveWidgetData(commonWidget)).thenReturn("success");
-
- PortalRestResponse<String> actualResponse = dashboardController.saveWidgetData(commonWidget);
- assertEquals(expectedData,actualResponse);
-
- }
-
- @Test
- public void deleteWidgetDataTest() throws IOException {
-
- CommonWidget commonWidget = mockCommonWidget();
-
- PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
- expectedData.setStatus(PortalRestStatusEnum.OK);
- expectedData.setMessage("success");
- expectedData.setResponse(null);
-
- Mockito.when(searchService.saveWidgetData(commonWidget)).thenReturn("success");
-
- PortalRestResponse<String> actualResponse = dashboardController.deleteWidgetData(commonWidget);
- assertEquals(expectedData,actualResponse);
-
- }
-
- @Test
- public void getActiveUsersTest(){
- List<String> activeUsers = new ArrayList<>();
- List<String> expectedUsersList = new ArrayList<>();
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- String userId = user.getOrgUserId();
- Mockito.when(searchService.getRelatedUsers(userId)).thenReturn(activeUsers);
- expectedUsersList= dashboardController.getActiveUsers(mockedRequest);
- assertEquals(expectedUsersList, activeUsers);
- }
-
-
- @Test
- public void getActiveUsersExceptionTest(){
- List<String> activeUsers = new ArrayList<>();
- List<String> expectedUsersList = new ArrayList<>();
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- String userId = user.getOrgUserId();
- Mockito.when(searchService.getRelatedUsers(userId)).thenThrow(nullPointerException);
- expectedUsersList = dashboardController.getActiveUsers(mockedRequest);
- assertEquals(expectedUsersList, activeUsers);
- }
-
- @Test
- public void getOnlineUserUpdateRateTest(){
- PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
- expectedData.setStatus(PortalRestStatusEnum.OK);
- expectedData.setMessage("success");
- expectedData.setResponse("{onlineUserUpdateRate=1400000, onlineUserUpdateDuration=1400000}");
-
- PowerMockito.mockStatic(SystemProperties.class);
- PowerMockito.mockStatic(EPCommonSystemProperties.class);
- Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.ONLINE_USER_UPDATE_RATE)).thenReturn("1400");
- Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.ONLINE_USER_UPDATE_DURATION)).thenReturn("1400");
-
- PortalRestResponse<Map<String, String>> actualResponse = dashboardController.getOnlineUserUpdateRate(mockedRequest);
- assertEquals(expectedData.getStatus(),actualResponse.getStatus());
- }
-
- @Test
- public void getOnlineUserUpdateRateExceptionTest(){
- PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
- expectedData.setStatus(PortalRestStatusEnum.ERROR);
- expectedData.setMessage("java.lang.NullPointerException");
- expectedData.setResponse(null);
-
- PowerMockito.mockStatic(SystemProperties.class);
- PowerMockito.mockStatic(EPCommonSystemProperties.class);
- Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.ONLINE_USER_UPDATE_RATE)).thenThrow(nullPointerException);
- Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.ONLINE_USER_UPDATE_DURATION)).thenThrow(nullPointerException);
-
- PortalRestResponse<Map<String, String>> actualResponse = dashboardController.getOnlineUserUpdateRate(mockedRequest);
- assertEquals(expectedData,actualResponse);
- }
-
- @Test
- public void getWindowWidthThresholdForRightMenuTest(){
- PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
- expectedData.setStatus(PortalRestStatusEnum.OK);
- expectedData.setMessage("success");
- expectedData.setResponse("{windowWidth=1400}");
-
- PowerMockito.mockStatic(SystemProperties.class);
- PowerMockito.mockStatic(EPCommonSystemProperties.class);
- Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.WINDOW_WIDTH_THRESHOLD_RIGHT_MENU)).thenReturn("1400");
-
- PortalRestResponse<Map<String, String>> actualResponse = dashboardController.getWindowWidthThresholdForRightMenu(mockedRequest);
- assertEquals(expectedData.getStatus(),actualResponse.getStatus());
- }
-
- @Test
- public void getWindowWidthThresholdForRightMenuExceptionTest(){
- PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
- expectedData.setStatus(PortalRestStatusEnum.ERROR);
- expectedData.setMessage("java.lang.NullPointerException");
- expectedData.setResponse(null);
-
- PowerMockito.mockStatic(SystemProperties.class);
- PowerMockito.mockStatic(EPCommonSystemProperties.class);
- Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.WINDOW_WIDTH_THRESHOLD_RIGHT_MENU)).thenThrow(nullPointerException);
-
- PortalRestResponse<Map<String, String>> actualResponse = dashboardController.getWindowWidthThresholdForRightMenu(mockedRequest);
- assertEquals(expectedData,actualResponse);
- }
-
- @Test
- public void getWindowWidthThresholdForLeftMenuTest(){
- PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
- expectedData.setStatus(PortalRestStatusEnum.OK);
- expectedData.setMessage("success");
- expectedData.setResponse("{windowWidth=1400}");
-
- PowerMockito.mockStatic(SystemProperties.class);
- PowerMockito.mockStatic(EPCommonSystemProperties.class);
- Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.WINDOW_WIDTH_THRESHOLD_LEFT_MENU)).thenReturn("1400");
-
- PortalRestResponse<Map<String, String>> actualResponse = dashboardController.getWindowWidthThresholdForLeftMenu(mockedRequest);
- assertEquals(expectedData.getStatus(),actualResponse.getStatus());
- }
-
- @Test
- public void getWindowWidthThresholdForLeftMenuExceptionTest(){
- PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
- expectedData.setStatus(PortalRestStatusEnum.ERROR);
- expectedData.setMessage("java.lang.NullPointerException");
- expectedData.setResponse(null);
-
- PowerMockito.mockStatic(SystemProperties.class);
- PowerMockito.mockStatic(EPCommonSystemProperties.class);
- Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.WINDOW_WIDTH_THRESHOLD_LEFT_MENU)).thenThrow(nullPointerException);
-
- PortalRestResponse<Map<String, String>> actualResponse = dashboardController.getWindowWidthThresholdForLeftMenu(mockedRequest);
- assertEquals(expectedData,actualResponse);
- }
-
- @Test
- public void getActiveUsersNullTest(){
- PortalRestResponse<List<String>> expectedData = new PortalRestResponse<List<String>>();
- expectedData.setStatus(PortalRestStatusEnum.ERROR);
- expectedData.setMessage("User object is null? - check logs");
- expectedData.setResponse(new ArrayList<>());
-
- PortalRestResponse<List<String>> actualResponse = dashboardController.activeUsers(mockedRequest);
- assertEquals(expectedData,actualResponse);
- }
-
- @Test
- public void activeUsersTest(){
- EPUser user = mockUser.mockEPUser();
- PortalRestResponse<List<String>> expectedData = new PortalRestResponse<List<String>>();
- expectedData.setStatus(PortalRestStatusEnum.OK);
- expectedData.setMessage("success");
- expectedData.setResponse(new ArrayList<>());
- PowerMockito.mockStatic(EPUserUtils.class);
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- PortalRestResponse<List<String>> actualResponse = dashboardController.activeUsers(mockedRequest);
- assertEquals(expectedData,actualResponse);
- }
-
-// @Test
-// public void activeUsersExceptionTest(){
-// EPUser user = mockUser.mockEPUser();
-// user.setLoginId("test");
-// String loginId = "abc";
-// PortalRestResponse<List<String>> expectedData = new PortalRestResponse<List<String>>();
-// expectedData.setStatus(PortalRestStatusEnum.ERROR);
-// expectedData.setMessage("java.lang.NullPointerException");
-// expectedData.setResponse(null);
-//
-//// PowerMockito.mockStatic(EPUserUtils.class);
-// Mockito.when(searchService.getRelatedUsers(user.getLoginId(user.getLoginId()))).thenReturn(nullPointerException);
-// PortalRestResponse<List<String>> actualResponse = dashboardController.activeUsers(mockedRequest);
-// System.out.println(actualResponse);
-// //assertEquals(expectedData,actualResponse);
-// }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.controller;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.controller.EPFusionBaseController;
-import org.openecomp.portalapp.portal.controller.DashboardController;
-import org.openecomp.portalapp.portal.service.DashboardSearchService;
-import org.openecomp.portalapp.portal.service.DashboardSearchServiceImpl;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({EPUserUtils.class, SystemProperties.class})
-public class EPFusionBaseControllerTest {
-
- @Mock
- DashboardSearchService searchService = new DashboardSearchServiceImpl();
-
- @InjectMocks
- EPFusionBaseController epFusionBaseController; /*= mock(EPFusionBaseController.class);*/
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-
- NullPointerException nullPointerException = new NullPointerException();
-
- MockEPUser mockUser = new MockEPUser();
-
- @Test
- public void messagesTest(){
- Map<String, Object> expectedData = new HashMap<String, Object>();
- Map<String, Object> actualData = null;
-
- PowerMockito.mockStatic(SystemProperties.class);
- Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME)).then(null);
- actualData = epFusionBaseController.messages(mockedRequest);
- System.out.println();
-
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.controller;
-
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.controller.ExternalAccessRolesController;
-import org.openecomp.portalapp.portal.domain.CentralRoleFunction;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.service.ExternalAccessRolesService;
-import org.openecomp.portalapp.portal.service.ExternalAccessRolesServiceImpl;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
-import org.openecomp.portalapp.portal.transport.CentralRole;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.openecomp.portalsdk.core.domain.AuditLog;
-import org.openecomp.portalsdk.core.domain.Role;
-import org.springframework.http.HttpStatus;
-import org.springframework.web.client.HttpClientErrorException;
-public class ExternalAccessRolesControllerTest {
-
- @Mock
- ExternalAccessRolesService externalAccessRolesService = new ExternalAccessRolesServiceImpl();
-
- @InjectMocks
- ExternalAccessRolesController externalAccessRolesController = new ExternalAccessRolesController();
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
- @Mock
- AuditLog auditLog = new AuditLog();
-
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
- NullPointerException nullPointerException = new NullPointerException();
- HttpClientErrorException httpClientErrorException = new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Failed");
-
- MockEPUser mockUser = new MockEPUser();
- String loginId = "guestT";
- String uebKey = "testUebKey";
-
- @Test
- public void getUserTest() throws Exception {
- List<EPUser> userList = new ArrayList<>();
- Mockito.when(externalAccessRolesService.getUser(loginId)).thenReturn(userList);
- assertNull(externalAccessRolesController.getUser(mockedRequest, mockedResponse, loginId));
- }
-
- @Test
- public void getUserExceptionTest() throws Exception {
- Mockito.when(externalAccessRolesService.getUser(loginId))
- .thenThrow(nullPointerException);
- assertNull(externalAccessRolesController.getUser(mockedRequest, mockedResponse, loginId));
- }
-
- public EPApp mockApp()
- {
- EPApp app = new EPApp();
- app.setName("Test");
- app.setImageUrl("test");
- app.setDescription("test");
- app.setNotes("test");
- app.setUrl("test");
- app.setId((long) 1);
- app.setAppRestEndpoint("test");
- app.setAlternateUrl("test");
- app.setName("test");
- app.setMlAppName("test");
- app.setMlAppAdminId("test");
- app.setUsername("test");
- app.setAppPassword("test");
- app.setOpen(false);
- app.setEnabled(false);
- app.setUebKey("test");
- app.setUebSecret("test");
- app.setUebTopicName("test");
- app.setAppType(1);
- return app;
- }
-
- @Test
- public void getRolesForAppTest() throws Exception {
- List<EPApp> applicationList = new ArrayList<EPApp>();
- List<CentralRole> answer = new ArrayList<>();
- EPApp app = mockApp();
- applicationList.add(app);
- Mockito.when(externalAccessRolesService.getApp(mockedRequest.getHeader(uebKey))).thenReturn(applicationList);
- Mockito.doNothing().when(externalAccessRolesService).syncApplicationRolesWithEcompDB(app);
- Mockito.when(externalAccessRolesService.getRolesForApp(mockedRequest.getHeader(uebKey))).thenReturn(answer);
- assertEquals(externalAccessRolesController.getRolesForApp(mockedRequest, mockedResponse), answer);
- }
-
- @Test
- public void getRolesForAppExceptionTest() throws Exception {
- List<EPApp> applicationList = new ArrayList<EPApp>();
- List<CentralRole> answer = new ArrayList<>();
- EPApp app = mockApp();
- applicationList.add(app);
- Mockito.when(externalAccessRolesService.getApp(mockedRequest.getHeader(uebKey))).thenReturn(applicationList);
- Mockito.doNothing().when(externalAccessRolesService).syncApplicationRolesWithEcompDB(app);
- Mockito.when(externalAccessRolesService.getRolesForApp(mockedRequest.getHeader(uebKey)))
- .thenThrow(httpClientErrorException);
- assertNull(externalAccessRolesController.getRolesForApp(mockedRequest, mockedResponse));
- }
-
- @Test
- public void getRoleFunctionsListTest() throws Exception {
- List<CentralRoleFunction> answer = new ArrayList<>();
- Mockito.when(externalAccessRolesService.getRoleFuncList(mockedRequest.getHeader(uebKey))).thenReturn(answer);
- assertEquals(externalAccessRolesController.getRoleFunctionsList(mockedRequest, mockedResponse), answer);
- }
-
- @Test
- public void getRoleFunctionsListExceptionTest() throws Exception {
- Mockito.when(externalAccessRolesService.getRoleFuncList(mockedRequest.getHeader(uebKey)))
- .thenThrow(httpClientErrorException);
- assertNull(externalAccessRolesController.getRoleFunctionsList(mockedRequest, mockedResponse));
- }
-
- @Test
- public void getRoleInfoTest() throws Exception {
- CentralRole answer = new CentralRole();
- long roleId = 1;
- Mockito.when(externalAccessRolesService.getRoleInfo(roleId, mockedRequest.getHeader(uebKey)))
- .thenReturn(answer);
- assertEquals(externalAccessRolesController.getRoleInfo(mockedRequest, mockedResponse, roleId), answer);
- }
-
- @Test
- public void getRoleInfoExceptionTest() throws Exception {
- long roleId = 1;
- Mockito.when(externalAccessRolesService.getRoleInfo(roleId, mockedRequest.getHeader(uebKey)))
- .thenThrow(httpClientErrorException);
- assertNull(externalAccessRolesController.getRoleInfo(mockedRequest, mockedResponse, roleId));
- }
-
- @Test
- public void getRoleFunctionTest() throws Exception {
- CentralRoleFunction centralRoleFunction = new CentralRoleFunction();
- String code = "test_menu";
- Mockito.when(externalAccessRolesService.getRoleFunction(code, mockedRequest.getHeader(uebKey)))
- .thenReturn(centralRoleFunction);
- assertEquals(externalAccessRolesController.getRoleFunction(mockedRequest, mockedResponse, code),
- centralRoleFunction);
- }
-
- @Test
- public void getRoleFunctionExceptionTest() throws Exception {
- String code = "test_menu";
- Mockito.when(externalAccessRolesService.getRoleFunction(code, mockedRequest.getHeader(uebKey)))
- .thenThrow(httpClientErrorException);
- assertNull(externalAccessRolesController.getRoleFunction(mockedRequest, mockedResponse, code));
- }
-
- @Test
- public void saveRoleFunctionIfIsIsNotDeletedTest() throws Exception {
- List<EPApp> applicationList = new ArrayList<EPApp>();
- EPApp app = mockApp();
- applicationList.add(app);
- Mockito.when(externalAccessRolesService.getApp(mockedRequest.getHeader(uebKey))).thenReturn(applicationList);
- PortalRestResponse<String> portalRestResponse = null;
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage(null);
- expectedportalRestResponse.setResponse("Failed");
- PortalRestStatusEnum portalRestStatusEnum = null;
- expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
- String data = null;
- CentralRoleFunction centralRoleFunction = new CentralRoleFunction();
- Mockito.when(externalAccessRolesService.saveCentralRoleFunction(centralRoleFunction, app)).thenReturn(false);
- portalRestResponse = externalAccessRolesController.saveRoleFunction(mockedRequest, mockedResponse, data);
- assertEquals(portalRestResponse, expectedportalRestResponse);
- }
-
- @Test
- public void saveRoleFunctionExceptionTest() throws Exception {
- List<EPApp> applicationList = new ArrayList<EPApp>();
- EPApp app = mockApp();
- applicationList.add(app);
- Mockito.when(externalAccessRolesService.getApp(mockedRequest.getHeader(uebKey))).thenReturn(applicationList);
- PortalRestResponse<String> portalRestResponse = null;
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage(null);
- expectedportalRestResponse.setResponse("Failed");
- PortalRestStatusEnum portalRestStatusEnum = null;
- expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
- String data = null;
- CentralRoleFunction centralRoleFunction = new CentralRoleFunction();
- Mockito.when(externalAccessRolesService.saveCentralRoleFunction(centralRoleFunction, app)).thenThrow(nullPointerException);
- portalRestResponse = externalAccessRolesController.saveRoleFunction(mockedRequest, mockedResponse, data);
- System.out.println(portalRestResponse);
- assertEquals(portalRestResponse, expectedportalRestResponse);
- }
-
- @Test
- public void saveRoleFunctionTest() throws Exception {
- List<EPApp> applicationList = new ArrayList<EPApp>();
- List<CentralRole> answer = new ArrayList<>();
- EPApp app = mockApp();
- applicationList.add(app);
- Mockito.when(externalAccessRolesService.getApp(mockedRequest.getHeader(uebKey))).thenReturn(applicationList);
- PortalRestResponse<String> portalRestResponse = null;
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage(null);
- expectedportalRestResponse.setResponse("Failed");
- PortalRestStatusEnum portalRestStatusEnum = null;
- expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
- String data = null;
- CentralRoleFunction centralRoleFunction = new CentralRoleFunction();
- Mockito.when(externalAccessRolesService.saveCentralRoleFunction(centralRoleFunction, app)).thenReturn(true);
- portalRestResponse = externalAccessRolesController.saveRoleFunction(mockedRequest, mockedResponse, data);
- System.out.println(portalRestResponse);
- assertEquals(portalRestResponse, expectedportalRestResponse);
- }
-
-// @Test
-// public void deleteRoleFunctionTest() throws Exception {
-// PortalRestResponse<String> portalRestResponse = null;
-// PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-// expectedportalRestResponse.setMessage("Successfully Deleted");
-// expectedportalRestResponse.setResponse("Success");
-// PortalRestStatusEnum portalRestStatusEnum = null;
-// EPUser user = mockUser.mockEPUser();
-// EPApp app = mockApp();
-// expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
-// String code ="testNew";
-// Mockito.when(externalAccessRolesService.getUser(mockedRequest.getHeader("LOGIN_ID"))).thenReturn((List<EPUser>) user);
-// Mockito.when(externalAccessRolesService.getApp(mockedRequest.getHeader("UEBKEY")).get(0)).thenReturn(app);
-// Mockito.when(externalAccessRolesService.deleteCentralRoleFunction(code, app)).thenReturn(true);
-// portalRestResponse = externalAccessRolesController.deleteRoleFunction(mockedRequest, mockedResponse, code);
-// assertEquals(portalRestResponse, expectedportalRestResponse);
-// }
-
- @Test
- public void getActiveRolesTest() throws Exception {
- List<CentralRole> cenRole = new ArrayList<>();
- Mockito.when(externalAccessRolesService.getActiveRoles(mockedRequest.getHeader(uebKey))).thenReturn(cenRole);
- List<CentralRole> expectedCenRole = externalAccessRolesController.getActiveRoles(mockedRequest, mockedResponse);
- assertEquals(expectedCenRole, cenRole);
- }
-
- @Test
- public void getActiveRolesExceptionTest() throws Exception {
- Mockito.when(externalAccessRolesService.getActiveRoles(mockedRequest.getHeader(uebKey)))
- .thenThrow(httpClientErrorException);
- assertNull(externalAccessRolesController.getActiveRoles(mockedRequest, mockedResponse));
- }
-
- @Test
- public void deleteDependcyRoleRecordExceptionTest() throws Exception {
- PortalRestResponse<String> portalRestResponse = null;
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("Failed to deleteDependencyRoleRecord");
- expectedportalRestResponse.setResponse("Failed");
- PortalRestStatusEnum portalRestStatusEnum = null;
- expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
- long roleId = 123;
- portalRestResponse = externalAccessRolesController.deleteDependencyRoleRecord(mockedRequest, mockedResponse, roleId);
- assertEquals(expectedportalRestResponse, portalRestResponse);
- }
-
- @Test
- public void bulkUploadFunctionsTest() throws Exception {
- Integer result = 0;
- Mockito.when(externalAccessRolesService.bulkUploadFunctions(mockedRequest.getHeader(uebKey)))
- .thenReturn(result);
- PortalRestResponse<String> portalRestResponse = null;
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("Successfully added: 0");
- expectedportalRestResponse.setResponse("Success");
- PortalRestStatusEnum portalRestStatusEnum = null;
- expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
- portalRestResponse = externalAccessRolesController.bulkUploadFunctions(mockedRequest, mockedResponse);
- assertEquals(portalRestResponse, expectedportalRestResponse);
- }
-
- @Test
- public void bulkUploadFunctionsExceptionTest() throws Exception {
- Mockito.when(externalAccessRolesService.bulkUploadFunctions(mockedRequest.getHeader(uebKey)))
- .thenThrow(httpClientErrorException);
- PortalRestResponse<String> portalRestResponse = null;
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("Failed to bulkUploadFunctions");
- expectedportalRestResponse.setResponse("Failed");
- PortalRestStatusEnum portalRestStatusEnum = null;
- expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
- portalRestResponse = externalAccessRolesController.bulkUploadFunctions(mockedRequest, mockedResponse);
- assertEquals(portalRestResponse, expectedportalRestResponse);
- }
-
- @Test
- public void bulkUploadRolesTest() throws Exception {
- Integer result = 0;
- PortalRestResponse<String> portalRestResponse = null;
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("Successfully added: 0");
- expectedportalRestResponse.setResponse("Success");
- PortalRestStatusEnum portalRestStatusEnum = null;
- expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
- Mockito.when(externalAccessRolesService.bulkUploadRoles(mockedRequest.getHeader(uebKey))).thenReturn(result);
- portalRestResponse = externalAccessRolesController.bulkUploadRoles(mockedRequest, mockedResponse);
- assertEquals(portalRestResponse, expectedportalRestResponse);
- }
-
- @Test
- public void bulkUploadRolesTestException() throws Exception {
- Mockito.when(externalAccessRolesService.bulkUploadRoles(mockedRequest.getHeader(uebKey)))
- .thenThrow(httpClientErrorException);
- PortalRestResponse<String> portalRestResponse = null;
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("Failed to bulkUploadRoles");
- expectedportalRestResponse.setResponse("Failed");
- PortalRestStatusEnum portalRestStatusEnum = null;
- expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
- portalRestResponse = externalAccessRolesController.bulkUploadRoles(mockedRequest, mockedResponse);
- assertEquals(portalRestResponse, expectedportalRestResponse);
- }
-
- @Test
- public void bulkUploadRoleFunctionsTest() throws Exception {
- Integer result = 0;
- PortalRestResponse<String> portalRestResponse = null;
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("Successfully added: 0");
- expectedportalRestResponse.setResponse("Success");
- PortalRestStatusEnum portalRestStatusEnum = null;
- expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
- Mockito.when(externalAccessRolesService.bulkUploadRolesFunctions(mockedRequest.getHeader(uebKey)))
- .thenReturn(result);
- portalRestResponse = externalAccessRolesController.bulkUploadRoleFunctions(mockedRequest, mockedResponse);
- assertEquals(portalRestResponse, expectedportalRestResponse);
- }
-
- @Test
- public void bulkUploadRoleFunctionsException() throws Exception {
- Mockito.when(externalAccessRolesService.bulkUploadRolesFunctions(mockedRequest.getHeader(uebKey)))
- .thenThrow(httpClientErrorException);
- PortalRestResponse<String> portalRestResponse = null;
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("Failed to bulkUploadRoleFunctions");
- expectedportalRestResponse.setResponse("Failed");
- PortalRestStatusEnum portalRestStatusEnum = null;
- expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
- portalRestResponse = externalAccessRolesController.bulkUploadRoleFunctions(mockedRequest, mockedResponse);
- assertEquals(portalRestResponse, expectedportalRestResponse);
- }
-
- @Test
- public void bulkUploadUserRolesTest() throws Exception {
- Integer result = 0;
- PortalRestResponse<String> portalRestResponse = null;
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("Successfully added: 0");
- expectedportalRestResponse.setResponse("Success");
- PortalRestStatusEnum portalRestStatusEnum = null;
- expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
- Mockito.when(externalAccessRolesService.bulkUploadUserRoles(mockedRequest.getHeader(uebKey)))
- .thenReturn(result);
- portalRestResponse = externalAccessRolesController.bulkUploadUserRoles(mockedRequest, mockedResponse);
- assertEquals(portalRestResponse, expectedportalRestResponse);
- }
-
- @Test
- public void bulkUploadUserRolesExceptionTest() throws Exception {
- Mockito.when(externalAccessRolesService.bulkUploadUserRoles(mockedRequest.getHeader(uebKey)))
- .thenThrow(httpClientErrorException);
- PortalRestResponse<String> portalRestResponse = null;
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("Failed to bulkUploadUserRoles");
- expectedportalRestResponse.setResponse("Failed");
- PortalRestStatusEnum portalRestStatusEnum = null;
- expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
- portalRestResponse = externalAccessRolesController.bulkUploadUserRoles(mockedRequest, mockedResponse);
- assertEquals(portalRestResponse, expectedportalRestResponse);
- }
-
- @Test
- public void bulkUploadPartnerFunctionsTest() throws Exception {
- PortalRestResponse<String> portalRestResponse = null;
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("Successfully added");
- expectedportalRestResponse.setResponse("Success");
- PortalRestStatusEnum portalRestStatusEnum = null;
- expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
- portalRestResponse = externalAccessRolesController.bulkUploadPartnerFunctions(mockedRequest, mockedResponse, null);
- assertEquals(portalRestResponse, expectedportalRestResponse);
- }
-
-
- @Test
- public void bulkUploadPartnerRolesTest() throws Exception {
- PortalRestResponse<String> portalRestResponse = null;
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("Successfully added");
- expectedportalRestResponse.setResponse("Success");
- PortalRestStatusEnum portalRestStatusEnum = null;
- expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
- List<Role> upload = new ArrayList<>();
- portalRestResponse = externalAccessRolesController.bulkUploadPartnerRoles(mockedRequest, mockedResponse,
- upload);
- assertEquals(portalRestResponse, expectedportalRestResponse);
- }
-
- @Test
- public void bulkUploadPartnerRolesExceptionTest() throws Exception
- {
- ExternalAccessRolesService externalAccessRolesService = null;
- PortalRestResponse<String> portalRestResponse = null;
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("Successfully added");
- expectedportalRestResponse.setResponse("Success");
- PortalRestStatusEnum portalRestStatusEnum = null;
- expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
- List<Role> upload = new ArrayList<>();
- portalRestResponse = externalAccessRolesController.bulkUploadPartnerRoles(mockedRequest, mockedResponse,
- upload);
- assertEquals(portalRestResponse, expectedportalRestResponse);
- }
-
- @Test
- public void getMenuFunctionsTest() throws Exception {
- List<String> functionsList = new ArrayList<>();
- Mockito.when(externalAccessRolesService.getMenuFunctionsList(mockedRequest.getHeader(uebKey)))
- .thenReturn(functionsList);
- List<String> expectedFunctionsList = externalAccessRolesController.getMenuFunctions(mockedRequest,
- mockedResponse);
- assertEquals(functionsList, expectedFunctionsList);
- }
-
- @Test
- public void getMenuFunctionsExceptionTest() throws Exception {
- Mockito.when(externalAccessRolesService.getMenuFunctionsList(mockedRequest.getHeader(uebKey)))
- .thenThrow(httpClientErrorException);
- assertNull(externalAccessRolesController.getMenuFunctions(mockedRequest, mockedResponse));
- }
-
-// @Test
-// public void getUsersOfApplicationTest() throws Exception {
-// List<String> users = new ArrayList<>();
-// Mockito.when(externalAccessRolesService.getAllUsers(mockedRequest.getHeader(uebKey))).thenReturn(users);
-// List<String> expectedusers = externalAccessRolesController.getUsersOfApplication(mockedRequest, mockedResponse);
-// assertEquals(users, expectedusers);
-// }
-
-// @Test
-// public void getUsersOfApplicationExceptionTest() throws Exception {
-// Mockito.when(externalAccessRolesService.getAllUsers(mockedRequest.getHeader(uebKey)))
-// .thenThrow(httpClientErrorException);
-// assertNull(externalAccessRolesController.getUsersOfApplication(mockedRequest, mockedResponse));
-// }
-
- @Test
- public void saveRoleExceptionTest() throws Exception {
- Role role = new Role();
- PortalRestResponse<String> portalRestResponse = null;
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("Failed to saveRole");
- expectedportalRestResponse.setResponse("Failed");
- PortalRestStatusEnum portalRestStatusEnum = null;
- expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
- List<Role> upload = new ArrayList<>();
- portalRestResponse = externalAccessRolesController.saveRole(mockedRequest, mockedResponse,role);
- assertEquals(portalRestResponse, expectedportalRestResponse);
- }
-
- @Test
- public void deleteRoleExceptionTest() throws Exception {
- String role = "TestNew";
- PortalRestResponse<String> portalRestResponse = null;
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("Failed to deleteRole for 'TestNew'");
- expectedportalRestResponse.setResponse("Failed");
- PortalRestStatusEnum portalRestStatusEnum = null;
- expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
- portalRestResponse = externalAccessRolesController.deleteRole(mockedRequest, mockedResponse,role);
- assertEquals(portalRestResponse, expectedportalRestResponse);
- }
-
-
- @Test
- public void bulkUploadPartnerRoleFunctionsTest() throws Exception {
- PortalRestResponse<String> portalRestResponse = null;
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("Successfully added");
- expectedportalRestResponse.setResponse("Success");
- PortalRestStatusEnum portalRestStatusEnum = null;
- expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
- List<Role> upload = new ArrayList<>();
- portalRestResponse = externalAccessRolesController.bulkUploadPartnerRoleFunctions(mockedRequest, mockedResponse,upload);
- assertEquals(portalRestResponse, expectedportalRestResponse);
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.controller;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.controller.ExternalAppsRestfulController;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.AdminRolesServiceImpl;
-import org.openecomp.portalapp.portal.service.EPLoginService;
-import org.openecomp.portalapp.portal.service.EPLoginServiceImpl;
-import org.openecomp.portalapp.portal.service.EPRoleService;
-import org.openecomp.portalapp.portal.service.EPRoleServiceImpl;
-import org.openecomp.portalapp.portal.service.FunctionalMenuService;
-import org.openecomp.portalapp.portal.service.FunctionalMenuServiceImpl;
-import org.openecomp.portalapp.portal.service.UserNotificationService;
-import org.openecomp.portalapp.portal.service.UserNotificationServiceImpl;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
-import org.openecomp.portalapp.portal.transport.FavoritesFunctionalMenuItemJson;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuItem;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.service.DataAccessServiceImpl;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-import org.slf4j.MDC;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({ MDC.class, EPCommonSystemProperties.class })
-public class ExternalAppsRestfulControllerTest {
-
- @InjectMocks
- ExternalAppsRestfulController externalAppsRestfulController = new ExternalAppsRestfulController();
- @Mock
- FunctionalMenuService functionalMenuService = new FunctionalMenuServiceImpl();
-
- @Mock
- EPLoginService epLoginService = new EPLoginServiceImpl();
-
- @Mock
- AdminRolesService adminRolesService = new AdminRolesServiceImpl();
-
- @Mock
- UserNotificationService userNotificationService = new UserNotificationServiceImpl();
-
- @Mock
- EPRoleService epRoleService = new EPRoleServiceImpl();
-
- @Mock
- EcompPortalUtils EcompPortalUtils = new EcompPortalUtils();
-
- @Mock
- DataAccessService DataAccessService = new DataAccessServiceImpl();
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
- NullPointerException nullPointerException = new NullPointerException();
-
- MockEPUser mockUser = new MockEPUser();
-
- @Test(expected = Exception.class)
- public void getFunctionalMenuItemsForUserIfUSerNullTest() throws
- Exception
- {
- PowerMockito.mockStatic(EPCommonSystemProperties.class);
- PowerMockito.mockStatic(MDC.class);
- EPUser epUser = null;
- String loginId = "guestT";
- Mockito.when(MDC.get(EPCommonSystemProperties.PARTNER_NAME)).thenReturn("Test");
- Mockito.when(epLoginService.findUserWithoutPwd(loginId)).thenReturn(epUser);
- externalAppsRestfulController.getFunctionalMenuItemsForUser(mockedRequest,
- mockedResponse);
- }
-
- @Test
- public void getFunctionalMenuItemsForUserIfSuperAdminTest() throws Exception {
- PowerMockito.mockStatic(EPCommonSystemProperties.class);
- PowerMockito.mockStatic(MDC.class);
- EPUser epUser = mockUser.mockEPUser();
- epUser.setId((long) 1);
- epUser.setLoginId("guestT");
- String loginId = "guestT";
- Mockito.when(MDC.get(EPCommonSystemProperties.PARTNER_NAME)).thenReturn("Test");
- Mockito.when(epLoginService.findUserWithoutPwd(loginId)).thenReturn(epUser);
- List<FunctionalMenuItem> expectedList = new ArrayList<FunctionalMenuItem>();
- FunctionalMenuItem functionalMenuItem = new FunctionalMenuItem();
- expectedList.add(functionalMenuItem);
- Mockito.when(mockedRequest.getHeader("LoginId")).thenReturn("guestT");
- Mockito.when(adminRolesService.isSuperAdmin(epUser)).thenReturn(true);
- Mockito.when(functionalMenuService.getFunctionalMenuItems()).thenReturn(expectedList);
- List<FunctionalMenuItem> actualList = externalAppsRestfulController.getFunctionalMenuItemsForUser(mockedRequest,
- mockedResponse);
- assertNull(actualList.get(0).menuId);
- }
-
- @Test
- public void getFunctionalMenuItemsForUserTest() throws Exception {
- PowerMockito.mockStatic(EPCommonSystemProperties.class);
- PowerMockito.mockStatic(MDC.class);
- EPUser epUser = mockUser.mockEPUser();
- epUser.setId((long) 1);
- epUser.setLoginId("guestT");
- String loginId = "guestT";
- Mockito.when(MDC.get(EPCommonSystemProperties.PARTNER_NAME)).thenReturn("Test");
- Mockito.when(epLoginService.findUserWithoutPwd(loginId)).thenReturn(epUser);
- List<FunctionalMenuItem> expectedList = new ArrayList<FunctionalMenuItem>();
- FunctionalMenuItem functionalMenuItem = new FunctionalMenuItem();
- expectedList.add(functionalMenuItem);
- Mockito.when(mockedRequest.getHeader("LoginId")).thenReturn("guestT");
- Mockito.when(adminRolesService.isSuperAdmin(epUser)).thenReturn(false);
- Mockito.when(functionalMenuService.getFunctionalMenuItemsForUser(epUser.getOrgUserId()))
- .thenReturn(expectedList);
- List<FunctionalMenuItem> actualList = externalAppsRestfulController.getFunctionalMenuItemsForUser(mockedRequest,
- mockedResponse);
- assertNull(actualList.get(0).menuId);
- }
-
- @Test(expected = Exception.class)
- public void getFavoritesForUserIfUserNullTest() throws Exception {
- List<FavoritesFunctionalMenuItemJson> favorites = new ArrayList<FavoritesFunctionalMenuItemJson>();
- FavoritesFunctionalMenuItemJson favoritesFunctionalMenuItemJson = new FavoritesFunctionalMenuItemJson();
- favorites.add(favoritesFunctionalMenuItemJson);
- PowerMockito.mockStatic(EPCommonSystemProperties.class);
- PowerMockito.mockStatic(MDC.class);
- Mockito.when(mockedRequest.getHeader(EPCommonSystemProperties.MDC_LOGIN_ID)).thenReturn("Login_URL");
- Mockito.when(MDC.get(EPCommonSystemProperties.PARTNER_NAME)).thenReturn("Test");
- EPUser epUser = null;
- externalAppsRestfulController.getFavoritesForUser(mockedRequest, mockedResponse);
- }
-
- @Test
- public void getFavoritesForUserTest() throws Exception {
- PowerMockito.mockStatic(EPCommonSystemProperties.class);
- PowerMockito.mockStatic(MDC.class);
- EPUser epUser = mockUser.mockEPUser();
- epUser.setId((long) 1);
- epUser.setLoginId("guestT");
- String loginId = "guestT";
- Mockito.when(MDC.get(EPCommonSystemProperties.PARTNER_NAME)).thenReturn("Test");
- List<FavoritesFunctionalMenuItemJson> favorites = new ArrayList<FavoritesFunctionalMenuItemJson>();
- FavoritesFunctionalMenuItemJson favoritesFunctionalMenuItemJson = new FavoritesFunctionalMenuItemJson();
- favorites.add(favoritesFunctionalMenuItemJson);
- Mockito.when(mockedRequest.getHeader(EPCommonSystemProperties.MDC_LOGIN_ID)).thenReturn("Login_URL");
- Mockito.when(MDC.get(EPCommonSystemProperties.PARTNER_NAME)).thenReturn("Test");
- Mockito.when(epLoginService.findUserWithoutPwd("Login_URL")).thenReturn(epUser);
- Mockito.when(functionalMenuService.getFavoriteItems(epUser.getId())).thenReturn(favorites);
- List<FavoritesFunctionalMenuItemJson> actaulFavorites = externalAppsRestfulController
- .getFavoritesForUser(mockedRequest, mockedResponse);
- assertEquals(actaulFavorites.size(), 1);
- }
-}
+++ /dev/null
-/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ================================================================================
- */
-package org.openecomp.portalapp.portal.test.controller;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.mockito.runners.MockitoJUnitRunner;
-import org.openecomp.portalapp.portal.controller.FunctionalMenuController;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.AdminRolesServiceImpl;
-import org.openecomp.portalapp.portal.service.FunctionalMenuService;
-import org.openecomp.portalapp.portal.service.FunctionalMenuServiceImpl;
-import org.openecomp.portalapp.portal.service.SearchService;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
-import org.openecomp.portalapp.portal.test.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.transport.BusinessCardApplicationRole;
-import org.openecomp.portalapp.portal.transport.BusinessCardApplicationRolesList;
-import org.openecomp.portalapp.portal.transport.FavoritesFunctionalMenuItem;
-import org.openecomp.portalapp.portal.transport.FavoritesFunctionalMenuItemJson;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.FieldsValidator.FieldName;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuItem;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuItemWithRoles;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest(SystemProperties.class)
-public class FunctionalMenuControllerTest extends MockitoTestSuite {
-
- String userid = "ab1234";
-
- @Mock
- FunctionalMenuService functionalMenuService = new FunctionalMenuServiceImpl();
-
- @InjectMocks
- FunctionalMenuController functionalMenuController = new FunctionalMenuController();
-
- @Mock
- private DataAccessService dataAccessService;
-
- @Mock
- SearchService searchService;
-
- @Mock
- AdminRolesService adminRolesService = new AdminRolesServiceImpl();
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-
- @InjectMocks
- EPUserUtils ePUserUtils = new EPUserUtils();
-
- @Mock
- EPUser epuser;
-
- MockEPUser mockUser = new MockEPUser();
-
- List<BusinessCardApplicationRolesList> appRoles = new ArrayList<BusinessCardApplicationRolesList>();
- List<BusinessCardApplicationRolesList> appRolesActual = new ArrayList<BusinessCardApplicationRolesList>();
-
- List<BusinessCardApplicationRole> userAppRoleList = new ArrayList<BusinessCardApplicationRole>();
-
- public List<BusinessCardApplicationRole> mockBusinessCardApplicationRole() {
- List<BusinessCardApplicationRole> userAppRoleList = new ArrayList<BusinessCardApplicationRole>();
-
- BusinessCardApplicationRole businessCardApplicationRole = new BusinessCardApplicationRole();
- businessCardApplicationRole.setRoleName("ADMIN");
- businessCardApplicationRole.setAppName("ASDC");
-
- BusinessCardApplicationRole businessCardApplicationRole1 = new BusinessCardApplicationRole();
- businessCardApplicationRole1.setAppName("ASDC");
- businessCardApplicationRole1.setRoleName("Tester");
-
- userAppRoleList.add(businessCardApplicationRole);
- userAppRoleList.add(businessCardApplicationRole1);
- return userAppRoleList;
- }
-
- public List<BusinessCardApplicationRolesList> mockBusinessCardApplicationRolesList() {
- List<BusinessCardApplicationRolesList> appRolesActual = new ArrayList<BusinessCardApplicationRolesList>();
-
- BusinessCardApplicationRolesList businessCardApplicationRolesList = new BusinessCardApplicationRolesList();
- businessCardApplicationRolesList.setAppName("ASDC");
-
- List<String> roleNames = new ArrayList<String>();
- roleNames.add("ADMIN");
- roleNames.add("Tester");
- businessCardApplicationRolesList.setRoleNames(roleNames);
-
- appRolesActual.add(businessCardApplicationRolesList);
- return appRolesActual;
- }
-
- @Test
- public void getAppListTestIfAppAlredyExistsBusinessCardApplicationRolesList() throws IOException {
-
- userAppRoleList = mockBusinessCardApplicationRole();
- appRolesActual = mockBusinessCardApplicationRolesList();
-
- Mockito.when(functionalMenuService.getUserAppRolesList(userid)).thenReturn(userAppRoleList);
-
- appRoles = functionalMenuController.getAppList(mockedRequest, userid);
-
- assertEquals(appRolesActual.size(), appRoles.size());
- assertEquals(appRolesActual.get(0).getAppName(), appRoles.get(0).getAppName());
- assertEquals(appRolesActual.get(0).getRoleNames(), appRoles.get(0).getRoleNames());
-
- }
-
- @Test
- public void getAppListTestIfAppDoesnotExistsInBusinessCardApplicationRolesList() throws IOException {
-
- userAppRoleList = mockBusinessCardApplicationRole();
- BusinessCardApplicationRole businessCardApplicationRole = new BusinessCardApplicationRole();
- businessCardApplicationRole.setAppName("CCD");
- businessCardApplicationRole.setRoleName("ADMIN");
- userAppRoleList.add(businessCardApplicationRole);
- appRolesActual = mockBusinessCardApplicationRolesList();
- BusinessCardApplicationRolesList businessCardApplicationRolesList = new BusinessCardApplicationRolesList();
- businessCardApplicationRolesList.setAppName("CCD");
- List<String> roleNames1 = new ArrayList<String>();
- roleNames1.add("ADMIN");
- businessCardApplicationRolesList.setRoleNames(roleNames1);
- appRolesActual.add(businessCardApplicationRolesList);
- Mockito.when(functionalMenuService.getUserAppRolesList(userid)).thenReturn(userAppRoleList);
- appRoles = functionalMenuController.getAppList(mockedRequest, userid);
- assertEquals(appRolesActual.size(), appRoles.size());
- assertEquals(appRolesActual.get(0).getAppName(), appRoles.get(0).getAppName());
- assertEquals(appRolesActual.get(0).getRoleNames(), appRoles.get(0).getRoleNames());
- assertEquals(appRolesActual.get(1).getAppName(), appRoles.get(1).getAppName());
- assertEquals(appRolesActual.get(1).getRoleNames(), appRoles.get(1).getRoleNames());
-
- }
-
- @Test
- public void regenerateAncestorTableTest() {
- EPUser user = mockUser.mockEPUser();
-
- HttpSession session = mockedRequest.getSession();
- session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- FieldsValidator acutualFieldValidator = null;
- FieldsValidator expectedFieldValidator = new FieldsValidator();
- List<FieldName> fields = new ArrayList<>();
- expectedFieldValidator.setHttpStatusCode((long) 200);
- expectedFieldValidator.setFields(fields);
- expectedFieldValidator.setErrorCode(null);
- Mockito.when(!adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(functionalMenuService.regenerateAncestorTable()).thenReturn(expectedFieldValidator);
- acutualFieldValidator = functionalMenuController.regenerateAncestorTable(mockedRequest, mockedResponse);
- assertTrue(acutualFieldValidator.equals(expectedFieldValidator));
- }
-
- @Test
- public void getFunctionalMenuStaticInfoExceptionTest(){
- String fnMenuStaticactualResponse = null;
- String fnMenuStaticexpectedResponse = null;
- String orgUserIdStr = null;
-
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(searchService.searchUserByUserId(orgUserIdStr)).thenReturn(user);
- fnMenuStaticactualResponse = functionalMenuController.getFunctionalMenuStaticInfo(mockedRequest, mockedResponse);
-
- assertEquals(fnMenuStaticactualResponse, fnMenuStaticexpectedResponse);
-
- }
-
- @Test
- public void getFunctionalMenuStaticInfoTest(){
- String fnMenuStaticactualResponse = null;
- String fnMenuStaticexpectedResponse = "{\"firstName\":\"test\",\"lastName\":\"test\",\"last_login\":\"09/08/2017 03:48:13-0400\",\"userId\":\"guestT\",\"email\":\"test\"}";
- String orgUserIdStr = null;
-
- EPUser user = mockUser.mockEPUser();
- user.setEmail("test");
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(searchService.searchUserByUserId(orgUserIdStr)).thenReturn(user);
- fnMenuStaticactualResponse = functionalMenuController.getFunctionalMenuStaticInfo(mockedRequest, mockedResponse);
- assertEquals(fnMenuStaticactualResponse.length(), fnMenuStaticexpectedResponse.length());
- }
-
- @Test
- public void getMenuItemsForAuthUserNullTest(){
- List<FunctionalMenuItem> actualmenuItems = null;
- List<FunctionalMenuItem> expectedmenuItems = null;
-
- actualmenuItems = functionalMenuController.getMenuItemsForAuthUser(mockedRequest, mockedResponse);
- assertEquals(actualmenuItems, expectedmenuItems);
- }
-
- @Test
- public void getMenuItemsForAuthUserIsSuperAdminTest(){
- List<FunctionalMenuItem> actualmenuItems = null;
- List<FunctionalMenuItem> expectedmenuItems = new ArrayList<FunctionalMenuItem>();
- EPUser user = mockUser.mockEPUser();
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-
- actualmenuItems = functionalMenuController.getMenuItemsForAuthUser(mockedRequest, mockedResponse);
- assertEquals(actualmenuItems, expectedmenuItems);
- }
-
- @Test
- public void getMenuItemsForAuthUserTest(){
- List<FunctionalMenuItem> actualmenuItems = null;
- List<FunctionalMenuItem> expectedmenuItems = new ArrayList<FunctionalMenuItem>();
- EPUser user = mockUser.mockEPUser();
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-
- actualmenuItems = functionalMenuController.getMenuItemsForAuthUser(mockedRequest, mockedResponse);
- assertEquals(actualmenuItems, expectedmenuItems);
- }
-
- @Test
- public void getFunctionalMenuItemDetailsBadPermissionTest(){
- Integer menuId = 1234;
- FunctionalMenuItem actualmenuItem = null;
- FunctionalMenuItem expectedmenuItem = null;
- EPUser user = mockUser.mockEPUser();
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-
- actualmenuItem = functionalMenuController.getFunctionalMenuItemDetails(mockedRequest, menuId, mockedResponse);
- assertEquals(actualmenuItem, expectedmenuItem);
- }
-
- @Test
- public void getFunctionalMenuItemDetailsTest(){
- Integer menuId = 1234;
- FunctionalMenuItem actualmenuItem = null;
- FunctionalMenuItem expectedmenuItem = null;
- EPUser user = mockUser.mockEPUser();
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(functionalMenuService.getFunctionalMenuItemDetails(menuId)).thenReturn(actualmenuItem);
-
- actualmenuItem = functionalMenuController.getFunctionalMenuItemDetails(mockedRequest, menuId, mockedResponse);
- assertEquals(actualmenuItem, expectedmenuItem);
- }
-
- @Test
- public void getMenuItemsForEditingTest(){
- List<FunctionalMenuItem> actualMenuItems = null;
- List<FunctionalMenuItem> expectedMenuItems = null;
- EPUser user = mockUser.mockEPUser();
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(functionalMenuService.getFunctionalMenuItems(true)).thenReturn(actualMenuItems);
-
- actualMenuItems = functionalMenuController.getMenuItemsForEditing(mockedRequest, mockedResponse);
- assertEquals(actualMenuItems, expectedMenuItems);
- }
-
- @Test
- public void getMenuItemsForEditingBadPermissionsTest(){
- List<FunctionalMenuItem> actualMenuItems = null;
- List<FunctionalMenuItem> expectedMenuItems = null;
- EPUser user = mockUser.mockEPUser();
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(functionalMenuService.getFunctionalMenuItems(true)).thenReturn(actualMenuItems);
-
- actualMenuItems = functionalMenuController.getMenuItemsForEditing(mockedRequest, mockedResponse);
- assertEquals(actualMenuItems, expectedMenuItems);
- }
-
- @Test
- public void getMenuItemsForNotificationsTest(){
- List<FunctionalMenuItem> actualMenuItems = null;
- List<FunctionalMenuItem> expectedMenuItems = new ArrayList<FunctionalMenuItem>();
- Mockito.when(functionalMenuService.getFunctionalMenuItemsForNotificationTree(false)).thenReturn(actualMenuItems);
-
- actualMenuItems = functionalMenuController.getMenuItemsForNotifications(mockedRequest, mockedResponse);
- assertEquals(actualMenuItems, expectedMenuItems);
- }
-
- @Test
- public void getMenuItemsForAppTest(){
- Integer appId = 1234;
- List<FunctionalMenuItem> actualMenuItems = null;
- List<FunctionalMenuItem> expectedMenuItems = null;
- Mockito.when(functionalMenuService.getFunctionalMenuItemsForApp(appId)).thenReturn(actualMenuItems);
-
- actualMenuItems = functionalMenuController.getMenuItemsForApp(mockedRequest, appId);
- assertEquals(actualMenuItems, expectedMenuItems);
- }
-
- @Test
- public void getMenuItemsForUserTest(){
- String orgUserId ="test";
- List<FunctionalMenuItem> actualMenuItems = null;
- List<FunctionalMenuItem> expectedMenuItems = null;
- Mockito.when(functionalMenuService.getFunctionalMenuItemsForUser(orgUserId)).thenReturn(actualMenuItems);
-
- actualMenuItems = functionalMenuController.getMenuItemsForUser(mockedRequest, orgUserId);
- assertEquals(actualMenuItems, expectedMenuItems);
- }
-
- @Test
- public void createFunctionalMenuItemTest(){
- FieldsValidator actualFieldsValidator = new FieldsValidator();
- FieldsValidator expectedFieldsValidator = new FieldsValidator();
- List<FieldName> fields = new ArrayList<>();
- expectedFieldsValidator.setHttpStatusCode((long) 200);
- expectedFieldsValidator.setFields(fields);
- expectedFieldsValidator.setErrorCode(null);
- FunctionalMenuItemWithRoles menuItemJson = new FunctionalMenuItemWithRoles();
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(functionalMenuService.createFunctionalMenuItem(menuItemJson)).thenReturn(expectedFieldsValidator);
- actualFieldsValidator = functionalMenuController.createFunctionalMenuItem(mockedRequest, menuItemJson, mockedResponse);
- assertEquals(actualFieldsValidator, expectedFieldsValidator);
- }
-
- @Test
- public void createFunctionalMenuItemBadPermisssionsTest(){
- FieldsValidator actualFieldsValidator = null;
- FieldsValidator expectedFieldsValidator = null;
- FunctionalMenuItemWithRoles menuItemJson = new FunctionalMenuItemWithRoles();
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
- Mockito.when(functionalMenuService.createFunctionalMenuItem(menuItemJson)).thenReturn(expectedFieldsValidator);
- actualFieldsValidator = functionalMenuController.createFunctionalMenuItem(mockedRequest, menuItemJson, mockedResponse);
- assertEquals(actualFieldsValidator, expectedFieldsValidator);
- }
-
- @Test
- public void getFavoritesForUserTest(){
- List<FavoritesFunctionalMenuItemJson> actualFavoritesFunctionalMenuItemsJson = null;
- List<FavoritesFunctionalMenuItemJson> expectedFunctionalMenuItemsJson = new ArrayList<FavoritesFunctionalMenuItemJson>();
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
- Mockito.when(functionalMenuService.getFavoriteItems(user.getId())).thenReturn(expectedFunctionalMenuItemsJson);
- actualFavoritesFunctionalMenuItemsJson = functionalMenuController.getFavoritesForUser(mockedRequest, mockedResponse);
- assertEquals(actualFavoritesFunctionalMenuItemsJson, expectedFunctionalMenuItemsJson);
- }
-
- @Test
- public void deleteFavoriteItemTest(){
- Long userId = (long)1;
- Long menuId = (long)1;
- FieldsValidator actualFieldsValidator = new FieldsValidator();
- FieldsValidator expectedFieldsValidator = new FieldsValidator();
- List<FieldName> fields = new ArrayList<>();
- expectedFieldsValidator.setHttpStatusCode((long) 200);
- expectedFieldsValidator.setFields(fields);
- expectedFieldsValidator.setErrorCode(null);
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(functionalMenuService.removeFavoriteItem(user.getId(), menuId)).thenReturn(actualFieldsValidator);
- actualFieldsValidator = functionalMenuController.deleteFavoriteItem(mockedRequest, menuId, mockedResponse);
- assertEquals(actualFieldsValidator, expectedFieldsValidator);
- }
-
- @Test
- public void addFavoriteItemTest(){
- FavoritesFunctionalMenuItem menuItemJson = new FavoritesFunctionalMenuItem();
- FieldsValidator actualFieldsValidator = new FieldsValidator();
- FieldsValidator expectedFieldsValidator = new FieldsValidator();
- List<FieldName> fields = new ArrayList<>();
- expectedFieldsValidator.setHttpStatusCode((long) 200);
- expectedFieldsValidator.setFields(fields);
- expectedFieldsValidator.setErrorCode(null);
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(functionalMenuService.setFavoriteItem(menuItemJson)).thenReturn(actualFieldsValidator);
- actualFieldsValidator = functionalMenuController.addFavoriteItem(mockedRequest, menuItemJson, mockedResponse);
- assertEquals(actualFieldsValidator, expectedFieldsValidator);
- }
-
- @Test
- public void getMenuItemsTest(){
- List<FunctionalMenuItem> actualFunctionalMenuItems = new ArrayList<FunctionalMenuItem>();
- List<FunctionalMenuItem> expectedFunctionalMenuItems = new ArrayList<FunctionalMenuItem>();
- List<FunctionalMenuItem> menuItems = new ArrayList<FunctionalMenuItem>();
- Mockito.when(functionalMenuService.getFunctionalMenuItems()).thenReturn(menuItems);
- actualFunctionalMenuItems = functionalMenuController.getMenuItems(mockedRequest, mockedResponse);
- assertEquals(actualFunctionalMenuItems, expectedFunctionalMenuItems);
- }
-
- @Test
- public void deleteFunctionalMenuItemTest(){
- Long menuId = (long)1;
- FieldsValidator actualFieldsValidator = new FieldsValidator();
- FieldsValidator expectedFieldsValidator = new FieldsValidator();
- List<FieldName> fields = new ArrayList<>();
- expectedFieldsValidator.setHttpStatusCode((long) 200);
- expectedFieldsValidator.setFields(fields);
- expectedFieldsValidator.setErrorCode(null);
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(functionalMenuService.deleteFunctionalMenuItem(menuId)).thenReturn(actualFieldsValidator);
- actualFieldsValidator = functionalMenuController.deleteFunctionalMenuItem(mockedRequest, menuId, mockedResponse);
- assertEquals(actualFieldsValidator, expectedFieldsValidator);
- }
-
- @Test
- public void deleteFunctionalMenuItemBadPermissionsTest(){
- Long menuId = (long)1;
- FieldsValidator actualFieldsValidator = null;
- FieldsValidator expectedFieldsValidator = null;
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
- Mockito.when(functionalMenuService.deleteFunctionalMenuItem(menuId)).thenReturn(actualFieldsValidator);
- actualFieldsValidator = functionalMenuController.deleteFunctionalMenuItem(mockedRequest, menuId, mockedResponse);
- assertEquals(actualFieldsValidator, expectedFieldsValidator);
- }
-
- @Test
- public void editFunctionalMenuItemTest(){
- FunctionalMenuItemWithRoles menuItemJson = new FunctionalMenuItemWithRoles();
- FieldsValidator actualFieldsValidator = new FieldsValidator();
- FieldsValidator expectedFieldsValidator = new FieldsValidator();
- List<FieldName> fields = new ArrayList<>();
- expectedFieldsValidator.setHttpStatusCode((long) 200);
- expectedFieldsValidator.setFields(fields);
- expectedFieldsValidator.setErrorCode(null);
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(functionalMenuService.editFunctionalMenuItem(menuItemJson)).thenReturn(actualFieldsValidator);
- actualFieldsValidator = functionalMenuController.editFunctionalMenuItem(mockedRequest, menuItemJson, mockedResponse);
- assertEquals(actualFieldsValidator, expectedFieldsValidator);
- }
-
- @Test
- public void editFunctionalMenuItemBadPermissionsTest(){
- FunctionalMenuItemWithRoles menuItemJson = new FunctionalMenuItemWithRoles();
- FieldsValidator actualFieldsValidator = null;
- FieldsValidator expectedFieldsValidator = null;
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
- Mockito.when(functionalMenuService.editFunctionalMenuItem(menuItemJson)).thenReturn(actualFieldsValidator);
- actualFieldsValidator = functionalMenuController.editFunctionalMenuItem(mockedRequest, menuItemJson, mockedResponse);
- assertEquals(actualFieldsValidator, expectedFieldsValidator);
- }
-
- @Test
- public void getECOMPTitleTest(){
- PortalRestResponse<String> actualportalRestResponse = null;
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.OK);
- expectedportalRestResponse.setMessage("success");
- expectedportalRestResponse.setResponse("Portal");
- PowerMockito.mockStatic(SystemProperties.class);
- Mockito.when(SystemProperties.getProperty(SystemProperties.APP_DISPLAY_NAME)).thenReturn("Portal");
- actualportalRestResponse = functionalMenuController.getECOMPTitle(mockedRequest, mockedResponse);
- assertEquals(actualportalRestResponse, expectedportalRestResponse);
- }
-
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.controller;
-
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.controller.GetAccessController;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.GetAccessResult;
-import org.openecomp.portalapp.portal.service.GetAccessService;
-import org.openecomp.portalapp.portal.service.GetAccessServiceImpl;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.openecomp.portalapp.util.EPUserUtils;
-
-public class GetAccessControllerTest {
-
- @Mock
- GetAccessService getAccessService = new GetAccessServiceImpl();
-
- @InjectMocks
- GetAccessController getAccessController = new GetAccessController();
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
- MockEPUser mockUser = new MockEPUser();
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
- NullPointerException nullPointerException = new NullPointerException();
-
-
- @Test
- public void getAppList() throws IOException
- {
- List<GetAccessResult> expectedAppsList = new ArrayList<GetAccessResult>();
- EPUser user = mockUser.mockEPUser();
- GetAccessResult getAccessResult = new GetAccessResult();
- getAccessResult.setRowId("1");
- getAccessResult.setRoleId((long) 1);
- getAccessResult.setEcompFunction("test");
- getAccessResult.setAppName("Test_App");
- getAccessResult.setAppMotsId(1);
- getAccessResult.setRoleName("Test_role");
- getAccessResult.setRoleActive("N");
- getAccessResult.setReqType("test");
-
- expectedAppsList.add(getAccessResult);
-
- List<GetAccessResult> actualAppsList = null;
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(getAccessService.getAppAccessList(user)).thenReturn(expectedAppsList);
- actualAppsList = getAccessController.getAppList(mockedRequest);
- assertTrue(actualAppsList.contains(getAccessResult));
- }
-
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.controller;
-
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.jar.Attributes;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.controller.ManifestController;
-import org.openecomp.portalapp.portal.service.ManifestService;
-import org.openecomp.portalapp.portal.service.ManifestServiceImpl;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-
-public class ManifestControllerTest extends MockitoTestSuite{
-
-
- @Mock
- ManifestService manifestService = new ManifestServiceImpl();
-
- @InjectMocks
- ManifestController manifestController = new ManifestController();
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
- NullPointerException nullPointerException = new NullPointerException();
-
- @Test
- public void getManifestTest() throws IOException
- {
- Map<String, Object> expectedResponse = new HashMap<String, Object>();
- Attributes attributes = new Attributes();
- expectedResponse.put("test", attributes);
- Mockito.when(manifestService.getWebappManifest()).thenReturn(attributes);
- Map<String, Object> actualResponse = manifestController.getManifest(mockedRequest);
- assertTrue((actualResponse.keySet().toArray().length) == 1);
-
- }
-
- @Test
- public void getManifestExceptionTest() throws IOException
- {
- Mockito.when(manifestService.getWebappManifest()).thenThrow(nullPointerException);
- Map<String, Object> actualResponse = manifestController.getManifest(mockedRequest);
- assertTrue((actualResponse.keySet().toArray().length) == 1);
- assertTrue(actualResponse.get("error").equals("failed to get manifest: java.lang.NullPointerException"));
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.controller;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.controller.MicroserviceController;
-import org.openecomp.portalapp.portal.domain.MicroserviceData;
-import org.openecomp.portalapp.portal.domain.WidgetCatalog;
-import org.openecomp.portalapp.portal.domain.WidgetServiceHeaders;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.service.ConsulHealthService;
-import org.openecomp.portalapp.portal.service.ConsulHealthServiceImpl;
-import org.openecomp.portalapp.portal.service.MicroserviceService;
-import org.openecomp.portalapp.portal.service.MicroserviceServiceImpl;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-import org.springframework.core.ParameterizedTypeReference;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.client.RestTemplate;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest(WidgetServiceHeaders.class)
-public class MicroserviceControllerTest extends MockitoTestSuite{
-
- @InjectMocks
- MicroserviceController microserviceController = new MicroserviceController();
-
- @Mock
- ConsulHealthService consulHealthService = new ConsulHealthServiceImpl();
-
- @Mock
- MicroserviceService microserviceService = new MicroserviceServiceImpl();
-
- @Mock
- RestTemplate template = new RestTemplate();
-
- @Mock
- MicroserviceData microserviceData = new MicroserviceData();
-
- @SuppressWarnings("rawtypes")
- @Mock
- ResponseEntity<List<WidgetCatalog>> ans = new ResponseEntity<List<WidgetCatalog>>(HttpStatus.OK);
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- @Mock
- EcompPortalUtils EcompPortalUtils = new EcompPortalUtils();
-
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
- NullPointerException nullPointerException = new NullPointerException();
-
- @Test
- public void createMicroserviceIfServiceDataNullTest() throws Exception {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("FAILURE");
- expectedportalRestResponse.setResponse("MicroserviceData cannot be null or empty");
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
- MicroserviceData microserviceData = null;
- PortalRestResponse<String> actualportalRestResponse = microserviceController.createMicroservice(mockedRequest,
- mockedResponse, microserviceData);
- assertEquals(actualportalRestResponse, expectedportalRestResponse);
- }
-
- @Test
- public void createMicroserviceTest() throws Exception {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("SUCCESS");
- expectedportalRestResponse.setResponse("");
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.OK);
- PortalRestResponse<String> actualportalRestResponse = microserviceController.createMicroservice(mockedRequest,
- mockedResponse, microserviceData);
- assertEquals(actualportalRestResponse, expectedportalRestResponse);
- }
-
- @Test
- public void createMicroserviceExceptionTest() throws Exception {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("FAILURE");
- expectedportalRestResponse.setResponse(null);
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
- Mockito.when(microserviceService.saveMicroservice(microserviceData)).thenReturn((long) 1);
- Mockito.when(microserviceData.getParameterList()).thenThrow(nullPointerException);
- PortalRestResponse<String> actualportalRestResponse = microserviceController.createMicroservice(mockedRequest,
- mockedResponse, microserviceData);
- assertEquals(actualportalRestResponse, expectedportalRestResponse);
- }
-
- @Test
- public void getMicroserviceTest() throws Exception {
- Mockito.when(microserviceService.getMicroserviceData()).thenReturn(null);
- List<MicroserviceData> list = microserviceController.getMicroservice(mockedRequest, mockedResponse);
- assertEquals(list, null);
- }
-
- @Test
- public void updateMicroserviceIfServiceISNullTest() throws Exception {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("FAILURE");
- expectedportalRestResponse.setResponse("MicroserviceData cannot be null or empty");
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
- MicroserviceData microserviceData = null;
- PortalRestResponse<String> actualportalRestResponse = microserviceController.updateMicroservice(mockedRequest,
- mockedResponse, 1, microserviceData);
- assertEquals(actualportalRestResponse, expectedportalRestResponse);
- }
-
- @Test
- public void updateMicroserviceTest() throws Exception {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("SUCCESS");
- expectedportalRestResponse.setResponse("");
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.OK);
- PortalRestResponse<String> actualportalRestResponse = microserviceController.updateMicroservice(mockedRequest,
- mockedResponse, 1, microserviceData);
- assertEquals(actualportalRestResponse, expectedportalRestResponse);
- }
-
- @Test
- public void updateMicroserviceExceptionTest() throws Exception {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("FAILURE");
- expectedportalRestResponse.setResponse(null);
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
- Mockito.when(microserviceController.updateMicroservice(mockedRequest, mockedResponse, 1, microserviceData))
- .thenThrow(nullPointerException);
- PortalRestResponse<String> actualportalRestResponse = microserviceController.updateMicroservice(mockedRequest,
- mockedResponse, 1, microserviceData);
- assertEquals(actualportalRestResponse, expectedportalRestResponse);
- }
-
- @Test
- public void deleteMicroserviceExceptionTest() throws Exception {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("FAILURE");
- expectedportalRestResponse.setResponse(
- "I/O error on GET request for \"" + EcompPortalUtils.widgetMsProtocol() + "://null/widget/microservices/widgetCatalog/service/1\":null; nested exception is java.net.UnknownHostException: null");
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
- PowerMockito.mockStatic(WidgetServiceHeaders.class);
- PortalRestResponse<String> actuaPportalRestResponse = microserviceController.deleteMicroservice(mockedRequest,
- mockedResponse, 1);
- assertEquals(actuaPportalRestResponse.getStatus(), expectedportalRestResponse.getStatus());
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void deleteMicroserviceTest() throws Exception {
- String HTTPS = "https://";
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("SOME WIDGETS ASSOICATE WITH THIS SERVICE");
- expectedportalRestResponse.setResponse("'null' ,'null' ");
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.WARN);
- List<WidgetCatalog> List = new ArrayList<WidgetCatalog>();
- WidgetCatalog widgetCatalog = new WidgetCatalog();
- widgetCatalog.setId(1);
- WidgetCatalog widgetCatalog1 = new WidgetCatalog();
- widgetCatalog.setId(2);
- List.add(widgetCatalog);
- List.add(widgetCatalog1);
- PowerMockito.mockStatic(WidgetServiceHeaders.class);
- String whatService = "widgets-service";
- Mockito.when(consulHealthService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port"))).thenReturn("Test");
- Mockito.when(ans.getBody()).thenReturn(List);
- ParameterizedTypeReference<List<WidgetCatalog>> typeRef = new ParameterizedTypeReference<List<WidgetCatalog>>() {
- };
- Mockito.when(template.exchange(
- HTTPS + consulHealthService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port"))
- + "/widget/microservices/widgetCatalog/service/" + 1,
- HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), typeRef)).thenReturn(ans);
-
- PortalRestResponse<String> actuaPportalRestResponse = microserviceController.deleteMicroservice(mockedRequest,
- mockedResponse, 1);
- assertEquals(actuaPportalRestResponse, expectedportalRestResponse);
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void deleteMicroserviceWhenNoWidgetsAssociatedTest() throws Exception {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("SUCCESS");
- expectedportalRestResponse.setResponse("");
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.OK);
- List<WidgetCatalog> List = new ArrayList<WidgetCatalog>();
- PowerMockito.mockStatic(WidgetServiceHeaders.class);
- String whatService = "widgets-service";
- Mockito.when(consulHealthService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port"))).thenReturn("Test");
- Mockito.when(ans.getBody()).thenReturn(List);
- ParameterizedTypeReference<List<WidgetCatalog>> typeRef = new ParameterizedTypeReference<List<WidgetCatalog>>() {
- };
- Mockito.when(template.exchange(
- EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port"))
- + "/widget/microservices/widgetCatalog/service/" + 1,
- HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), typeRef)).thenReturn(ans);
- PortalRestResponse<String> actuaPportalRestResponse = microserviceController.deleteMicroservice(mockedRequest,
- mockedResponse, 1);
- assertEquals(actuaPportalRestResponse, expectedportalRestResponse);
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.controller;
-
-import static org.junit.Assert.assertTrue;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.openecomp.portalapp.portal.controller.MicroserviceProxyController;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.service.MicroserviceProxyService;
-import org.openecomp.portalapp.portal.service.MicroserviceProxyServiceImpl;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.springframework.http.HttpStatus;
-import org.springframework.web.client.HttpClientErrorException;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-
-
-public class MicroserviceProxyControllerTest extends MockitoTestSuite {
-
- @Mock
- MicroserviceProxyService microserviceProxyService = new MicroserviceProxyServiceImpl();
-
- @InjectMocks
- MicroserviceProxyController microserviceProxyController = new MicroserviceProxyController();
-
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
- NullPointerException nullPointerException = new NullPointerException();
-
- @Mock
- EPUserUtils ePUserUtils = new EPUserUtils();
- @Mock
- ObjectMapper objectMapper = new ObjectMapper();
- MockEPUser mockUser = new MockEPUser();
-
- @Test
- public void getMicroserviceProxyTest() throws Exception {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(microserviceProxyService.proxyToDestination(1, user, mockedRequest)).thenReturn("Success");
- String acutualString = microserviceProxyController.getMicroserviceProxy(mockedRequest, getMockedResponse(), 1);
- assertTrue(acutualString.equals("{\"error\":\"Success\"}"));
- }
-
- @Test(expected = NullPointerException.class)
- public void getMicroserviceProxyNullPoniterExceptionTest() throws Exception {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(microserviceProxyService.proxyToDestination(1, user, mockedRequest))
- .thenThrow(nullPointerException);
- microserviceProxyController.getMicroserviceProxy(mockedRequest, getMockedResponse(), 1);
- }
-
- @Test
- public void getMicroserviceProxyExceptionTest() throws Exception {
- HttpClientErrorException httpClientErrorException = new HttpClientErrorException(HttpStatus.OK, "Success");
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(microserviceProxyService.proxyToDestination(1, user, mockedRequest))
- .thenThrow(httpClientErrorException);
- String acutualString = microserviceProxyController.getMicroserviceProxy(mockedRequest, getMockedResponse(), 1);
- assertTrue(acutualString.equals("{\"error\":\"\"}"));
- }
-
- @Test
- public void getMicroserviceProxyByWidgetIdTest() throws Exception {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(microserviceProxyService.proxyToDestinationByWidgetId(1, user, mockedRequest))
- .thenReturn("Success");
- String acutualString = microserviceProxyController.getMicroserviceProxyByWidgetId(mockedRequest,
- getMockedResponse(), 1);
- assertTrue(acutualString.equals("{\"error\":\"Success\"}"));
- }
-
- @Test(expected = NullPointerException.class)
- public void getMicroserviceProxyByWidgetIdNullPointerExceptionTest() throws Exception {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(microserviceProxyService.proxyToDestinationByWidgetId(1, user, mockedRequest))
- .thenThrow(nullPointerException);
- microserviceProxyController.getMicroserviceProxyByWidgetId(mockedRequest, getMockedResponse(), 1);
- }
-
- @Test
- public void getMicroserviceProxyByWidgetIdExceptionTest() throws Exception {
- HttpClientErrorException httpClientErrorException = new HttpClientErrorException(HttpStatus.OK, "Success");
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(microserviceProxyService.proxyToDestinationByWidgetId(1, user, mockedRequest))
- .thenThrow(httpClientErrorException);
- String acutualString = microserviceProxyController.getMicroserviceProxyByWidgetId(mockedRequest,
- getMockedResponse(), 1);
- assertTrue(acutualString.equals("{\"error\":\"\"}"));
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.controller;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.controller.PortalAdminController;
-import org.openecomp.portalapp.portal.domain.EPRole;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.exceptions.NoHealthyServiceException;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.AdminRolesServiceImpl;
-import org.openecomp.portalapp.portal.service.PortalAdminService;
-import org.openecomp.portalapp.portal.service.PortalAdminServiceImpl;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.PortalAdmin;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.service.AuditService;
-import org.openecomp.portalsdk.core.service.AuditServiceImpl;
-
-public class PortalAdminControllerTest extends MockitoTestSuite{
-
- @InjectMocks
- PortalAdminController portalAdminController = new PortalAdminController();
-
- @Mock
- AdminRolesService adminRolesService = new AdminRolesServiceImpl();
-
- @Mock
- PortalAdminService portalAdminService = new PortalAdminServiceImpl();
-
- @Mock
- AuditService auditService = new AuditServiceImpl();
-
-
- @Mock
- EcompPortalUtils ecompPortalUtils = new EcompPortalUtils();
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
- NullPointerException nullPointerException = new NullPointerException();
-
- @Mock
- EPUserUtils ePUserUtils = new EPUserUtils();
-
- MockEPUser mockUser = new MockEPUser();
-
-
- @Test
- public void getPortalAdminsTest()
- {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- List<PortalAdmin> expectedPortalAdminsList = new ArrayList<PortalAdmin>();
- PortalAdmin portalAdmin= new PortalAdmin();
-
- portalAdmin.setUserId((long) 1);
- portalAdmin.setLoginId("guestT");
- portalAdmin.setFirstName("Test_FirstName");
- portalAdmin.setLastName("Test_LastName");
-
- expectedPortalAdminsList.add(portalAdmin);
-
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-
- Mockito.when(portalAdminService.getPortalAdmins()).thenReturn(expectedPortalAdminsList);
- List<PortalAdmin> actualPortalAdminsList = portalAdminController.getPortalAdmins(mockedRequest, mockedResponse);
- assertEquals(actualPortalAdminsList,expectedPortalAdminsList);
-
- }
-// @Test
-// public void getPortalAdminsIfUserIsNullTest()
-// {
-// EPUser user = null;
-// Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-//
-// assertNull(portalAdminController.getPortalAdmins(mockedRequest, mockedResponse));
-//
-// }
-
- @Test
- public void getPortalAdminsIfUserIsSuperAdminTest()
- {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
- assertNull(portalAdminController.getPortalAdmins(mockedRequest, mockedResponse));
-
- }
-
-
-
- @Test
- public void createPortalAdminTest()
- {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-
- FieldsValidator expectedFieldValidator = new FieldsValidator();
- expectedFieldValidator.setHttpStatusCode((long) 200);
- expectedFieldValidator.setFields(null);
- expectedFieldValidator.setErrorCode(null);
- FieldsValidator actualFieldValidator = new FieldsValidator();
- String sbcid = "Test";
-
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(portalAdminService.createPortalAdmin(sbcid)).thenReturn(expectedFieldValidator);
- actualFieldValidator = portalAdminController.createPortalAdmin(mockedRequest, sbcid, mockedResponse);
- assertEquals(actualFieldValidator,expectedFieldValidator);
-
- }
-
-// @Test
-// public void createPortalAdminIfUserIsNullTest()
-// {
-// //EPUser user = null;
-// Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(null);
-// String sbcid = "null";
-// assertNull(portalAdminController.createPortalAdmin(mockedRequest, sbcid, mockedResponse));
-//
-// }
-
- @Test
- public void createPortalAdminIfUserIsSuperAdminTest()
- {
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
- String sbcid = "Test";
- assertNull(portalAdminController.createPortalAdmin(mockedRequest, sbcid, mockedResponse));
-
- }
-
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.controller;
-
-import static org.junit.Assert.assertEquals;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.controller.core.RoleController;
-import org.openecomp.portalapp.controller.core.RoleFunctionListController;
-import org.openecomp.portalapp.controller.core.RoleListController;
-import org.openecomp.portalapp.portal.controller.RoleManageController;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.service.ExternalAccessRolesService;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.springframework.web.servlet.ModelAndView;
-
-public class RoleManageControllerTest {
-
-
-
- @Mock
- RoleController roleController;
-
- @Mock
- RoleListController roleListController;
-
- @Mock
- RoleFunctionListController roleFunctionListController;
-
-
- @Mock
- ExternalAccessRolesService externalAccessRolesService;
-
- @Mock
- ExternalAccessRolesService externalAccessRolesService1 = null;
-
- @InjectMocks
- RoleManageController roleManageController = new RoleManageController();
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
-
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
- NullPointerException nullPointerException = new NullPointerException();
- MockEPUser mockUser = new MockEPUser();
-
- @Test
- public void toggleRoleTest()
- {
- PortalRestResponse<String> portalRestResponse = new PortalRestResponse<String>();
- portalRestResponse.setMessage("success");
- portalRestResponse.setResponse(null);
- PortalRestStatusEnum portalRestStatusEnum = null;
- portalRestResponse.setStatus(portalRestStatusEnum.OK);
-
- PortalRestResponse<String> expectedpPortalRestResponse=roleManageController.toggleRole(mockedRequest, mockedResponse);
- assertEquals(portalRestResponse,expectedpPortalRestResponse);
-
- }
-
-// @Test
-// public void toggleRoleExceptionTest()
-// {
-// PortalRestResponse<String> portalRestResponse = new PortalRestResponse<String>();
-// portalRestResponse.setMessage("success");
-// portalRestResponse.setResponse(null);
-// PortalRestStatusEnum portalRestStatusEnum = null;
-// portalRestResponse.setStatus(portalRestStatusEnum.OK);
-// Mockito.doNothing().when(roleListController).toggleRole(mockedRequest, mockedResponse))).th
-// getRoleListController().toggleRole(request, response)
-//
-// PortalRestResponse<String> expectedpPortalRestResponse=roleManageController.toggleRole(mockedRequest, mockedResponse);
-// assertEquals(portalRestResponse,expectedpPortalRestResponse);
-//
-// }
- @Test
- public void removeRoleTest() throws Exception
- {
- ModelAndView modelandView = new ModelAndView("login.htm");
- Mockito.when(roleListController.removeRole(mockedRequest, mockedResponse)).thenReturn(modelandView);
- ModelAndView expectedModelandView = roleManageController.removeRole(mockedRequest, mockedResponse);
- assertEquals(expectedModelandView, modelandView);
- }
-
- @Test
- public void saveRoleTest() throws Exception
- {
- ModelAndView modelandView = new ModelAndView("login.htm");
- Mockito.when(roleController.saveRole(mockedRequest, mockedResponse)).thenReturn(modelandView);
- ModelAndView expectedModelandView = roleManageController.saveRole(mockedRequest, mockedResponse);
- assertEquals(expectedModelandView, modelandView);
- }
-
- @Test
- public void removeRoleRoleFunctionTest() throws Exception
- {
- ModelAndView modelandView = new ModelAndView("login.htm");
- Mockito.when(roleController.removeRoleFunction(mockedRequest, mockedResponse)).thenReturn(modelandView);
- ModelAndView expectedModelandView = roleManageController.removeRoleRoleFunction(mockedRequest, mockedResponse);
- assertEquals(expectedModelandView, modelandView);
- }
-
- @Test
- public void addRoleRoRoleFunctionTest() throws Exception
- {
- ModelAndView modelandView = new ModelAndView("login.htm");
- Mockito.when(roleController.addRoleFunction(mockedRequest, mockedResponse)).thenReturn(modelandView);
- ModelAndView expectedModelandView = roleManageController.addRoleRoRoleFunction(mockedRequest, mockedResponse);
- assertEquals(expectedModelandView, modelandView);
- }
-
- @Test
- public void removeChildRoleTest() throws Exception
- {
- ModelAndView modelandView = new ModelAndView("login.htm");
- Mockito.when(roleController.removeChildRole(mockedRequest, mockedResponse)).thenReturn(modelandView);
- ModelAndView expectedModelandView = roleManageController.removeChildRole(mockedRequest, mockedResponse);
- assertEquals(expectedModelandView, modelandView);
- }
-
-
- @Test
- public void getRoleTest() throws Exception
- {
- Mockito.doNothing().when(roleController).getRole(mockedRequest, mockedResponse);
- roleManageController.getRole(mockedRequest, mockedResponse);
- }
-
- @Test
- public void getRolesTest() throws Exception
- {
- Mockito.doNothing().when(roleListController).getRoles(mockedRequest, mockedResponse);
- roleManageController.getRoles(mockedRequest, mockedResponse);
- }
-
- @Test
- public void getRoleFunctionListTest() throws Exception
- {
- Mockito.doNothing().when(roleFunctionListController).getRoleFunctionList(mockedRequest, mockedResponse);
- roleManageController.getRoleFunctionList(mockedRequest, mockedResponse);
- }
-
- @Test
- public void saveRoleFunctionTest() throws Exception
- {
- Mockito.doNothing().when(roleFunctionListController).saveRoleFunction(mockedRequest, mockedResponse, "test");
- roleManageController.saveRoleFunction(mockedRequest, mockedResponse, "test");
- }
-
- @Test
- public void removeRoleFunctionTest() throws Exception
- {
- Mockito.doNothing().when(roleFunctionListController).removeRoleFunction(mockedRequest, mockedResponse, "test");
- roleManageController.removeRoleFunction(mockedRequest, mockedResponse, "test");
- }
-
- @Test
- public void syncRolesTest() throws Exception
- {
- EPApp app = new EPApp();
- Mockito.doNothing().when(externalAccessRolesService).syncApplicationRolesWithEcompDB(app);
- roleManageController.syncRoles(app);
- }
-
-
- @Test
- public void addeChildRoleTest() throws Exception
- {
- ModelAndView modelandView = new ModelAndView("login.htm");
- Mockito.when(roleController.addChildRole(mockedRequest, mockedResponse)).thenReturn(modelandView);
- ModelAndView expectedModelandView = roleManageController.addChildRole(mockedRequest, mockedResponse);
- assertEquals(expectedModelandView, modelandView);
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.controller;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.externalsystemapproval.model.ExternalSystemRoleApproval;
-import org.openecomp.portalapp.externalsystemapproval.model.ExternalSystemUser;
-import org.openecomp.portalapp.portal.controller.RolesApprovalSystemController;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.service.UserRolesService;
-import org.openecomp.portalapp.portal.transport.ExternalRequestFieldsValidator;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-
-public class RolesApprovalSystemControllerTest extends MockitoTestSuite {
-
- @Mock
- UserRolesService userRolesService;
-
- @InjectMocks
- RolesApprovalSystemController rolesApprovalSystemController = new RolesApprovalSystemController();
-
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
- NullPointerException nullPointerException = new NullPointerException();
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- @Test
- public void postUserProfileIfRolesNullTest() {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("Request has no roles");
- expectedportalRestResponse.setResponse("save user profile failed");
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
- ExternalSystemUser extSysUser = new ExternalSystemUser();
- extSysUser.setApplicationName("Test_App");
- extSysUser.setLoginId("1");
- extSysUser.setMyloginrequestId("Test");
- List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = null;
- extSysUser.setRoles(externalSystemRoleApprovalList);
-
- PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
- .postUserProfile(mockedRequest, extSysUser, mockedResponse);
- assertEquals(expectedportalRestResponse, actualportalRestResponse);
- }
-
- @Test
- public void postUserProfileTest() {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("Saved Successfully");
- expectedportalRestResponse.setResponse("Success");
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.OK);
- ExternalSystemUser extSysUser = new ExternalSystemUser();
- extSysUser.setApplicationName("Test_App");
- extSysUser.setLoginId("1");
- extSysUser.setMyloginrequestId("Test");
- List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
- ExternalSystemRoleApproval externalSystemRoleApproval = new ExternalSystemRoleApproval();
- externalSystemRoleApprovalList.add(externalSystemRoleApproval);
- extSysUser.setRoles(externalSystemRoleApprovalList);
- ExternalRequestFieldsValidator externalRequestFieldsValidator = new ExternalRequestFieldsValidator(true,
- "Saved Successfully");
-
- Mockito.when(userRolesService.setExternalRequestUserAppRole(extSysUser, "POST"))
- .thenReturn(externalRequestFieldsValidator);
- PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
- .postUserProfile(mockedRequest, extSysUser, mockedResponse);
- assertEquals(expectedportalRestResponse, actualportalRestResponse);
- }
-
- @Test
- public void postUserProfileFailureTest() {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("Received Bad String");
- expectedportalRestResponse.setResponse("save user profile failed");
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
- ExternalSystemUser extSysUser = new ExternalSystemUser();
- extSysUser.setApplicationName("Test_App");
- extSysUser.setLoginId("1");
- extSysUser.setMyloginrequestId("Test");
- List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
- ExternalSystemRoleApproval externalSystemRoleApproval = new ExternalSystemRoleApproval();
- externalSystemRoleApprovalList.add(externalSystemRoleApproval);
- extSysUser.setRoles(externalSystemRoleApprovalList);
- ExternalRequestFieldsValidator externalRequestFieldsValidator = new ExternalRequestFieldsValidator(false,
- "Received Bad String");
- Mockito.when(userRolesService.setExternalRequestUserAppRole(extSysUser, "POST"))
- .thenReturn(externalRequestFieldsValidator);
-
- PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
- .postUserProfile(mockedRequest, extSysUser, mockedResponse);
- assertEquals(expectedportalRestResponse, actualportalRestResponse);
- }
-
- @Test
- public void postUserProfileExceptionTest() {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage(null);
- expectedportalRestResponse.setResponse("save user profile failed");
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
- ExternalSystemUser extSysUser = new ExternalSystemUser();
- extSysUser.setApplicationName("Test_App");
- extSysUser.setLoginId("1");
- extSysUser.setMyloginrequestId("Test");
- List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
- ExternalSystemRoleApproval externalSystemRoleApproval = new ExternalSystemRoleApproval();
- externalSystemRoleApprovalList.add(externalSystemRoleApproval);
- extSysUser.setRoles(externalSystemRoleApprovalList);
- Mockito.when(userRolesService.setExternalRequestUserAppRole(extSysUser, "POST")).thenThrow(nullPointerException);
- PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
- .postUserProfile(mockedRequest, extSysUser, mockedResponse);
- assertEquals(expectedportalRestResponse, actualportalRestResponse);
- }
-
- @Test
- public void putUserProfileIfLoginIdNullTest() {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("Request has no login ID");
- expectedportalRestResponse.setResponse("save user profile failed");
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
- ExternalSystemUser extSysUser = new ExternalSystemUser();
- extSysUser.setApplicationName("Test_App");
- extSysUser.setLoginId(null);
- extSysUser.setMyloginrequestId("Test");
- List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
- extSysUser.setRoles(externalSystemRoleApprovalList);
- PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
- .putUserProfile(mockedRequest, extSysUser, mockedResponse);
- assertEquals(expectedportalRestResponse, actualportalRestResponse);
- }
-
- @Test
- public void putUserProfileTest() {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("Updated Successfully");
- expectedportalRestResponse.setResponse("Success");
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.OK);
- ExternalSystemUser extSysUser = new ExternalSystemUser();
- extSysUser.setApplicationName("Test_App");
- extSysUser.setLoginId("1");
- extSysUser.setMyloginrequestId("Test");
- List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
- ExternalSystemRoleApproval externalSystemRoleApproval = new ExternalSystemRoleApproval();
- externalSystemRoleApprovalList.add(externalSystemRoleApproval);
- extSysUser.setRoles(externalSystemRoleApprovalList);
- ExternalRequestFieldsValidator externalRequestFieldsValidator = new ExternalRequestFieldsValidator(true,
- "Updated Successfully");
-
- Mockito.when(userRolesService.setExternalRequestUserAppRole(extSysUser, "PUT"))
- .thenReturn(externalRequestFieldsValidator);
- PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
- .putUserProfile(mockedRequest, extSysUser, mockedResponse);
- assertEquals(expectedportalRestResponse, actualportalRestResponse);
- }
-
- @Test
- public void putUserProfileFailureTest() {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("Received Bad String");
- expectedportalRestResponse.setResponse("save user profile failed");
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
- ExternalSystemUser extSysUser = new ExternalSystemUser();
- extSysUser.setApplicationName("Test_App");
- extSysUser.setLoginId("1");
- extSysUser.setMyloginrequestId("Test");
- List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
- ExternalSystemRoleApproval externalSystemRoleApproval = new ExternalSystemRoleApproval();
- externalSystemRoleApprovalList.add(externalSystemRoleApproval);
- extSysUser.setRoles(externalSystemRoleApprovalList);
- ExternalRequestFieldsValidator externalRequestFieldsValidator = new ExternalRequestFieldsValidator(false,
- "Received Bad String");
-
- Mockito.when(userRolesService.setExternalRequestUserAppRole(extSysUser, "PUT"))
- .thenReturn(externalRequestFieldsValidator);
- PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
- .putUserProfile(mockedRequest, extSysUser, mockedResponse);
-
- assertEquals(expectedportalRestResponse, actualportalRestResponse);
- }
-
- @Test
- public void putUserProfileExceptionTest() {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage(null);
- expectedportalRestResponse.setResponse("save user profile failed");
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
- ExternalSystemUser extSysUser = new ExternalSystemUser();
- extSysUser.setApplicationName("Test_App");
- extSysUser.setLoginId("1");
- extSysUser.setMyloginrequestId("Test");
- List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
- ExternalSystemRoleApproval externalSystemRoleApproval = new ExternalSystemRoleApproval();
- externalSystemRoleApprovalList.add(externalSystemRoleApproval);
- extSysUser.setRoles(externalSystemRoleApprovalList);
- Mockito.when(userRolesService.setExternalRequestUserAppRole(extSysUser, "PUT")).thenThrow(nullPointerException);
- PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
- .putUserProfile(mockedRequest, extSysUser, mockedResponse);
-
- assertEquals(expectedportalRestResponse, actualportalRestResponse);
- }
-
- @Test
- public void deleteUserProfileIfApplicationNameNullTest() {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("Request has no application name");
- expectedportalRestResponse.setResponse("delete user profile failed");
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
- ExternalSystemUser extSysUser = new ExternalSystemUser();
- extSysUser.setApplicationName(null);
- extSysUser.setLoginId("1");
- extSysUser.setMyloginrequestId("Test");
- List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
- extSysUser.setRoles(externalSystemRoleApprovalList);
- PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
- .deleteUserProfile(mockedRequest, extSysUser, mockedResponse);
-
- assertEquals(expectedportalRestResponse, actualportalRestResponse);
- }
-
- @Test
- public void deleteUserProfileIfMyloginrequestIdNullTest() {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("Request has no request ID");
- expectedportalRestResponse.setResponse("delete user profile failed");
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
- ExternalSystemUser extSysUser = new ExternalSystemUser();
- extSysUser.setApplicationName("Test");
- extSysUser.setLoginId("1");
- extSysUser.setMyloginrequestId(null);
- List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
- extSysUser.setRoles(externalSystemRoleApprovalList);
- PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
- .deleteUserProfile(mockedRequest, extSysUser, mockedResponse);
- assertEquals(expectedportalRestResponse, actualportalRestResponse);
- }
-
- @Test
- public void deleteUserProfileTest() {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("Deleted Successfully");
- expectedportalRestResponse.setResponse("Success");
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.OK);
- ExternalSystemUser extSysUser = new ExternalSystemUser();
- extSysUser.setApplicationName("Test_App");
- extSysUser.setLoginId("1");
- extSysUser.setMyloginrequestId("Test");
- List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
- ExternalSystemRoleApproval externalSystemRoleApproval = new ExternalSystemRoleApproval();
- externalSystemRoleApprovalList.add(externalSystemRoleApproval);
- extSysUser.setRoles(externalSystemRoleApprovalList);
- ExternalRequestFieldsValidator externalRequestFieldsValidator = new ExternalRequestFieldsValidator(true,
- "Success");
-
- Mockito.when(userRolesService.setExternalRequestUserAppRole(extSysUser, "DELETE"))
- .thenReturn(externalRequestFieldsValidator);
- PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
- .deleteUserProfile(mockedRequest, extSysUser, mockedResponse);
-
- assertEquals(expectedportalRestResponse, actualportalRestResponse);
- }
-
- @Test
- public void deleteUserProfileFailureTest() {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("failed");
- expectedportalRestResponse.setResponse("delete user profile failed");
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
- ExternalSystemUser extSysUser = new ExternalSystemUser();
- extSysUser.setApplicationName("Test_App");
- extSysUser.setLoginId("1");
- extSysUser.setMyloginrequestId("Test");
- List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
- ExternalSystemRoleApproval externalSystemRoleApproval = new ExternalSystemRoleApproval();
- externalSystemRoleApprovalList.add(externalSystemRoleApproval);
- extSysUser.setRoles(externalSystemRoleApprovalList);
- ExternalRequestFieldsValidator externalRequestFieldsValidator = new ExternalRequestFieldsValidator(false,
- "failed");
-
- Mockito.when(userRolesService.setExternalRequestUserAppRole(extSysUser, "DELETE"))
- .thenReturn(externalRequestFieldsValidator);
- PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
- .deleteUserProfile(mockedRequest, extSysUser, mockedResponse);
-
- assertEquals(expectedportalRestResponse, actualportalRestResponse);
- }
-
- @Test
- public void deleteUserProfileExceptionTest() {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage(null);
- expectedportalRestResponse.setResponse("delete user profile failed");
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
- ExternalSystemUser extSysUser = new ExternalSystemUser();
- extSysUser.setApplicationName("Test_App");
- extSysUser.setLoginId("1");
- extSysUser.setMyloginrequestId("Test");
- List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
- ExternalSystemRoleApproval externalSystemRoleApproval = new ExternalSystemRoleApproval();
- externalSystemRoleApprovalList.add(externalSystemRoleApproval);
- extSysUser.setRoles(externalSystemRoleApprovalList);
- Mockito.when(userRolesService.setExternalRequestUserAppRole(extSysUser, "DELETE")).thenThrow(nullPointerException);
- PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
- .deleteUserProfile(mockedRequest, extSysUser, mockedResponse);
-
- assertEquals(expectedportalRestResponse, actualportalRestResponse);
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.controller;
-
-import static org.junit.Assert.*;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.drools.core.command.assertion.AssertEquals;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.controller.sessionmgt.SessionCommunicationController;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
-import org.openecomp.portalapp.service.sessionmgt.ManageService;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-
-public class SessionCommunicationControllerTest {
-
-
- @Mock
- ManageService manageService;
-
- @InjectMocks
- SessionCommunicationController SessionCommunicationController = new SessionCommunicationController();
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- NullPointerException nullPointerException = new NullPointerException();
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
- MockEPUser mockUser = new MockEPUser();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-
-
- @Test
- public void getSessionSlotCheckIntervalTest() throws Exception
- {
- Mockito.when(manageService.fetchSessionSlotCheckInterval()).thenReturn(1);
- int result = SessionCommunicationController.getSessionSlotCheckInterval(mockedRequest, mockedResponse);
- assertEquals(result, 1);
-
- }
-
- @Test
- public void extendSessionTimeOutsTest() throws Exception
- {
- Mockito.doNothing().when(manageService).extendSessionTimeOuts("test");
- Boolean result = SessionCommunicationController.extendSessionTimeOuts(mockedRequest, mockedResponse, "test");
- assertEquals(result, true);
-
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.controller;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.controller.TicketEventController;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.service.UserNotificationService;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.openecomp.portalsdk.core.web.support.UserUtils;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest(UserUtils.class)
-public class TicketEventControllerTest {
-
- @Mock
- UserNotificationService userNotificationService;
-
- @InjectMocks
- TicketEventController ticketEventController = new TicketEventController();
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- MockEPUser mockUser = new MockEPUser();
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
- NullPointerException nullPointerException = new NullPointerException();
-
-// @Test
-// public void saveTest() throws Exception {
-// String ticketEventJson = "{\"application\": \"cbus\",\"event\": {\"body\": {\"ticketStatePhrase\": \"We recently detected a problem with the equipment at your site. The event is in queue for immediate work.\", \"ivrNotificationFlag\": \"1\",\"expectedRestoreDate\": 0,\"bridgeTransport\": \"AOTS\", \"reptRequestType\": 0,\"ticketNum\": \"000002000857405\",\"assetID\": \"CISCO_1921C1_ISR_G2\", \"eventDate\": 1490545134601,\"eventAbstract\": \"ospfIfConfigError trap received from Cisco_1921c1_ISR_G2 with arguments: ospfRouterId=Cisco_1921c1_ISR_G2; ospfIfIpAddress=1921c1_288266; ospfAddressLessIf=0; ospfPacketSrc=172.17.0.11; ospfConfigErrorType=2; ospfPacketType=1\",\"severity\": \"2 - Major\",\"ticketPriority\": \"3\",\"reportedCustomerImpact\": 0,\"testAutoIndicator\": 0,\"supportGroupName\": \"US-TEST-ORT\",\"lastModifiedDate\": \"1487687703\",\"messageGroup\": \"SNMP\",\"csi\": 0,\"mfabRestoredTime\": 0},\"header\": {\"timestamp\": \"2017-02-21T14:35:05.219+0000\",\"eventSource\": \"aotstm\",\"entityId\": \"000002000857405\", \"sequenceNumber\": 2 },\"blinkMsgId\": \"f38c071e-1a47-4b55-9e72-1db830100a61\",\"sourceIP\": \"130.4.165.158\"},\"SubscriberInfo\": {\"UserList\": [\"hk8777\"] }}";
-// PortalRestResponse<String> actualPortalRestResponse = ticketEventController.handleRequest(mockedRequest,
-// mockedResponse, ticketEventJson);
-// assertTrue(actualPortalRestResponse.getStatus().compareTo(PortalRestStatusEnum.OK) == 0);
-// }
-
- @Test
- public void saveTestForException() throws Exception {
- String ticketEventJson = "\"event\": {\"body\": {\"ticketStatePhrase\": \"We recently detected a problem with the equipment at your site. The event is in queue for immediate work.\", \"ivrNotificationFlag\": \"1\",\"expectedRestoreDate\": 0,\"bridgeTransport\": \"AOTS\", \"reptRequestType\": 0,\"ticketNum\": \"000002000857405\",\"assetID\": \"CISCO_1921C1_ISR_G2\", \"eventDate\": 1490545134601,\"eventAbstract\": \"ospfIfConfigError trap received from Cisco_1921c1_ISR_G2 with arguments: ospfRouterId=Cisco_1921c1_ISR_G2; ospfIfIpAddress=1921c1_288266; ospfAddressLessIf=0; ospfPacketSrc=172.17.0.11; ospfConfigErrorType=2; ospfPacketType=1\",\"severity\": \"2 - Major\",\"ticketPriority\": \"3\",\"reportedCustomerImpact\": 0,\"testAutoIndicator\": 0,\"supportGroupName\": \"US-TEST-ORT\",\"lastModifiedDate\": \"1487687703\",\"messageGroup\": \"SNMP\",\"csi\": 0,\"mfabRestoredTime\": 0},\"header\": {\"timestamp\": \"2017-02-21T14:35:05.219+0000\",\"eventSource\": \"aotstm\",\"entityId\": \"000002000857405\", \"sequenceNumber\": 2 },\"blinkMsgId\": \"f38c071e-1a47-4b55-9e72-1db830100a61\",\"sourceIP\": \"130.4.165.158\"},\"SubscriberInfo\": {\"UserList\": [\"hk8777\"] }}";
- PortalRestResponse<String> actualPortalRestResponse = ticketEventController.handleRequest(mockedRequest,
- mockedResponse, ticketEventJson);
- assertTrue(actualPortalRestResponse.getStatus().compareTo(PortalRestStatusEnum.ERROR) == 0);
- }
-
-// @Test
-// public void saveTestForApplicationValid() throws Exception {
-// String ticketEventJson = "{\"event\": {\"body\": {\"ticketStatePhrase\": \"We recently detected a problem with the equipment at your site. The event is in queue for immediate work.\", \"ivrNotificationFlag\": \"1\",\"expectedRestoreDate\": 0,\"bridgeTransport\": \"AOTS\", \"reptRequestType\": 0,\"ticketNum\": \"000002000857405\",\"assetID\": \"CISCO_1921C1_ISR_G2\", \"eventDate\": 1490545134601,\"eventAbstract\": \"ospfIfConfigError trap received from Cisco_1921c1_ISR_G2 with arguments: ospfRouterId=Cisco_1921c1_ISR_G2; ospfIfIpAddress=1921c1_288266; ospfAddressLessIf=0; ospfPacketSrc=172.17.0.11; ospfConfigErrorType=2; ospfPacketType=1\",\"severity\": \"2 - Major\",\"ticketPriority\": \"3\",\"reportedCustomerImpact\": 0,\"testAutoIndicator\": 0,\"supportGroupName\": \"US-TEST-ORT\",\"lastModifiedDate\": \"1487687703\",\"messageGroup\": \"SNMP\",\"csi\": 0,\"mfabRestoredTime\": 0},\"header\": {\"timestamp\": \"2017-02-21T14:35:05.219+0000\",\"eventSource\": \"aotstm\",\"entityId\": \"000002000857405\", \"sequenceNumber\": 2 },\"blinkMsgId\": \"f38c071e-1a47-4b55-9e72-1db830100a61\",\"sourceIP\": \"130.4.165.158\"},\"SubscriberInfo\": {\"UserList\": [\"hk8777\"] }}";
-// PortalRestResponse<String> actualPortalRestResponse = ticketEventController.handleRequest(mockedRequest,
-// mockedResponse, ticketEventJson);
-// assertTrue(actualPortalRestResponse.getStatus().compareTo(PortalRestStatusEnum.ERROR) == 0);
-// assertEquals(actualPortalRestResponse.getMessage(), "application is mandatory");
-//
-// }
-
- @Test
- public void saveTestForBodyValid() throws Exception {
- String ticketEventJson = "{\"application\": \"cbus\",\"event\": {\"header\": {\"timestamp\": \"2017-02-21T14:35:05.219+0000\",\"eventSource\": \"aotstm\",\"entityId\": \"000002000857405\",\"sequenceNumber\": 2 },\"blinkMsgId\": \"f38c071e-1a47-4b55-9e72-1db830100a61\",\"sourceIP\": \"130.4.165.158\"},\"SubscriberInfo\": {\"UserList\": [\"hk8777\"] }}";
- PortalRestResponse<String> actualPortalRestResponse = ticketEventController.handleRequest(mockedRequest,
- mockedResponse, ticketEventJson);
- assertTrue(actualPortalRestResponse.getStatus().compareTo(PortalRestStatusEnum.ERROR) == 0);
- assertEquals(actualPortalRestResponse.getMessage(), "body is mandatory");
- }
-
- @Test
- public void saveTestForEventSourceValid() throws Exception {
- String ticketEventJson = "{\"application\": \"cbus\",\"event\": {\"body\": {\"ticketStatePhrase\": \"We recently detected a problem with the equipment at your site. The event is in queue for immediate work.\", \"ivrNotificationFlag\": \"1\",\"expectedRestoreDate\": 0,\"bridgeTransport\": \"AOTS\", \"reptRequestType\": 0,\"ticketNum\": \"000002000857405\",\"assetID\": \"CISCO_1921C1_ISR_G2\", \"eventDate\": 1490545134601,\"eventAbstract\": \"ospfIfConfigError trap received from Cisco_1921c1_ISR_G2 with arguments: ospfRouterId=Cisco_1921c1_ISR_G2; ospfIfIpAddress=1921c1_288266; ospfAddressLessIf=0; ospfPacketSrc=172.17.0.11; ospfConfigErrorType=2; ospfPacketType=1\",\"severity\": \"2 - Major\",\"ticketPriority\": \"3\",\"reportedCustomerImpact\": 0,\"testAutoIndicator\": 0,\"supportGroupName\": \"US-TEST-ORT\",\"lastModifiedDate\": \"1487687703\",\"messageGroup\": \"SNMP\",\"csi\": 0,\"mfabRestoredTime\": 0},\"header\": {\"timestamp\": \"2017-02-21T14:35:05.219+0000\",\"entityId\": \"000002000857405\", \"sequenceNumber\": 2 },\"blinkMsgId\": \"f38c071e-1a47-4b55-9e72-1db830100a61\",\"sourceIP\": \"130.4.165.158\"},\"SubscriberInfo\": {\"UserList\": [\"hk8777\"] }}";
- PortalRestResponse<String> actualPortalRestResponse = ticketEventController.handleRequest(mockedRequest,
- mockedResponse, ticketEventJson);
- assertTrue(actualPortalRestResponse.getStatus().compareTo(PortalRestStatusEnum.ERROR) == 0);
- assertEquals(actualPortalRestResponse.getMessage(), "Message Source is mandatory");
- }
-
- @Test
- public void saveTestForUserListValid() throws Exception {
- String ticketEventJson = "{\"application\": \"cbus\",\"event\": {\"body\": {\"ticketStatePhrase\": \"We recently detected a problem with the equipment at your site. The event is in queue for immediate work.\", \"ivrNotificationFlag\": \"1\",\"expectedRestoreDate\": 0,\"bridgeTransport\": \"AOTS\", \"reptRequestType\": 0,\"ticketNum\": \"000002000857405\",\"assetID\": \"CISCO_1921C1_ISR_G2\", \"eventDate\": 1490545134601,\"eventAbstract\": \"ospfIfConfigError trap received from Cisco_1921c1_ISR_G2 with arguments: ospfRouterId=Cisco_1921c1_ISR_G2; ospfIfIpAddress=1921c1_288266; ospfAddressLessIf=0; ospfPacketSrc=172.17.0.11; ospfConfigErrorType=2; ospfPacketType=1\",\"severity\": \"2 - Major\",\"ticketPriority\": \"3\",\"reportedCustomerImpact\": 0,\"testAutoIndicator\": 0,\"supportGroupName\": \"US-TEST-ORT\",\"lastModifiedDate\": \"1487687703\",\"messageGroup\": \"SNMP\",\"csi\": 0,\"mfabRestoredTime\": 0},\"header\": {\"timestamp\": \"2017-02-21T14:35:05.219+0000\",\"eventSource\": \"aotstm\",\"entityId\": \"000002000857405\", \"sequenceNumber\": 2 },\"blinkMsgId\": \"f38c071e-1a47-4b55-9e72-1db830100a61\",\"sourceIP\": \"130.4.165.158\"},\"SubscriberInfo\": {}}";
- PortalRestResponse<String> actualPortalRestResponse = ticketEventController.handleRequest(mockedRequest,
- mockedResponse, ticketEventJson);
- assertTrue(actualPortalRestResponse.getStatus().compareTo(PortalRestStatusEnum.ERROR) == 0);
- assertEquals(actualPortalRestResponse.getMessage(), "At least one user Id is mandatory");
- }
-}
\ No newline at end of file
+++ /dev/null
-package org.openecomp.portalapp.portal.test.controller;
-
-import static org.junit.Assert.assertEquals;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.controller.UserController;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.service.UserService;
-import org.openecomp.portalapp.portal.service.UserServiceImpl;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
-import org.openecomp.portalapp.portal.transport.ProfileDetail;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest(CipherUtil.class)
-public class UserControllerTest extends MockitoTestSuite {
-
- @InjectMocks
- UserController userController = new UserController();
-
- @Mock
- UserService userService = new UserServiceImpl();
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- @Mock
- EPUserUtils ePUserUtils = new EPUserUtils();
-
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
- NullPointerException nullPointerException = new NullPointerException();
-
- MockEPUser mockUser = new MockEPUser();
-
- @Test
- public void getLoggedinUserExceptionTest() {
- EPUser epUser = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(epUser);
- PortalRestResponse<ProfileDetail> expectedResponse = new PortalRestResponse<ProfileDetail>();
- expectedResponse.setMessage(null);
- expectedResponse.setResponse(null);
- expectedResponse.setStatus(PortalRestStatusEnum.ERROR);
- PortalRestResponse<ProfileDetail> response = userController.getLoggedinUser(mockedRequest);
- assertEquals(response, expectedResponse);
- }
-
- @Test
- public void getLoggedinUserTest() throws Exception {
- EPUser epUser = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(epUser);
- PortalRestResponse<ProfileDetail> expectedResponse = new PortalRestResponse<ProfileDetail>();
- expectedResponse.setMessage("success");
- ProfileDetail profileDetail = new ProfileDetail();
- expectedResponse.setResponse(profileDetail);
- expectedResponse.setStatus(PortalRestStatusEnum.OK);
- PowerMockito.mockStatic(CipherUtil.class);
- Mockito.when(CipherUtil.decrypt(epUser.getLoginPwd())).thenReturn("Password");
- PortalRestResponse<ProfileDetail> response = userController.getLoggedinUser(mockedRequest);
- assertEquals(response.getMessage(), expectedResponse.getMessage());
- assertEquals(response.getStatus(), expectedResponse.getStatus());
- }
-
- @Test
- public void modifyLoggedinUserIfProfileNullTest() {
- PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
- expectedResponse.setMessage("java.lang.NullPointerException");
- expectedResponse.setResponse(null);
- expectedResponse.setStatus(PortalRestStatusEnum.ERROR);
- ProfileDetail profileDetail = null;
- PortalRestResponse<String> actualResponse = userController.modifyLoggedinUser(mockedRequest, profileDetail);
- assertEquals(actualResponse, expectedResponse);
- assertEquals(actualResponse.getStatus(), expectedResponse.getStatus());
- }
-
- @Test
- public void modifyLoggedinUserExceptionTest() {
- EPUser epUser = mockUser.mockEPUser();
-
- PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
- expectedResponse.setMessage(
- "java.lang.ClassCastException: com.sun.crypto.provider.AESCipher$General cannot be cast to javax.crypto.CipherSpi");
- expectedResponse.setResponse(null);
- expectedResponse.setStatus(PortalRestStatusEnum.ERROR);
- ProfileDetail profileDetail = new ProfileDetail();
- profileDetail.setFirstName("Test_FirstName");
- profileDetail.setLastName("Test_LastName");
- profileDetail.setEmail("Test_Email");
- profileDetail.setLoginId("Test_LoginId");
- profileDetail.setLoginPassword("Test_LoginPassword");
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(epUser);
- PortalRestResponse<String> actualResponse = userController.modifyLoggedinUser(mockedRequest, profileDetail);
- assertEquals(actualResponse, expectedResponse);
-
- }
-
- /*@Test
- public void modifyLoggedinUserTest() throws Exception {
- EPUser epUser = mockUser.mockEPUser();
- PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
- expectedResponse.setMessage("success");
- expectedResponse.setResponse(null);
- PortalRestStatusEnum enu = null;
- expectedResponse.setStatus(enu.OK);
- ProfileDetail profileDetail = new ProfileDetail();
- profileDetail.setFirstName("Test_FirstName");
- profileDetail.setLastName("Test_LastName");
- profileDetail.setEmail("Test_Email");
- profileDetail.setLoginId("Test_LoginId");
- profileDetail.setLoginPassword("Test_LoginPassword");
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(epUser);
- PowerMockito.mockStatic(CipherUtil.class);
- Mockito.when(CipherUtil.decrypt(epUser.getLoginPwd())).thenReturn("Password");
- PortalRestResponse<String> actualResponse = userController.modifyLoggedinUser(mockedRequest, profileDetail);
- System.out.println(actualResponse);
- }*/
-}
+++ /dev/null
-/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ================================================================================
- */
-package org.openecomp.portalapp.portal.test.controller;
-
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Matchers;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.controller.UserNotificationController;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.service.FunctionalMenuService;
-import org.openecomp.portalapp.portal.service.FunctionalMenuServiceImpl;
-import org.openecomp.portalapp.portal.service.UserNotificationService;
-import org.openecomp.portalapp.portal.service.UserNotificationServiceImpl;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
-import org.openecomp.portalapp.portal.transport.EpNotificationItem;
-import org.openecomp.portalapp.portal.transport.EpNotificationItemVO;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuRole;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.portalsdk.core.web.support.UserUtils;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest(UserUtils.class)
-public class UserNotificationControllerTest {
-
- @Mock
- FunctionalMenuService functionalMenuService = new FunctionalMenuServiceImpl();
-
- @Mock
- UserNotificationService userNotificationService = new UserNotificationServiceImpl();
-
- @InjectMocks
- UserNotificationController userNotificationController = new UserNotificationController();
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- MockEPUser mockUser = new MockEPUser();
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
- NullPointerException nullPointerException = new NullPointerException();
-
- @Test
- public void getMenuIdRoleIdTest() {
- List<FunctionalMenuRole> expectedMenuRoleList = new ArrayList<FunctionalMenuRole>();
- FunctionalMenuRole functionalMenuRole = new FunctionalMenuRole();
- functionalMenuRole.setId(new Integer(99999999));
- functionalMenuRole.setMenuId((long) 137);
- functionalMenuRole.setAppId(new Integer(456));
- functionalMenuRole.setRoleId(new Integer(6214));
- expectedMenuRoleList.add(functionalMenuRole);
- List<FunctionalMenuRole> actualFunctionalMenuRoleList = null;
- Mockito.when(functionalMenuService.getFunctionalMenuRole()).thenReturn(expectedMenuRoleList);
- actualFunctionalMenuRoleList = userNotificationController.getMenuIdRoleId(mockedRequest, mockedResponse);
- assertTrue(actualFunctionalMenuRoleList.equals(expectedMenuRoleList));
-
- }
-
- @Test
- public void getNotificationsTest() {
- EPUser user = mockUser.mockEPUser();
- HttpSession session = mockedRequest.getSession();
- session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- List<EpNotificationItem> expectedEpNotificationList = new ArrayList<EpNotificationItem>();
- EpNotificationItem epNotificationItem = new EpNotificationItem();
- epNotificationItem.setNotificationId((long) 200);
- expectedEpNotificationList.add(epNotificationItem);
- PortalRestResponse<List<EpNotificationItem>> expectedportalRestResponse = new PortalRestResponse<List<EpNotificationItem>>();
- expectedportalRestResponse.setMessage("success");
- expectedportalRestResponse.setResponse(expectedEpNotificationList);
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.OK);
- PortalRestResponse<List<EpNotificationItem>> actualPortalRestResponse = null;
- Mockito.when(userNotificationService.getNotifications(user.getId())).thenReturn(expectedEpNotificationList);
- actualPortalRestResponse = userNotificationController.getNotifications(mockedRequest, mockedResponse);
- assertTrue(expectedportalRestResponse.equals(actualPortalRestResponse));
-
- }
-
- @Test
- public void getNotificationsCatchesExceptionTest() {
- EPUser user = mockUser.mockEPUser();
- HttpSession session = mockedRequest.getSession();
- session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- List<EpNotificationItem> expectedEpNotificationList = null;
- PortalRestResponse<List<EpNotificationItem>> expectedportalRestResponse = new PortalRestResponse<List<EpNotificationItem>>();
- expectedportalRestResponse.setMessage(null);
- expectedportalRestResponse.setResponse(expectedEpNotificationList);
- expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
- PortalRestResponse<List<EpNotificationItem>> actualPortalRestResponse = null;
- Mockito.when(userNotificationService.getNotifications(user.getId())).thenThrow(new NullPointerException());
- actualPortalRestResponse = userNotificationController.getNotifications(mockedRequest, mockedResponse);
- assertTrue(expectedportalRestResponse.equals(actualPortalRestResponse));
- }
-
- @Test
- public void getAdminNotificationsTest() {
- EPUser user = mockUser.mockEPUser();
- HttpSession session = mockedRequest.getSession();
- session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- List<EpNotificationItemVO> actualEpNotificationsList = new ArrayList<EpNotificationItemVO>();
- List<EpNotificationItemVO> expectedEpNotificationsList = new ArrayList<EpNotificationItemVO>();
- EpNotificationItemVO epNotificationItemVO = new EpNotificationItemVO();
- epNotificationItemVO.setId((long) 1);
- expectedEpNotificationsList.add(epNotificationItemVO);
- Mockito.when(userNotificationService.getAdminNotificationVOS(Matchers.anyLong())).thenReturn(expectedEpNotificationsList);
- actualEpNotificationsList = userNotificationController.getAdminNotifications(mockedRequest, mockedResponse);
- assertTrue(actualEpNotificationsList.equals(expectedEpNotificationsList));
- }
-
- @Test
- public void saveTestWhenNotificationIsNull() throws Exception {
- EPUser user = mockUser.mockEPUser();
- HttpSession session = mockedRequest.getSession();
- session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-
- PortalRestResponse<String> actualPortalRestResponse = new PortalRestResponse<String>();
- PortalRestResponse<String> expectedPortalRestResponse = new PortalRestResponse<String>();
- expectedPortalRestResponse.setMessage("FAILURE");
- expectedPortalRestResponse.setResponse("Notification Header cannot be null or empty");
- expectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
-
- EpNotificationItem notificationItem = null;
- actualPortalRestResponse = userNotificationController.save(mockedRequest, mockedResponse, notificationItem);
- assertTrue(actualPortalRestResponse.equals(expectedPortalRestResponse));
- }
-
- @Test
- public void saveTestWhenEndTimeIsGreater() throws Exception {
- EPUser user = mockUser.mockEPUser();
- HttpSession session = mockedRequest.getSession();
- session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- PortalRestResponse<String> actualPortalRestResponse = new PortalRestResponse<String>();
- PortalRestResponse<String> expectedPortalRestResponse = new PortalRestResponse<String>();
- expectedPortalRestResponse.setMessage("FAILURE");
- expectedPortalRestResponse.setResponse("End Time should be greater than start time");
- expectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
- EpNotificationItem notificationItem = new EpNotificationItem();
- notificationItem.setNotificationId((long) 1);
- notificationItem.setMsgHeader("Test");
- Date currentDate = new Date();
- Calendar c = Calendar.getInstance();
- c.setTime(currentDate);
- c.add(Calendar.DATE, 1);
- Date currentDatePlusOne = c.getTime();
- notificationItem.setStartTime(currentDatePlusOne);
- notificationItem.setEndTime(currentDate);
-
- actualPortalRestResponse = userNotificationController.save(mockedRequest, mockedResponse, notificationItem);
- assertTrue(actualPortalRestResponse.equals(expectedPortalRestResponse));
-
- }
-
- @Test
- public void saveTestWhenNoRoleIDExists() throws Exception {
- EPUser user = mockUser.mockEPUser();
- HttpSession session = mockedRequest.getSession();
- session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- PortalRestResponse<String> actualPortalRestResponse = new PortalRestResponse<String>();
- PortalRestResponse<String> expectedPortalRestResponse = new PortalRestResponse<String>();
- expectedPortalRestResponse.setMessage("FAILURE");
- expectedPortalRestResponse.setResponse("No Roles Ids Exist for the selected Roles");
- expectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
- EpNotificationItem notificationItem = new EpNotificationItem();
- notificationItem.setNotificationId((long) 1);
- notificationItem.setMsgHeader("Test");
- notificationItem.setIsForAllRoles("N");
- Date currentDate = new Date();
- Calendar c = Calendar.getInstance();
- c.setTime(currentDate);
- c.add(Calendar.DATE, 1);
- Date currentDatePlusOne = c.getTime();
- notificationItem.setStartTime(currentDate);
- notificationItem.setEndTime(currentDatePlusOne);
- List<Long> roleList = new ArrayList<Long>();
- notificationItem.setRoleIds(roleList);
- actualPortalRestResponse = userNotificationController.save(mockedRequest, mockedResponse, notificationItem);
- assertTrue(actualPortalRestResponse.equals(expectedPortalRestResponse));
- }
-
- @Test
- public void saveTest() throws Exception {
- EPUser user = mockUser.mockEPUser();
- HttpSession session = mockedRequest.getSession();
- session.setAttribute("user", user);
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- PortalRestResponse<String> actualPortalRestResponse = new PortalRestResponse<String>();
- PortalRestResponse<String> expectedPortalRestResponse = new PortalRestResponse<String>();
- expectedPortalRestResponse.setMessage("SUCCESS");
- expectedPortalRestResponse.setResponse("");
- expectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
- EpNotificationItem notificationItem = new EpNotificationItem();
- notificationItem.setNotificationId((long) 1);
- notificationItem.setMsgHeader("Test");
- notificationItem.setIsForAllRoles("Y");
- Date currentDate = new Date();
- Calendar c = Calendar.getInstance();
- c.setTime(currentDate);
- c.add(Calendar.DATE, 1);
- Date currentDatePlusOne = c.getTime();
- notificationItem.setStartTime(currentDate);
- notificationItem.setEndTime(currentDatePlusOne);
- List<Long> roleList = new ArrayList<Long>();
- Long role1 = (long) 1;
- roleList.add(role1);
- notificationItem.setRoleIds(roleList);
- HttpServletRequest request = mockitoTestSuite.getMockedRequest();
- PowerMockito.mockStatic(UserUtils.class);
- Mockito.when(UserUtils.getUserIdAsLong(request)).thenReturn((long) 1);
- Mockito.when(userNotificationService.saveNotification(notificationItem)).thenReturn("Test");
- actualPortalRestResponse = userNotificationController.save(mockedRequest, mockedResponse, notificationItem);
- assertTrue(actualPortalRestResponse.equals(expectedPortalRestResponse));
- }
-
-}
+++ /dev/null
-/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ================================================================================
- */
-package org.openecomp.portalapp.portal.test.controller;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.controller.UserRolesController;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.EcompAuditLog;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.SearchService;
-import org.openecomp.portalapp.portal.service.UserRolesService;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
-import org.openecomp.portalapp.portal.transport.AppWithRolesForUser;
-import org.openecomp.portalapp.portal.transport.AppsListWithAdminRole;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.FieldsValidator.FieldName;
-import org.openecomp.portalapp.portal.transport.RoleInAppForUser;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.service.AuditService;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({EcompPortalUtils.class, EPCommonSystemProperties.class, EcompAuditLog.class, SystemProperties.class})
-public class UserRolesControllerTest extends MockitoTestSuite {
-
- String userid = "ab1234";
-
- @Mock
- UserRolesService userRolesService;
-
- @Mock
- SearchService searchService;
-
- @Mock
- AuditService auditService;
-
- @Mock
- AdminRolesService adminRolesService;
-
- @Mock
- FieldsValidator fieldsValidator;
-
- @InjectMocks
- UserRolesController userRolesController = new UserRolesController();
-
- @Mock
- private DataAccessService dataAccessService;
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-
- @Mock
- EPUserUtils ePUserUtils = new EPUserUtils();
-
- @Mock
- EPUser epuser;
-
- MockEPUser mockUser = new MockEPUser();
-
- @Test
- public void putAppWithUserRoleRequestTest() {
-
- FieldsValidator actualFieldsValidator = null;
-
- AppWithRolesForUser appWithRolesForUser = new AppWithRolesForUser();
- List<RoleInAppForUser> listofRoles = new ArrayList<RoleInAppForUser>();
-
- appWithRolesForUser.setOrgUserId("guest");
- appWithRolesForUser.setAppId((long) 550);
- appWithRolesForUser.setAppName("D2 Services Analytics Dashboard");
- appWithRolesForUser.setAppRoles(listofRoles);
-
- RoleInAppForUser roleInAppForUser = new RoleInAppForUser();
- roleInAppForUser.setIsApplied(false);
- roleInAppForUser.setRoleId((long) 1);
- roleInAppForUser.setRoleName("System Administrator");
-
- RoleInAppForUser roleInAppForUser1 = new RoleInAppForUser();
- roleInAppForUser1.setIsApplied(true);
- roleInAppForUser1.setRoleId((long) 16);
- roleInAppForUser1.setRoleName("Standard User");
-
- listofRoles.add(roleInAppForUser);
- listofRoles.add(roleInAppForUser1);
- EPUser user = mockUser.mockEPUser();
- FieldsValidator expectedFieldValidator = new FieldsValidator();
- List<FieldName> fields = new ArrayList<>();
-
- expectedFieldValidator.setHttpStatusCode((long) 200);
- expectedFieldValidator.setFields(fields);
- expectedFieldValidator.setErrorCode(null);
- HttpSession session = mockedRequest.getSession();
- session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
-
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(userRolesService.putUserAppRolesRequest(appWithRolesForUser, user))
- .thenReturn(expectedFieldValidator);
-
- actualFieldsValidator = userRolesController.putAppWithUserRoleRequest(mockedRequest, appWithRolesForUser,
- mockedResponse);
- assertEquals(expectedFieldValidator.getHttpStatusCode(), actualFieldsValidator.getHttpStatusCode());
- assertEquals(expectedFieldValidator.getErrorCode(), actualFieldsValidator.getErrorCode());
- assertEquals(expectedFieldValidator.getFields(), actualFieldsValidator.getFields());
-
- }
-
- @Test
- public void getPhoneBookSearchResultBadPermissionsTest() {
- String searchString = "test";
- String actualResult = null;
- String expectedResult = null;
-
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
- Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(false);
- Mockito.when(searchService.searchUsersInPhoneBook(searchString)).thenReturn(actualResult);
-
- actualResult = userRolesController.getPhoneBookSearchResult(mockedRequest, searchString, mockedResponse);
- assertEquals(expectedResult, actualResult);
-
- }
-
- @Test
- public void getPhoneBookSearchResultValidationTest() {
- String searchString = " t";
- String actualResult = null;
- String expectedResult = null;
-
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(false);
- Mockito.when(searchService.searchUsersInPhoneBook(searchString)).thenReturn(actualResult);
-
- actualResult = userRolesController.getPhoneBookSearchResult(mockedRequest, searchString, mockedResponse);
- assertEquals(expectedResult, actualResult);
-
- }
-
- @Test
- public void getPhoneBookSearchResultTest() {
- String searchString = "test";
- String actualResult = null;
- String expectedResult = null;
-
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(false);
- Mockito.when(searchService.searchUsersInPhoneBook(searchString)).thenReturn(actualResult);
-
- actualResult = userRolesController.getPhoneBookSearchResult(mockedRequest, searchString, mockedResponse);
- assertEquals(expectedResult, actualResult);
-
- }
-
- @Test
- public void getAppsWithAdminRoleStateForUserTest(){
-
- String orgUserId = "hb123f";
- AppsListWithAdminRole actualResult = new AppsListWithAdminRole();
- AppsListWithAdminRole expectedResult = new AppsListWithAdminRole();
- EPUser user = mockUser.mockEPUser();
- // PowerMockito.mockStatic(EcompPortalUtils.class);
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(adminRolesService.getAppsWithAdminRoleStateForUser(orgUserId)).thenReturn(actualResult);
-
- actualResult = userRolesController.getAppsWithAdminRoleStateForUser(mockedRequest, orgUserId, mockedResponse);
- assertEquals(expectedResult, actualResult);
- }
-
- /*@Test
- public void getAppsWithAdminRoleStateForUserBadRequestTest(){
-
- String orgUserId = "hb123f";
- AppsListWithAdminRole actualResult = null;
- AppsListWithAdminRole expectedResult = null;
- EPUser user = mockUser.mockEPUser();
- PowerMockito.mockStatic(EcompPortalUtils.class);
- PowerMockito.when(EcompPortalUtils.legitimateUserId(orgUserId)).thenReturn(false);
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(adminRolesService.getAppsWithAdminRoleStateForUser(orgUserId)).thenReturn(actualResult);
-
- actualResult = userRolesController.getAppsWithAdminRoleStateForUser(mockedRequest, orgUserId, mockedResponse);
- assertEquals(expectedResult, actualResult);
- }*/
-
- @Test
- public void putAppsWithAdminRoleStateForUserBadStatusCodeTest(){
- FieldsValidator actualFieldsValidator = null;
- AppsListWithAdminRole newAppsListWithAdminRoles = new AppsListWithAdminRole();
- FieldsValidator expectedFieldsValidator = new FieldsValidator();
- List<FieldName> fieldNames = new ArrayList<FieldName>();
- expectedFieldsValidator.setErrorCode(null);
- expectedFieldsValidator.setFields(fieldNames);
- expectedFieldsValidator.setHttpStatusCode((long)200);
-
- EPUser user = mockUser.mockEPUser();
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-
- actualFieldsValidator = userRolesController.putAppsWithAdminRoleStateForUser(mockedRequest, newAppsListWithAdminRoles, mockedResponse);
- assertEquals(expectedFieldsValidator, actualFieldsValidator);
- }
-
-
- /*@Test
- public void putAppsWithAdminRoleStateForUserTest() {
-
- FieldsValidator actualFieldsValidator = null;
- AppsListWithAdminRole newAppsListWithAdminRoles = new AppsListWithAdminRole();
- EPUser user = mockUser.mockEPUser();
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(false);
- PowerMockito.mockStatic(EPCommonSystemProperties.class);
- PowerMockito.mockStatic(EcompAuditLog.class);
- PowerMockito.mockStatic(SystemProperties.class);
- Mockito.when(SystemProperties.getProperty(EcompAuditLog.CD_ACTIVITY_UPDATE_ACCOUNT_ADMIN)).thenReturn("1400");
- Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP)).thenReturn("1400");
- Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP)).thenReturn("1400");
- Mockito.when(SystemProperties.getProperty(SystemProperties.MDC_TIMER)).thenReturn("1400");
-
- actualFieldsValidator = userRolesController.putAppsWithAdminRoleStateForUser(mockedRequest, newAppsListWithAdminRoles, mockedResponse);
-
- System.out.println(actualFieldsValidator);
- Mockito.when(searchService.searchUsersInPhoneBook(searchString)).thenReturn(actualResult);
-
- actualResult = userRolesController.getPhoneBookSearchResult(mockedRequest, searchString, mockedResponse);
- assertEquals(expectedResult, actualResult);
-
- }*/
-
- /*@Test
- public void putAppsWithAdminRoleStateForUserTest(){
- FieldsValidator actualFieldsValidator = null;
- AppsListWithAdminRole newAppsListWithAdminRoles = new AppsListWithAdminRole();
- FieldsValidator expectedFieldsValidator = new FieldsValidator();
- List<FieldName> fieldNames = new ArrayList<FieldName>();
- expectedFieldsValidator.setErrorCode(null);
- expectedFieldsValidator.setFields(fieldNames);
- expectedFieldsValidator.setHttpStatusCode((long)200);
-
- EPUser user = mockUser.mockEPUser();
- PowerMockito.mockStatic(EPCommonSystemProperties.class);
- PowerMockito.mockStatic(EcompAuditLog.class);
- PowerMockito.mockStatic(SystemProperties.class);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(adminRolesService.setAppsWithAdminRoleStateForUser(newAppsListWithAdminRoles));
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-
- // Mockito.call(auditService.logActivity(auditLog, null));
-// Mockito.when(SystemProperties.getProperty(EcompAuditLog.CD_ACTIVITY_UPDATE_ACCOUNT_ADMIN)).thenReturn("1400");
-// Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP)).thenReturn("1400");
-// Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP)).thenReturn("1400");
-// Mockito.when(SystemProperties.getProperty(SystemProperties.MDC_TIMER)).thenReturn("1400");
-
- actualFieldsValidator = userRolesController.putAppsWithAdminRoleStateForUser(mockedRequest, newAppsListWithAdminRoles, mockedResponse);
- assertEquals(expectedFieldsValidator, actualFieldsValidator);
- }*/
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.controller;
-
-import static org.junit.Assert.*;
-
-import java.io.InputStream;
-import java.nio.charset.StandardCharsets;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.io.IOUtils;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.controller.WebAnalyticsExtAppController;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.AdminRolesServiceImpl;
-import org.openecomp.portalapp.portal.service.AppsCacheService;
-import org.openecomp.portalapp.portal.service.AppsCacheServiceImple;
-import org.openecomp.portalapp.portal.transport.Analytics;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.openecomp.portalsdk.core.onboarding.crossapi.PortalAPIResponse;
-import org.openecomp.portalsdk.core.service.AuditService;
-import org.openecomp.portalsdk.core.service.AuditServiceImpl;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({SystemProperties.class,IOUtils.class,Object.class})
-public class WebAnalyticsExtAppControllerTest {
-
-
-
- @InjectMocks
- WebAnalyticsExtAppController webAnalyticsExtAppController = new WebAnalyticsExtAppController();
-
- @Mock
- AdminRolesService adminRolesService = new AdminRolesServiceImpl();
-
- @Mock
- AppsCacheService appCacheService = new AppsCacheServiceImple();
-
- @Mock
- AuditService auditService = new AuditServiceImpl();
-
-// @Mock
-// InputStream analyticsFileStream;
-
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
- NullPointerException nullPointerException = new NullPointerException();
-
- /*@Test
- public void getAnalyticsScriptTest() throws Exception
- {
- String expectedResponse = "http://www.ecomp.com";
-
- InputStream analyticsFileStream = null;
- PowerMockito.mockStatic(SystemProperties.class);
- PowerMockito.mockStatic(IOUtils.class);
- Mockito.when(IOUtils.toString(analyticsFileStream, StandardCharsets.UTF_8.name())).thenReturn("PORTAL_ENV_URL");
- Mockito.when(SystemProperties.getProperty("frontend_url")).thenReturn("http://www.ecomp.com/test");
- String actualResponse = webAnalyticsExtAppController.getAnalyticsScript(mockedRequest);
-// assertNull(webAnalyticsExtAppController.getAnalyticsScript(mockedRequest));
-
- // System.out.println(actualResponse);
- assertTrue(actualResponse.equals(expectedResponse));
- }*/
-
- /*@Test
- public void getAnalyticsScriptExceptionTest() throws Exception
- {
- String expectedResponse = "";
- InputStream analyticsFileStream = null;
- PowerMockito.mockStatic(SystemProperties.class);
- PowerMockito.mockStatic(IOUtils.class);
- Mockito.when(IOUtils.toString(analyticsFileStream, StandardCharsets.UTF_8.name())).thenThrow(nullPointerException);
- Mockito.when(SystemProperties.getProperty("frontend_url")).thenReturn("http://www.ecomp.com/test");
- String actualResponse = webAnalyticsExtAppController.getAnalyticsScript(mockedRequest);
- assertEquals(actualResponse,expectedResponse);
- }*/
-
- @Test
- public void storeAnalyticsScriptIfAnalyticsNullTest() throws Exception
- {
- PortalAPIResponse expectedPortalAPIResponse = new PortalAPIResponse(true, "error");
- Analytics analytics= null;
- Mockito.when(mockedRequest.getHeader("uebkey")).thenReturn(null);
- PortalAPIResponse actualPortalAPIResponse = webAnalyticsExtAppController.storeAnalyticsScript(mockedRequest, analytics);
- assertTrue(expectedPortalAPIResponse.getMessage().equals(actualPortalAPIResponse.getMessage()));
- assertTrue(expectedPortalAPIResponse.getStatus().equals(actualPortalAPIResponse.getStatus()));
- }
-
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.controller;
-
-import static org.junit.Assert.assertEquals;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.controller.DashboardController;
-import org.openecomp.portalapp.portal.domain.WidgetCatalog;
-import org.openecomp.portalapp.portal.domain.WidgetServiceHeaders;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.service.ConsulHealthService;
-import org.openecomp.portalapp.portal.service.ConsulHealthServiceImpl;
-import org.openecomp.portalapp.portal.service.DashboardSearchService;
-import org.openecomp.portalapp.portal.service.DashboardSearchServiceImpl;
-import org.openecomp.portalapp.portal.service.MicroserviceService;
-import org.openecomp.portalapp.portal.service.MicroserviceServiceImpl;
-import org.openecomp.portalapp.portal.service.WidgetParameterService;
-import org.openecomp.portalapp.portal.service.WidgetParameterServiceImpl;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
-import org.openecomp.portalapp.portal.transport.CommonWidgetMeta;
-import org.openecomp.portalapp.portal.utils.CustomLoggingFilter;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.client.RestClientException;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({EPUserUtils.class})
-public class WidgetsCatalogController {
-
- @Mock
- ConsulHealthService consulHealthService = new ConsulHealthServiceImpl();
-
- @Mock
- MicroserviceService microserviceService = new MicroserviceServiceImpl();
-
- @Mock
- WidgetParameterService widgetParameterService = new WidgetParameterServiceImpl();
-
- @InjectMocks
- WidgetsCatalogController widgetsCatalogController = new WidgetsCatalogController();
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-
- NullPointerException nullPointerException = new NullPointerException();
-
- MockEPUser mockUser = new MockEPUser();
-
- /*public List<WidgetCatalog> getUserWidgetCatalog(HttpServletRequest request, HttpServletResponse response,
- @PathVariable("loginName") String loginName) throws RestClientException, Exception {
- List<WidgetCatalog> widgets = new ArrayList<>();
- try {
- CustomLoggingFilter d;
- ResponseEntity<ArrayList> ans = template.exchange(
- EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService,
- SystemProperties.getProperty("microservices.widget.local.port"))
- + "/widget/microservices/widgetCatalog/" + loginName,
- HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), ArrayList.class);
- widgets = ans.getBody();
- } catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, "getUserWidgetCatalog failed", e);
- // returning null because null help check on the UI if there was a
- // communication problem with Microservice.
- return null;
- }
- return widgets;
- }
-
- @Test
- public void getWidgetDataTest(){
-
- String resourceType = null;
- List<WidgetCatalog> expectedData = new ArrayList<WidgetCatalog>();
- expectedData.setStatus(PortalRestStatusEnum.ERROR);
- expectedData.setMessage("Unexpected resource type null");
- expectedData.setResponse(null);
-
- PortalRestResponse<CommonWidgetMeta> actualResponse = dashboardController.getWidgetData(mockedRequest, resourceType);
- assertEquals(expectedData,actualResponse);
-
-
- }*/
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.controller;
-
-import static org.junit.Assert.assertTrue;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.controller.WidgetsCatalogMarkupController;
-import org.openecomp.portalapp.portal.domain.WidgetServiceHeaders;
-import org.openecomp.portalapp.portal.service.ConsulHealthService;
-import org.openecomp.portalapp.portal.service.ConsulHealthServiceImpl;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-import org.springframework.web.client.RestClientException;
-import org.springframework.web.client.RestTemplate;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest(WidgetServiceHeaders.class)
-public class WidgetsCatalogMarkupControllerTest extends MockitoTestSuite {
-
- @InjectMocks
- WidgetsCatalogMarkupController widgetsCatalogMarkupController = new WidgetsCatalogMarkupController();
-
- @Mock
- ConsulHealthService consulHealthService = new ConsulHealthServiceImpl();
-
- @Mock
- RestTemplate template = new RestTemplate();
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
- @Mock
- CipherUtil cipherUtil= new CipherUtil();
-
- @Mock
- EcompPortalUtils EcompPortalUtils =new EcompPortalUtils();
-
- @Mock
- WidgetServiceHeaders WidgetServiceHeaders ;
-
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-
- @SuppressWarnings("static-access")
- @Test
- public void getWidgetMarkupTest() throws RestClientException, Exception
- {
- String whatService = "widgets-service";
- PowerMockito.mockStatic(WidgetServiceHeaders.class);
- Mockito.when(template.getForObject(EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService, null) + "/widget/microservices/markup/" + 1, String.class,
- WidgetServiceHeaders.getInstance())).thenReturn("Success");
- String response = widgetsCatalogMarkupController.getWidgetMarkup(mockedRequest, mockedResponse, 1);
- assertTrue(response.equals("Success"));
- }
-
-}
+++ /dev/null
-/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ================================================================================
- */
-package org.openecomp.portalapp.portal.test.core;
-
-import java.util.Date;
-
-import org.openecomp.portalapp.portal.domain.EPUser;
-
-public class MockEPUser {
-
- public EPUser mockEPUser() {
-
- EPUser ePUser = new EPUser();
- ePUser.setOrgId(null);
- ePUser.setManagerId(null);
- ePUser.setFirstName("test");
- ePUser.setLastName("test");
- ePUser.setMiddleInitial(null);
- ePUser.setPhone(null);
- ePUser.setFax(null);
- ePUser.setCellular(null);
- ePUser.setEmail(null);
- ePUser.setAddressId(null);
- ePUser.setAlertMethodCd(null);
- ePUser.setHrid(null);
- ePUser.setOrgUserId("guestT");
- ePUser.setOrgCode(null);
- ePUser.setAddress1(null);
- ePUser.setAddress2(null);
- ePUser.setCity(null);
- ePUser.setState(null);
- ePUser.setZipCode(null);
- ePUser.setCountry(null);
- ePUser.setOrgManagerUserId(null);
- ePUser.setLocationClli(null);
- ePUser.setBusinessCountryCode(null);
- ePUser.setBusinessCountryName(null);
- ePUser.setBusinessUnit(null);
- ePUser.setBusinessUnitName(null);
- ePUser.setDepartment(null);
- ePUser.setDepartmentName(null);
- ePUser.setCompanyCode(null);
- ePUser.setCompany(null);
- ePUser.setZipCodeSuffix(null);
- ePUser.setJobTitle(null);
- ePUser.setCommandChain(null);
- ePUser.setSiloStatus(null);
- ePUser.setCostCenter(null);
- ePUser.setFinancialLocCode(null);
-
- ePUser.setLoginId(null);
- ePUser.setLoginPwd(null);
- Date date = new Date();
- ePUser.setLastLoginDate(date);
- ePUser.setActive(true);
- ePUser.setInternal(false);
- ePUser.setSelectedProfileId(null);
- ePUser.setTimeZoneId(null);
- ePUser.setOnline(true);
- ePUser.setChatId(null);
- ePUser.setUserApps(null);
- ePUser.setPseudoRoles(null);
-
- ePUser.setId((long) -1);
- return ePUser;
- }
-}
+++ /dev/null
-/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ================================================================================
- */
-package org.openecomp.portalapp.portal.test.core;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-
-import javax.sql.DataSource;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.openecomp.portalapp.test.framework.ApplicationCommonContextTestSuite;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.jdbc.datasource.DataSourceUtils;
-import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator;
-
-public class PopulateSampleTestData extends ApplicationCommonContextTestSuite {
-
- @Autowired
- DataSource dataSource;
-
- @Before
- public void populateTestData() throws SQLException {
-
- String sql = "PopulateTestData.sql";
- createConnection(sql);
- }
-
- public void createConnection(String sql) {
- Connection connection = null;
- ResourceDatabasePopulator populator = new ResourceDatabasePopulator();
- populator.addScript(new ClassPathResource(sql));
- try {
- connection = DataSourceUtils.getConnection(dataSource);
- populator.populate(connection);
- } finally {
- if (connection != null) {
- DataSourceUtils.releaseConnection(connection, dataSource);
- }
- }
- }
-
- @Test
- public void populateTest() {
- assert (true);
- }
-
-}
+++ /dev/null
-/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ================================================================================
- */
-package org.openecomp.portalapp.portal.test.core;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-
-import javax.sql.DataSource;
-
-import org.junit.After;
-import org.junit.Test;
-import org.openecomp.portalapp.test.framework.ApplicationCommonContextTestSuite;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.jdbc.datasource.DataSourceUtils;
-import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator;
-
-public class RemoveSampleTestData extends ApplicationCommonContextTestSuite {
- @Autowired
- DataSource dataSource;
-
- public static int count = 0;
-
- @After
- public void removeTestData() throws SQLException {
- String sql = "RemoveTestData.sql";
- createConnection(sql);
- }
-
- public void createConnection(String sql) {
- Connection connection = null;
- ResourceDatabasePopulator populator = new ResourceDatabasePopulator();
- populator.addScript(new ClassPathResource(sql));
- try {
- connection = DataSourceUtils.getConnection(dataSource);
- populator.populate(connection);
- } finally {
- if (connection != null) {
- DataSourceUtils.releaseConnection(connection, dataSource);
- }
- }
- }
-
- @Test
- public void removeTest() {
- assert (true);
- }
-}
+++ /dev/null
-/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ================================================================================
- */
-package org.openecomp.portalapp.portal.test.core;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import java.nio.charset.Charset;
-import java.util.ArrayList;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.transport.AppNameIdIsAdmin;
-import org.openecomp.portalapp.portal.transport.AppsListWithAdminRole;
-import org.openecomp.portalapp.test.framework.ApplicationCommonContextTestSuite;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.http.MediaType;
-import org.springframework.test.web.servlet.ResultActions;
-import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;
-import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-/**
- *
- * Use RestURLsTestSuite to test Rest API URL's
- */
-public class RestURLsTestSuite extends ApplicationCommonContextTestSuite {
-
- public static final MediaType APPLICATION_JSON_UTF8 = new MediaType(MediaType.APPLICATION_JSON.getType(),
- MediaType.APPLICATION_JSON.getSubtype(), Charset.forName("utf8"));
-
- String url = null;
-
- MockEPUser mockUser = new MockEPUser();
-
- public byte[] convertObjectToJsonBytes(Object object) throws IOException {
- ObjectMapper mapper = new ObjectMapper();
- mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
- return mapper.writeValueAsBytes(object);
- }
-
- public void requestBuilder(String url) throws Exception {
- EPUser user = mockUser.mockEPUser();
-
- MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.get(url);
- requestBuilder.sessionAttr(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
- ResultActions ra = getMockMvc().perform(requestBuilder);
- assertData(ra);
- }
-
- public void assertData(ResultActions ra) {
- Assert.assertEquals("application/json", ra.andReturn().getResponse().getContentType());
- Assert.assertEquals(200, ra.andReturn().getResponse().getStatus());
-
- }
-
- @Test
- public void getMenuItemsTest() throws Exception {
- url = "/portalApi/functionalMenu";
- requestBuilder(url);
- }
-
- @Test
- public void getMenuItemsForNotificationsTest() throws Exception {
- url = "/portalApi/functionalMenuForNotificationTree";
- requestBuilder(url);
- }
-
- @Test
- public void getUserAppsTestnew() throws Exception {
- url = "/portalApi/userApps";
- requestBuilder(url);
- }
-
- @Test
- public void getPersUserAppsTest() throws Exception {
- url = "/portalApi/persUserApps";
- requestBuilder(url);
- }
-
- @Test
- public void getAppCatalogTest() throws Exception {
- url = "/portalApi/appCatalog";
- requestBuilder(url);
- }
-
- @Test
- public void getAppListNewTest() throws Exception {
- ResultActions ra = getMockMvc()
- .perform(MockMvcRequestBuilders.get("/portalApi/userApplicationRoles").param("userId", "guest"));
- assertData(ra);
- }
-
- @Test
- public void getAvailableAppListTest() throws Exception {
- url = "/portalApi/availableApps";
- requestBuilder(url);
- }
-
- @Test
- public void getAllAppsTest() throws Exception {
- url = "/portalApi/allAvailableApps";
- requestBuilder(url);
- }
-
- @Test
- public void getUserProfileTest() throws Exception {
- url = "/portalApi/userProfile";
- requestBuilder(url);
- }
-
- @Test
- public void getRolesByAppTest() throws Exception {
- EPUser user = mockUser.mockEPUser();
- MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.get("/portalApi/adminAppsRoles/550");
- requestBuilder.sessionAttr(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
- ResultActions ra = getMockMvc().perform(requestBuilder);
- assertData(ra);
- }
-
- @Test
- public void getAppsWithAdminRoleStateForUserTest() throws Exception {
- url = "/portalApi/adminAppsRoles?user=guest";
- requestBuilder(url);
-
- }
-
- @Test
- public void getUsersFromAppEndpointTest() throws Exception {
- url = "/portalApi/app/550/users";
- requestBuilder(url);
- }
-
- @Test
- public void getOnboardingAppsTest() throws Exception {
- url = "/portalApi/onboardingApps";
- requestBuilder(url);
- }
-
- @Test
- public void getMenuItemsForAuthUserTest() throws Exception {
- url = "/portalApi/functionalMenuForAuthUser";
- requestBuilder(url);
- }
-
- @Test
- public void getMenuItemsForEditingTest() throws Exception {
- url = "/portalApi/functionalMenuForEditing";
- requestBuilder(url);
- }
-
- @Test
- public void getAppRolesTest() throws Exception {
- url = "/portalApi/appRoles/455";
- requestBuilder(url);
- }
-
- @Test
- public void regenerateAncestorTableTest() throws Exception {
-
- EPUser user = mockUser.mockEPUser();
-
- MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders
- .get("/portalApi/regenerateFunctionalMenuAncestors");
- requestBuilder.sessionAttr(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
- ResultActions ra = getMockMvc().perform(requestBuilder);
- assertEquals("application/json;charset=UTF-8", ra.andReturn().getResponse().getContentType());
- Assert.assertEquals(200, ra.andReturn().getResponse().getStatus());
-
- }
-
- @Test
- public void getAppListTest() throws Exception {
- url = "/portalApi/getAppList";
- requestBuilder(url);
- }
-
- @Test
- public void getFavoritesForUserTest() throws Exception {
- url = "/portalApi/getFavoriteItems";
- requestBuilder(url);
- }
-
- @Test
- public void getManifestTest() throws Exception {
- url = "/portalApi/manifest";
- requestBuilder(url);
- }
-
- @Test
- public void getActiveUsersTest() throws Exception {
- url = "/portalApi/dashboard/activeUsers";
- requestBuilder(url);
- }
-
- @Test
- public void searchPortalTest() throws Exception {
- EPUser user = mockUser.mockEPUser();
- MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.get("/portalApi/dashboard/search")
- .param("searchString", "guest");
- requestBuilder.sessionAttr(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
- ResultActions ra = getMockMvc().perform(requestBuilder);
- assertData(ra);
- }
-
- @Test
- public void getWidgetDataTest() throws Exception {
- EPUser user = mockUser.mockEPUser();
- MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.get("/portalApi/dashboard/widgetData")
- .param("resourceType", "guest");
- requestBuilder.sessionAttr(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
- ResultActions ra = getMockMvc().perform(requestBuilder);
- assertData(ra);
- }
-
- @Test
- public void getAppsAndContactsTest() throws Exception {
- url = "/portalApi/contactus/allapps";
- requestBuilder(url);
- }
-
- @Test
- public void getPortalDetailsTest() throws Exception {
- url = "/portalApi/contactus/feedback";
- requestBuilder(url);
- }
-
- @Test
- public void getAppCategoryFunctionsTest() throws Exception {
- url = "/portalApi/contactus/functions";
- requestBuilder(url);
- }
-
- @Test
- public void getOnlineUserUpdateRateTest() throws Exception {
- url = "/portalApi/dashboard/onlineUserUpdateRate";
- requestBuilder(url);
- }
-
- @Test
- public void getMenuIdRoleIdTest() throws Exception {
- url = "/portalApi/getFunctionalMenuRole";
- requestBuilder(url);
- }
-
- @Test
- public void getNotificationsTest() throws Exception {
- url = "/portalApi/getNotifications";
- requestBuilder(url);
- }
-
- @Test
- public void getAdminNotificationsTest() throws Exception {
- url = "/portalApi/getAdminNotifications";
- requestBuilder(url);
- }
-
- @Test
- public void getNotificationAppRolesTest() throws Exception {
- url = "/portalApi/getNotificationAppRoles";
- requestBuilder(url);
- }
-
- @Test
- public void getNotificationUpdateRateTest() throws Exception {
- url = "/portalApi/notificationUpdateRate";
- requestBuilder(url);
- }
-
- @Test
- public void notificationReadTest() throws Exception {
- url = "/portalApi/notificationRead?notificationId=262";
- requestBuilder(url);
- }
-
- @Test
- public void testGetRolesTest() throws Exception {
- url = "/portalApi/notificationRole/248/roles";
- requestBuilder(url);
- }
-
- @Test
- public void putAppsWithAdminRoleStateForUserTest() throws Exception {
-
- AppsListWithAdminRole appsListWithAdminRole = new AppsListWithAdminRole();
- appsListWithAdminRole.setOrgUserId("guest");
- ArrayList<AppNameIdIsAdmin> appsRoles = new ArrayList<AppNameIdIsAdmin>();
- AppNameIdIsAdmin appNameIdIsAdmin = new AppNameIdIsAdmin();
- appNameIdIsAdmin.setId((long) 455);
- appNameIdIsAdmin.setAppName("CCD");
- appNameIdIsAdmin.setIsAdmin(true);
- appNameIdIsAdmin.setRestrictedApp(false);
- appsRoles.add(appNameIdIsAdmin);
- appsListWithAdminRole.setAppsRoles(appsRoles);
- EPUser user = mockUser.mockEPUser();
- MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.put("/portalApi/adminAppsRoles")
- .contentType(APPLICATION_JSON_UTF8).content(convertObjectToJsonBytes(appsListWithAdminRole));
-
- requestBuilder.sessionAttr(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
- ResultActions ra = getMockMvc().perform(requestBuilder);
- assertData(ra);
- }
-
- @Test
- public void ticketEventControllerForExternalSystem() throws Exception {
- String ticketEventJson = "{\"application\": \"cbus\",\"event\": {\"body\": {\"ticketStatePhrase\": \"We recently detected a problem with the equipment at your site. The event is in queue for immediate work.\", \"ivrNotificationFlag\": \"1\",\"expectedRestoreDate\": 0,\"bridgeTransport\": \"AOTS\", \"reptRequestType\": 0,\"ticketNum\": \"000002000857405\",\"assetID\": \"CISCO_1921C1_ISR_G2\", \"eventDate\": 1490545134601,\"eventAbstract\": \"ospfIfConfigError trap received from Cisco_1921c1_ISR_G2 with arguments: ospfRouterId=Cisco_1921c1_ISR_G2; ospfIfIpAddress=1921c1_288266; ospfAddressLessIf=0; ospfPacketSrc=172.17.0.11; ospfConfigErrorType=2; ospfPacketType=1\",\"severity\": \"2 - Major\",\"ticketPriority\": \"3\",\"reportedCustomerImpact\": 0,\"testAutoIndicator\": 0,\"supportGroupName\": \"US-TEST-ORT\",\"lastModifiedDate\": \"1487687703\",\"messageGroup\": \"SNMP\",\"csi\": 0,\"mfabRestoredTime\": 0},\"header\": {\"timestamp\": \"2017-02-21T14:35:05.219+0000\",\"eventSource\": \"aotstm\",\"entityId\": \"000002000857405\", \"sequenceNumber\": 2 },\"blinkMsgId\": \"f38c071e-1a47-4b55-9e72-1db830100a61\",\"sourceIP\": \"130.4.165.158\"},\"SubscriberInfo\": {\"UserList\": [\"hk8777\"] }}";
- MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.post("/auxapi/ticketevent")
- .contentType(APPLICATION_JSON_UTF8).content(ticketEventJson);
- ResultActions ra = getMockMvc().perform(requestBuilder);
- assertTrue(ra.andReturn().getResponse().getContentType().contains("application/json"));
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.AdminUserApp;
-
-public class AdminUserAppTest {
-
- public AdminUserApp mockAdminUserApp(){
-
- AdminUserApp adminUserApp = new AdminUserApp();
-
- adminUserApp.setUserId((long)1);
- adminUserApp.setFirstName("test");
- adminUserApp.setLastName("test");
- adminUserApp.setOrgUserId("test");
- adminUserApp.setAppId((long)1);
- adminUserApp.setAppName("test");
-
- return adminUserApp;
- }
-
- @Test
- public void adminUserAppTest(){
- AdminUserApp adminUserApp = mockAdminUserApp();
-
- assertEquals(adminUserApp.getUser_Id(), new Long(1));
- assertEquals(adminUserApp.getFirstName(), "test");
- assertEquals(adminUserApp.getLastName(), "test");
- assertEquals(adminUserApp.getOrgUserId(), "test");
- assertEquals(adminUserApp.getAppName(), "test");
- assertEquals(adminUserApp.getAppId(), new Long(1));
-
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import javax.persistence.Column;
-import javax.persistence.Id;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.AdminUserApp;
-import org.openecomp.portalapp.portal.domain.AdminUserApplications;
-
-public class AdminUserApplicationsTest {
-
- public AdminUserApplications mockAdminUserApplications(){
-
- AdminUserApp adminUserApp = new AdminUserApp();
-
- adminUserApp.setUserId((long)1);
- adminUserApp.setFirstName("test");
- adminUserApp.setLastName("test");
- adminUserApp.setOrgUserId("test");
- adminUserApp.setAppId((long)1);
- adminUserApp.setAppName("test");
-
- AdminUserApplications adminUserApplications = new AdminUserApplications(adminUserApp);
-
- adminUserApplications.setUser_Id((long)1);
- adminUserApplications.setFirstName("test");
- adminUserApplications.setLastName("test");
- adminUserApplications.setOrgUserId("test");
- return adminUserApplications;
- }
-
- @Test
- public void adminUserAppTest(){
- AdminUserApplications adminUserApplications = mockAdminUserApplications();
- AdminUserApp adminUserApp = new AdminUserApp();
-
- adminUserApp.setUserId((long)1);
- adminUserApp.setFirstName("test");
- adminUserApp.setLastName("test");
- adminUserApp.setOrgUserId("test");
- adminUserApp.setAppId((long)1);
- adminUserApp.setAppName("test");
- AdminUserApplications adminUserApplications1 = new AdminUserApplications(adminUserApp);
-
- assertEquals(adminUserApplications.getUser_Id(), new Long(1));
- assertEquals(adminUserApplications.getFirstName(), "test");
- assertEquals(adminUserApplications.getLastName(), "test");
- assertEquals(adminUserApplications.getOrgUserId(), "test");
-
-
- assertEquals(adminUserApplications1.getApps().get(0).getAppId(),adminUserApp.getAppId());
- assertEquals(adminUserApplications1.getApps().get(0).getAppName(),adminUserApp.getAppName());
-
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.AppContactUs;
-
-public class AppContactUsTest {
-
- public AppContactUs mockAppContactUs(){
- AppContactUs appContactUs = new AppContactUs();
- appContactUs.setDescription("test");
- appContactUs.setContactEmail("test");
- appContactUs.setContactName("test");
- appContactUs.setUrl("test");
- appContactUs.setActiveYN("test");
-
- return appContactUs;
- }
-
- @Test
- public void mockAppContactUsTest(){
- AppContactUs appContactUs = mockAppContactUs();
-
- assertEquals(appContactUs.getDescription(), "test");
- assertEquals(appContactUs.getContactEmail(), "test");
- assertEquals(appContactUs.getContactName(), "test");
- assertEquals(appContactUs.getUrl(), "test");
- assertEquals(appContactUs.getActiveYN(), "test");
-
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.CentralRoleFunction;
-
-public class CentralRoleFunctionTest {
-
- public CentralRoleFunction mockCentralRoleFunction(){
-
- CentralRoleFunction centralRoleFunction = new CentralRoleFunction();
-
- centralRoleFunction.setCode("test");
- centralRoleFunction.setName("test");
- centralRoleFunction.setAppId((long)1);
- centralRoleFunction.setEditUrl("test");
-
- return centralRoleFunction;
- }
-
- @Test
- public void centralRoleFunctionTest(){
- CentralRoleFunction centralRoleFunction = mockCentralRoleFunction();
-
- assertEquals(centralRoleFunction.getAppId(), new Long(1));
- assertEquals(centralRoleFunction.getCode(), "test");
- assertEquals(centralRoleFunction.getName(), "test");
- assertEquals(centralRoleFunction.getEditUrl(), "test");
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPAppRoleFunction;
-
-public class EPAppRoleFunctionTest {
-
- public EPAppRoleFunction mockEPAppRoleFunction(){
- EPAppRoleFunction epAppRoleFunction = new EPAppRoleFunction();
- epAppRoleFunction.setRoleId((long)1);
- epAppRoleFunction.setAppId((long)1);
- epAppRoleFunction.setCode("test");
-
- return epAppRoleFunction;
- }
-
- @Test
- public void epAppRoleFunctionTest(){
- EPAppRoleFunction epAppRoleFunction = mockEPAppRoleFunction();
-
- assertEquals(epAppRoleFunction.getRoleId(), new Long(1));
- assertEquals(epAppRoleFunction.getAppId(), new Long(1));
- assertEquals(epAppRoleFunction.getCode(), "test");
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPApp;
-
-public class EPAppTest {
-
- public EPApp mockEPApp(){
- EPApp epApp = new EPApp();
-
- epApp.setName("test");
- epApp.setImageUrl("test");
- epApp.setDescription("test");
- epApp.setNotes("test");
- epApp.setUrl("test");
- epApp.setAlternateUrl("test");
- epApp.setAppRestEndpoint("test");
- epApp.setMlAppName("test");
- epApp.setMlAppAdminId("test");
- epApp.setMotsId((long)1);
- epApp.setUsername("test");
- epApp.setAppPassword("test");
- epApp.setOpen(false);
- epApp.setEnabled(false);
- epApp.setUebTopicName("test");
- epApp.setUebSecret("test");
- epApp.setAppType(1);
- epApp.setCentralAuth(false);
- epApp.setNameSpace("test");
-
- return epApp;
- }
-
- @Test
- public void epAppTest(){
- EPApp epApp = mockEPApp();
-
- assertEquals(epApp.getName(), "test");
- assertEquals(epApp.getImageUrl(), "test");
- assertEquals(epApp.getDescription(), "test");
- assertEquals(epApp.getNotes(), "test");
- assertEquals(epApp.getUrl(), "test");
- assertEquals(epApp.getAlternateUrl(), "test");
- assertEquals(epApp.getAppRestEndpoint(), "test");
- assertEquals(epApp.getMlAppName(), "test");
- assertEquals(epApp.getMlAppAdminId(), "test");
- assertEquals(epApp.getMotsId(), new Long(1));
- assertEquals(epApp.getUsername(), "test");
- assertEquals(epApp.getAppPassword(), "test");
- assertEquals(epApp.getOpen(), false);
- assertEquals(epApp.getEnabled(), false);
- assertEquals(epApp.getUebTopicName(), "test");
- assertEquals(epApp.getUebSecret(), "test");
- assertEquals(epApp.getAppType(), Integer.valueOf(1));
- assertEquals(epApp.getCentralAuth(), false);
- assertEquals(epApp.getNameSpace(), "test");
-
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPEndpointAccount;
-
-public class EPEndpointAccountTest {
-
- public EPEndpointAccount mockEPEndpointAccount(){
- EPEndpointAccount epEndpointAccount = new EPEndpointAccount();
-
- epEndpointAccount.setEp_id((long)1);
- epEndpointAccount.setAccount_id((long)1);
- epEndpointAccount.setId((long)1);
-
- return epEndpointAccount;
- }
-
- @Test
- public void epEndpointAccount(){
- EPEndpointAccount epEndpointAccount = mockEPEndpointAccount();
- assertEquals(epEndpointAccount.getEp_id(), new Long(1));
- assertEquals(epEndpointAccount.getAccount_id(), new Long(1));
- assertEquals(epEndpointAccount.getId(), new Long(1));
-
- assertEquals(epEndpointAccount.toString(), "EPEndpointAccount [id=1, ep_id=1, account_id=1]");
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPEndpoint;
-
-public class EPEndpointTest {
-
- public EPEndpoint mockEPEndpoint(){
- EPEndpoint epEndpoint = new EPEndpoint();
-
- epEndpoint.setId((long)1);
- epEndpoint.setName("test");
-
- return epEndpoint;
- }
-
- @Test
- public void epEndpointTest(){
- EPEndpoint epEndpoint = mockEPEndpoint();
-
- assertEquals(epEndpoint.getId(), new Long(1));
- assertEquals(epEndpoint.getName(), "test");
- assertEquals("EPEndpoint [id=1, name=test]", epEndpoint.toString());
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPRole;
-
-public class EPRoleTest {
-
- public EPRole mockEPRole(){
- EPRole epRole = new EPRole();
-
- epRole.setName("test");
- epRole.setActive(false);
- epRole.setPriority(1);
- epRole.setAppId((long)1);
- epRole.setAppRoleId((long)1);
-
- return epRole;
- }
-
- @Test
- public void epRoleTest(){
- EPRole epRole = mockEPRole();
-
- assertEquals(epRole.getName(), "test");
- assertEquals(epRole.getActive(), false);
- assertEquals(epRole.getPriority().toString(),"1");
- assertEquals(epRole.getAppId(), new Long(1));
- assertEquals(epRole.getAppRoleId(), new Long(1));
-
- assertEquals(epRole.toString(), "[Id = null, name = test]");
-
-
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPUserAppCatalogRoles;
-
-public class EPUserAppCatalogRolesTest {
-
- public EPUserAppCatalogRoles mockEPUserAppCatalogRoles(){
- EPUserAppCatalogRoles epUserAppCatalogRoles = new EPUserAppCatalogRoles();
-
- epUserAppCatalogRoles.setRequestedRoleId((long)1);
- epUserAppCatalogRoles.setRolename("test");
- epUserAppCatalogRoles.setRequestStatus("status");
- epUserAppCatalogRoles.setAppId((long)1);
-
- return epUserAppCatalogRoles;
- }
-
- @Test
- public void epUserAppCatalogRolesTest(){
- EPUserAppCatalogRoles epUserAppCatalogRoles = mockEPUserAppCatalogRoles();
-
- assertEquals(epUserAppCatalogRoles.getRequestedRoleId(), new Long(1));
- assertEquals(epUserAppCatalogRoles.getRolename(), "test");
- assertEquals(epUserAppCatalogRoles.getRequestStatus(), "status");
- assertEquals(epUserAppCatalogRoles.getAppId(), new Long(1));
-
- assertEquals("EPUserAppCatalogRoles [requestedRoleId=1, rolename=test, requestStatus=status, appId=1]", epUserAppCatalogRoles.toString());
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.Date;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPUserAppRolesRequest;
-import org.openecomp.portalapp.portal.domain.EPUserAppRolesRequestDetail;
-
-public class EPUserAppRolesRequestDetailTest {
-
- public EPUserAppRolesRequestDetail mockEPUserAppRolesRequestDetail(){
-
- EPUserAppRolesRequest epUserAppRolesRequest = new EPUserAppRolesRequest();
- epUserAppRolesRequest.setUserId((long)1);
- epUserAppRolesRequest.setAppId((long)1);
- epUserAppRolesRequest.setCreated(new Date());
- epUserAppRolesRequest.setUpdatedDate(new Date());
- epUserAppRolesRequest.setRequestStatus("test");
-
- EPUserAppRolesRequestDetail epUserAppRolesRequestDetail = new EPUserAppRolesRequestDetail();
- epUserAppRolesRequestDetail.setReqRoleId((long)1);
- epUserAppRolesRequestDetail.setReqType("test");
- epUserAppRolesRequestDetail.setEpRequestIdData(epUserAppRolesRequest);
-
- return epUserAppRolesRequestDetail;
- }
-
- @Test
- public void epUserAppRolesRequestDetailTest(){
-
- EPUserAppRolesRequest epUserAppRolesRequest = new EPUserAppRolesRequest();
- epUserAppRolesRequest.setUserId((long)1);
- epUserAppRolesRequest.setAppId((long)1);
- epUserAppRolesRequest.setCreated(new Date());
- epUserAppRolesRequest.setUpdatedDate(new Date());
- epUserAppRolesRequest.setRequestStatus("test");
-
- EPUserAppRolesRequestDetail epUserAppRolesRequestDetail = mockEPUserAppRolesRequestDetail();
-
- EPUserAppRolesRequestDetail epUserAppRolesRequestDetail1 = new EPUserAppRolesRequestDetail();
- epUserAppRolesRequestDetail1.setReqRoleId((long)1);
- epUserAppRolesRequestDetail1.setReqType("test");
- epUserAppRolesRequestDetail1.setEpRequestIdData(epUserAppRolesRequest);
-
- assertEquals(epUserAppRolesRequestDetail.getReqRoleId(), new Long(1));
- assertEquals(epUserAppRolesRequestDetail.getReqType(), "test");
- assertEquals(epUserAppRolesRequestDetail.getEpRequestIdData(), epUserAppRolesRequest);
- assertEquals(epUserAppRolesRequestDetail.hashCode(), epUserAppRolesRequestDetail1.hashCode());
-
- }
-
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPUserAppRoles;
-
-public class EPUserAppRolesTest {
-
- public EPUserAppRoles mockEPUserAppRoles(){
- EPUserAppRoles epUserAppRoles = new EPUserAppRoles();
-
- epUserAppRoles.setRoleId((long)1);
- epUserAppRoles.setAppId((long)1);
-
- return epUserAppRoles;
- }
-
- @Test
- public void epUserAppRolesTest(){
- EPUserAppRoles epUserAppRoles = mockEPUserAppRoles();
-
- assertEquals(epUserAppRoles.getRoleId(), new Long(1));
- assertEquals(epUserAppRoles.getAppId(), new Long(1));
- assertEquals("EpUserAppRoles [roleId=1, appId=1]", epUserAppRoles.toString());
- }
-}
-
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPRole;
-import org.openecomp.portalapp.portal.domain.EPUserApp;
-
-public class EPUserAppTest {
-
- public EPUserApp mockEPUserApp(){
-
- EPApp epApp = new EPApp();
- epApp.setName("test");
- epApp.setImageUrl("test");
- epApp.setDescription("test");
- epApp.setNotes("test");
- epApp.setUrl("test");
- epApp.setAlternateUrl("test");
- epApp.setAppRestEndpoint("test");
- epApp.setMlAppName("test");
- epApp.setMlAppAdminId("test");
- epApp.setMotsId((long)1);
- epApp.setUsername("test");
- epApp.setAppPassword("test");
-
-
- //Role
- EPRole epRole = new EPRole();
- epRole.setName("test");
- epRole.setActive(false);
- epRole.setPriority(1);
- epRole.setAppId((long)1);
- epRole.setAppRoleId((long)1);
-
- EPUserApp user = new EPUserApp();
- user.setUserId((long)1);
- user.setApp(epApp);
- user.setRole(epRole);
- user.setPriority((short)32767);
-
-
- return user;
- }
-
- @Test
- public void userTest(){
- EPUserApp user = mockEPUserApp();
-
- EPApp epApp = new EPApp();
- epApp.setName("test");
- epApp.setImageUrl("test");
- epApp.setDescription("test");
- epApp.setNotes("test");
- epApp.setUrl("test");
- epApp.setAlternateUrl("test");
- epApp.setAppRestEndpoint("test");
- epApp.setMlAppName("test");
- epApp.setMlAppAdminId("test");
- epApp.setMotsId((long)1);
- epApp.setUsername("test");
- epApp.setAppPassword("test");
- user.setApp(epApp);
-
- //Role
- EPRole epRole = new EPRole();
- epRole.setName("test");
- epRole.setActive(false);
- epRole.setPriority(1);
- epRole.setAppId((long)1);
- epRole.setAppRoleId((long)1);
-
-
- assertEquals(user.getUserId(),Long.valueOf(1));
- assertEquals(user.getApp(), epApp);
- assertEquals(user.getPriority().getClass(), Short.class);
-
- assertEquals(user.toString(), "[u: 1; a: null, r: null; appRoleId: 1]");
-
- assertEquals(user.hashCode(), user.hashCode());
-
-
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.assertEquals;
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPUserAppsManualSortPreference;
-
-public class EPUserAppsManualSortPreferenceTest {
-
- public EPUserAppsManualSortPreference mockEPUserAppsManualSortPreference(){
-
- EPUserAppsManualSortPreference epUserAppsManualSortPreference = new EPUserAppsManualSortPreference();
- epUserAppsManualSortPreference.setUserId(1);
- epUserAppsManualSortPreference.setAppId((long)1);
- epUserAppsManualSortPreference.setAppManualSortOrder(1);
-
- return epUserAppsManualSortPreference;
- }
-
- @Test
- public void epUserAppsManualSortPreferenceTest(){
-
- EPUserAppsManualSortPreference epUserAppsManualSortPreference = mockEPUserAppsManualSortPreference();
-
- assertEquals(epUserAppsManualSortPreference.getUserId(), 1);
- assertEquals(epUserAppsManualSortPreference.getAppId(), new Long(1));
- assertEquals(epUserAppsManualSortPreference.getAppManualSortOrder(), 1);
-
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.Date;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPUserAppsSortPreference;
-
-public class EPUserAppsSortPreferenceTest {
-
- public EPUserAppsSortPreference mockEPUserAppsSortPreferenceTest(){
-
- EPUserAppsSortPreference epUserAppsSortPreference = new EPUserAppsSortPreference();
- epUserAppsSortPreference.setUserId(1);
- epUserAppsSortPreference.setSortPref("test");
- epUserAppsSortPreference.setId((long)1);
- epUserAppsSortPreference.setCreated(new Date());
- epUserAppsSortPreference.setModified(new Date());
- epUserAppsSortPreference.setModifiedId((long)1);
- epUserAppsSortPreference.setRowNum((long)1);
- epUserAppsSortPreference.setAuditTrail(null);
-
- return epUserAppsSortPreference;
- }
-
- @Test
- public void epUserAppsSortPreferenceTest() {
- EPUserAppsSortPreference epUserAppsSortPreference = mockEPUserAppsSortPreferenceTest();
-
- assertEquals(epUserAppsSortPreference.getUserId(), 1);
- assertEquals(epUserAppsSortPreference.getSortPref(), "test");
- assertEquals(epUserAppsSortPreference.getId(), new Long(1));
- assertEquals(epUserAppsSortPreference.getCreated(), new Date());
- assertEquals(epUserAppsSortPreference.getModified(), new Date());
- assertEquals(epUserAppsSortPreference.getModifiedId(), new Long(1));
- assertEquals(epUserAppsSortPreference.getRowNum(), new Long(1));
- assertEquals(epUserAppsSortPreference.getAuditTrail(), null);
-
-
- }
-
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.Date;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPUserNotification;
-
-public class EPUserNotificationTest {
-
- public EPUserNotification mockEPUserNotification(){
-
- EPUserNotification epUserNotification = new EPUserNotification();
-
- epUserNotification.setUserId((long)1);
- epUserNotification.setNotificationId((long)1);
- epUserNotification.setViewed("test");
- epUserNotification.setUpdateTime(new Date());
-
- return epUserNotification;
- }
-
- @Test
- public void epUserNotificationTest(){
- EPUserNotification epUserNotification = mockEPUserNotification();
-
- assertEquals(epUserNotification.getUserId(), new Long(1));
- assertEquals(epUserNotification.getNotificationId(), new Long(1));
- assertEquals(epUserNotification.getViewed(), "test");
- // assertEquals(epUserNotification.getUpdateTime(), new Date());
-
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.Date;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPUser;
-
-public class EPUserTest {
-
- public EPUser mockEPUser(){
-
- EPUser epUser = new EPUser();
-
- epUser.setId((long)1);
- epUser.setManagerId((long) 1234);
- epUser.setFirstName("test");
- epUser.setLastName("test");
- epUser.setMiddleInitial("test");
- epUser.setPhone("test");
- epUser.setFax("test");
- epUser.setCellular("test");
- epUser.setEmail("test");
- epUser.setAddressId((long) 123);
- epUser.setAlertMethodCd("test");
- epUser.setHrid("test");
- epUser.setOrgUserId("test");
- epUser.setOrgCode("test");
- epUser.setAddress1("test");
- epUser.setAddress2("test");
- epUser.setCity("test");
- epUser.setState("test");
- epUser.setZipCode("test");
- epUser.setCountry("test");
- epUser.setOrgManagerUserId("test");
- epUser.setLocationClli("test");
- epUser.setBusinessCountryCode("test");
- epUser.setBusinessCountryName("test");
- epUser.setBusinessUnit("test");
- epUser.setBusinessUnitName("test");
- epUser.setDepartment("test");
- epUser.setDepartmentName("test");
- epUser.setCompanyCode("test");
- epUser.setCompany("test");
- epUser.setZipCodeSuffix("test");
- epUser.setJobTitle("test");
- epUser.setCommandChain("test");
- epUser.setSiloStatus("test");
- epUser.setCostCenter("test");
- epUser.setFinancialLocCode("test");
- epUser.setLoginId("test");
- epUser.setLoginPwd("test");
- epUser.setLastLoginDate(new Date());
- epUser.setActive(false);
- epUser.setInternal(false);
- epUser.setSelectedProfileId((long) 12345);
- epUser.setTimeZoneId((long) 12345);
- epUser.setOnline(false);
- epUser.setChatId("test");
- return epUser;
-
- }
-
- @Test
- public void userTest(){
- EPUser user = mockEPUser();
-
- assertEquals(user.getId(), new Long(1));
- assertEquals(user.getManagerId(), new Long(1234));
- assertEquals(user.getFirstName(), "test");
- assertEquals(user.getLastName(), "test");
- assertEquals(user.getMiddleInitial(), "test");
- assertEquals(user.getPhone(), "test");
- assertEquals(user.getFax(), "test");
- assertEquals(user.getCellular(), "test");
- assertEquals(user.getEmail(), "test");
- assertEquals(user.getAddressId(), new Long(123) );
- assertEquals(user.getAlertMethodCd(), "test");
- assertEquals(user.getHrid(), "test");
- assertEquals(user.getOrgUserId(), "test");
- assertEquals(user.getOrgCode(), "test");
- assertEquals(user.getAddress1(), "test");
- assertEquals(user.getAddress2(), "test");
- assertEquals(user.getState(), "test");
- assertEquals(user.getZipCode(), "test");
- assertEquals(user.getCountry(), "test");
- assertEquals(user.getOrgManagerUserId(), "test");
- assertEquals(user.getLocationClli(), "test");
- assertEquals(user.getBusinessCountryCode(), "test");
- assertEquals(user.getBusinessCountryName(), "test");
- assertEquals(user.getBusinessUnit(), "test");
- assertEquals(user.getBusinessUnitName(), "test");
- assertEquals(user.getDepartment(), "test");
- assertEquals(user.getDepartmentName(), "test");
- assertEquals(user.getCompanyCode(), "test");
- assertEquals(user.getCompany(), "test");
- assertEquals(user.getZipCodeSuffix(), "test");
- assertEquals(user.getJobTitle(), "test");
- assertEquals(user.getCommandChain(), "test");
- assertEquals(user.getSiloStatus(), "test");
- assertEquals(user.getFinancialLocCode(), "test");
- assertEquals(user.getLoginId(), "test");
- assertEquals(user.getLoginPwd(), "test");
- assertEquals(user.getActive(), false);
- assertEquals(user.getInternal(), false);
- assertEquals(user.getSelectedProfileId(), new Long (12345));
- assertEquals(user.getTimeZoneId(), new Long (12345));
- assertEquals(user.getChatId(), "test");
-
- //assertEquals(user.toString(), "EPUser [orgId=null, managerId=1234, firstName=test, middleInitial=test, lastName=test, phone=test, fax=test, cellular=test, email=test, addressId=123, alertMethodCd=test, hrid=test, orgUserId=test, orgCode=test, address1=test, address2=test, city=test, state=test, zipCode=test, country=test, orgManagerUserId=test, locationClli=test, businessCountryCode=test, businessCountryName=test, businessUnit=test, businessUnitName=test, department=test, departmentName=test, companyCode=test, company=test, zipCodeSuffix=test, jobTitle=test, commandChain=test, siloStatus=test, costCenter=test, financialLocCode=test, loginId=test, loginPwd=test, lastLoginDate=Tue Sep 05 11:04:49 EDT 2017, active=false, internal=false, selectedProfileId=12345, timeZoneId=12345, online=false, chatId=test, isGuest=false, userApps=[], pseudoRoles=[]]");
- }
-
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPWidgetsManualSortPreference;
-
-public class EPWidgetsManualSortPreferenceTest {
-
- public EPWidgetsManualSortPreference mockEPWidgetsManualSortPreference(){
- EPWidgetsManualSortPreference epWidgetsManualSortPreference = new EPWidgetsManualSortPreference();
-
- epWidgetsManualSortPreference.setUserId(1);
- epWidgetsManualSortPreference.setWidgetId((long)1);
- epWidgetsManualSortPreference.setWidgetRow(1);
- epWidgetsManualSortPreference.setWidgetCol(1);
- epWidgetsManualSortPreference.setWidgetWidth(1);
- epWidgetsManualSortPreference.setWidgetHeight(1);
-
- return epWidgetsManualSortPreference;
- }
-
- @Test
- public void epWidgetsManualSortPreferenceTest(){
- EPWidgetsManualSortPreference epWidgetsManualSortPreference = mockEPWidgetsManualSortPreference();
-
- assertEquals(epWidgetsManualSortPreference.getWidgetId(), new Long(1));
- assertEquals(epWidgetsManualSortPreference.getUserId(), 1);
- assertEquals(epWidgetsManualSortPreference.getWidgetRow(), 1);
- assertEquals(epWidgetsManualSortPreference.getWidgetCol(), 1);
- assertEquals(epWidgetsManualSortPreference.getWidgetHeight(), 1);
- assertEquals(epWidgetsManualSortPreference.getWidgetWidth(), 1);
-
-
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EcompAppRoleId;
-
-public class EcompAppRoleIdTest {
-
- public EcompAppRoleId mockEcompAppRoleId(){
-
- EcompAppRoleId ecompAppRoleId = new EcompAppRoleId();
-
- ecompAppRoleId.setAppId((long)1);
- ecompAppRoleId.setAppName("test");
- ecompAppRoleId.setRoleId(1);
- ecompAppRoleId.setRoleName("test");
-
- return ecompAppRoleId;
- }
-
- @Test
- public void ecompAppRoleIdTest(){
-
- EcompAppRoleId ecompAppRoleId = mockEcompAppRoleId();
-
- assertEquals(ecompAppRoleId.getAppId(), new Long(1));
- assertEquals(ecompAppRoleId.getAppName(), "test");
- assertEquals(ecompAppRoleId.getRoleId().toString(), "1");
- assertEquals(ecompAppRoleId.getRoleName(), "test");
- }
-
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EcompAppRole;
-
-public class EcompAppRoleTest {
-
- public EcompAppRole mockEcompAppRole(){
- EcompAppRole ecompAppRole = new EcompAppRole();
-
- ecompAppRole.setAppId((long)1);
- ecompAppRole.setAppName("test");
- ecompAppRole.setRoleId(1);
- ecompAppRole.setRoleName("test");
-
- return ecompAppRole;
- }
-
- @Test
- public void ecompAppRoleTest(){
- EcompAppRole ecompAppRole = mockEcompAppRole();
-
- assertEquals(ecompAppRole.getAppId(), new Long(1));
- assertEquals(ecompAppRole.getAppName(), "test");
- assertEquals(ecompAppRole.getRoleId().toString(), "1");
- assertEquals(ecompAppRole.getRoleName(), "test");
-
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPAppRoleFunction;
-import org.openecomp.portalapp.portal.domain.ExternalRoleDetails;
-
-public class ExternalRoleDetailsTest {
-
- public ExternalRoleDetails mockExternalRoleDetails(){
-
- List<EPAppRoleFunction> epAppRoleFunctionList = new ArrayList<EPAppRoleFunction>();
-
- EPAppRoleFunction epAppRoleFunction = new EPAppRoleFunction();
- epAppRoleFunction.setRoleId((long)1);
- epAppRoleFunction.setAppId((long)1);
- epAppRoleFunction.setCode("test");
-
- epAppRoleFunctionList.add(epAppRoleFunction);
-
- ExternalRoleDetails externalRoleDetails = new ExternalRoleDetails();
-
- externalRoleDetails.setName("test");
- externalRoleDetails.setActive(false);
- externalRoleDetails.setPriority(1);
- externalRoleDetails.setAppId((long)1);
- externalRoleDetails.setAppRoleId((long)1);
- externalRoleDetails.setPerms(epAppRoleFunctionList);
-
- return externalRoleDetails;
- }
-
- @Test
- public void externalRoleDetailsTest(){
-
- List<EPAppRoleFunction> epAppRoleFunctionList = new ArrayList<EPAppRoleFunction>();
-
- EPAppRoleFunction epAppRoleFunction = new EPAppRoleFunction();
- epAppRoleFunction.setRoleId((long)1);
- epAppRoleFunction.setAppId((long)1);
- epAppRoleFunction.setCode("test");
-
- epAppRoleFunctionList.add(epAppRoleFunction);
-
- ExternalRoleDetails externalRoleDetails = mockExternalRoleDetails();
-
- assertEquals(externalRoleDetails.getAppId(), new Long(1));
- assertEquals(externalRoleDetails.getAppRoleId(), new Long(1));
- assertEquals(externalRoleDetails.getPriority().toString(), "1");
- assertEquals(externalRoleDetails.getName(), "test");
- assertEquals(externalRoleDetails.getPriority().toString(), "1");
- assertEquals(externalRoleDetails.getPerms().size(), epAppRoleFunctionList.size());
-
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.ExternalSystemAccess;
-
-public class ExternalSystemAccessTest {
-
- public ExternalSystemAccess mockExternalSystemAccess(){
- ExternalSystemAccess externalSystemAccess = new ExternalSystemAccess("test", false);
-
- externalSystemAccess.setKey("test");
- externalSystemAccess.setAccessValue(false);
-
- return externalSystemAccess;
- }
-
- @Test
- public void externalSystemAccessTest(){
- ExternalSystemAccess externalSystemAccess = mockExternalSystemAccess();
-
- assertEquals(externalSystemAccess.getKey(), "test");
- assertEquals(externalSystemAccess.getAccessValue(), false);
- }
-}
-
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.externalsystemapproval.model.ExternalSystemRoleApproval;
-
-public class ExternalSystemRoleApprovalTest {
-
- public ExternalSystemRoleApproval mockExternalSystemRoleApproval(){
- ExternalSystemRoleApproval externalSystemRoleApproval = new ExternalSystemRoleApproval();
- externalSystemRoleApproval.setRoleName("test");
-
- return externalSystemRoleApproval;
- }
-
- @Test
- public void externalSystemRoleApprovalTest(){
- ExternalSystemRoleApproval externalSystemRoleApproval = mockExternalSystemRoleApproval();
-
- assertEquals(externalSystemRoleApproval.getRoleName(), "test");
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.FunctionalMenuItemWithAppID;
-
-public class FunctionalMenuItemWithAppIDTest {
-
- public FunctionalMenuItemWithAppID mockFunctionalMenuItemWithAppID(){
- FunctionalMenuItemWithAppID functionalMenuItemWithAppID = new FunctionalMenuItemWithAppID();
-
- functionalMenuItemWithAppID.setRestrictedApp(false);
- functionalMenuItemWithAppID.setUrl("test");
-
-
- return functionalMenuItemWithAppID;
- }
-
- @Test
- public void functionalMenuItemWithAppIDTest(){
- FunctionalMenuItemWithAppID functionalMenuItemWithAppID = mockFunctionalMenuItemWithAppID();
-
- assertEquals(functionalMenuItemWithAppID.toString(), "FunctionalMenuItem [menuId=null, column=null, text=null, parentMenuId=null, url=test, active_yn=null, appid=null, roles=null, restrictedApp=false]");
-
- }
-
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.GetAccessResultId;
-
-public class GetAccessResultIdTest {
-
- public GetAccessResultId mockGetAccessResultId(){
-
- GetAccessResultId getAccessResultIdObj = new GetAccessResultId();
- getAccessResultIdObj.setEcompFunction("test");
- getAccessResultIdObj.setAppName("test");
- getAccessResultIdObj.setRoleName("test");
-
- return getAccessResultIdObj;
- }
-
- @Test
- public void getAccessResultIdObjTest(){
- GetAccessResultId getAccessResultIdObj = mockGetAccessResultId();
-
- assertEquals(getAccessResultIdObj.getEcompFunction(), "test");
- assertEquals(getAccessResultIdObj.getAppName(), "test");
- assertEquals(getAccessResultIdObj.getRoleName(), "test");
-
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import java.util.ArrayList;
-import java.util.List;
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.MicroserviceData;
-import org.openecomp.portalapp.portal.domain.MicroserviceParameter;
-
-public class MicroserviceDataTest {
-
- public MicroserviceData mockMicroserviceData(){
-
- MicroserviceData microserviceData= new MicroserviceData();
-
- List<MicroserviceParameter> parameterList = new ArrayList<MicroserviceParameter>();
-
- MicroserviceParameter microserviceParameter = new MicroserviceParameter();
- microserviceParameter.setId((long)1);
- microserviceParameter.setServiceId((long)1);
- microserviceParameter.setPara_key("test");
- microserviceParameter.setPara_value("test");
- parameterList.add(microserviceParameter);
-
- microserviceData.setId((long)1);
- microserviceData.setName("test");
- microserviceData.setActive("test");
- microserviceData.setDesc("test");
- microserviceData.setAppId((long)1);
- microserviceData.setUrl("test");
- microserviceData.setSecurityType("test");
- microserviceData.setUsername("test");
- microserviceData.setPassword("test");
-
-
- return microserviceData;
- }
-
- @Test
- public void microserviceDataTest(){
- MicroserviceData microserviceData= mockMicroserviceData();
-
- assertEquals(microserviceData.getId(), new Long(1));
- assertEquals(microserviceData.getName(), "test");
- assertEquals(microserviceData.getActive(), "test");
- assertEquals(microserviceData.getDesc(), "test");
- // assertEquals(microserviceData.getAppId(), new long(1));
- assertEquals(microserviceData.getUrl(), "test");
- assertEquals(microserviceData.getSecurityType(), "test");
- assertEquals(microserviceData.getUsername(), "test");
- assertEquals(microserviceData.getPassword(), "test");
-
- assertEquals(microserviceData.toString(), "MicroserviceData [id=1, name=test, desc=test, appId=1, "
- + "url=test, securityType=test, username=test, password=test, parameterList=null]");
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.MicroserviceParameter;
-
-public class MicroserviceParameterTest {
-
- public MicroserviceParameter mockMicroserviceParameter(){
- MicroserviceParameter microserviceParameter = new MicroserviceParameter();
-
- microserviceParameter.setId((long)1);
- microserviceParameter.setServiceId((long)1);
- microserviceParameter.setPara_key("test");
- microserviceParameter.setPara_value("test");
-
- return microserviceParameter;
- }
-
- @Test
- public void microserviceParameterTest(){
- MicroserviceParameter microserviceParameter = mockMicroserviceParameter();
- assertEquals(microserviceParameter.getId(), new Long(1));
- assertEquals(microserviceParameter.getServiceId(),(long)1);
- assertEquals(microserviceParameter.getPara_key(), "test");
- assertEquals(microserviceParameter.getPara_value(), "test");
-
- assertEquals(microserviceParameter.toString(), "MicroserviceParameter [id=1, serviceId=1, para_key=test, para_value=test]");
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.PersUserAppSelection;
-
-public class PersUserAppSelectionTest {
-
- public PersUserAppSelection mockPersUserAppSelection(){
-
- PersUserAppSelection persUserAppSelection = new PersUserAppSelection();
- persUserAppSelection.setUserId((long)1);
- persUserAppSelection.setAppId((long)1);
- persUserAppSelection.setStatusCode("test");
-
- return persUserAppSelection;
- }
-
- @Test
- public void persUserAppSelectionTest(){
-
- PersUserAppSelection persUserAppSelection1 = new PersUserAppSelection((long)1, (long)1, (long)1,"test");
-
- PersUserAppSelection persUserAppSelection = mockPersUserAppSelection();
-
- assertEquals(persUserAppSelection.getUserId(), new Long(1));
- assertEquals(persUserAppSelection.getAppId(), new Long(1));
- assertEquals(persUserAppSelection.getStatusCode(), "test");
- assertEquals(persUserAppSelection1.hashCode(), new PersUserAppSelection((long)1, (long)1, (long)1,"test").hashCode());
- assertEquals(persUserAppSelection1, new PersUserAppSelection((long)1, (long)1, (long)1,"test"));
- assertTrue(persUserAppSelection1.equals(new PersUserAppSelection((long)1, (long)1, (long)1,"test")));
- }
-
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.PersUserWidgetSelection;
-
-public class PersUserWidgetSelectionTest {
-
- public PersUserWidgetSelection mockPersUserWidgetSelection(){
-
- PersUserWidgetSelection persUserWidgetSelection = new PersUserWidgetSelection();
-
- persUserWidgetSelection.setUserId((long)1);
- persUserWidgetSelection.setWidgetId((long)1);
- persUserWidgetSelection.setStatusCode("test");
-
- return persUserWidgetSelection;
- }
-
- @Test
- public void persUserWidgetSelectionTest(){
- PersUserWidgetSelection persUserWidgetSelection = mockPersUserWidgetSelection();
-
- PersUserWidgetSelection persUserWidgetSelection1 = new PersUserWidgetSelection((long)1, (long)1, (long)1, "test");
-
- assertEquals(persUserWidgetSelection.getUserId(), new Long(1));
- assertEquals(persUserWidgetSelection.getWidgetId(), new Long(1));
- assertEquals(persUserWidgetSelection.getStatusCode(), "test");
- assertEquals(persUserWidgetSelection1, new PersUserWidgetSelection((long)1, (long)1, (long)1, "test"));
- assertTrue(persUserWidgetSelection1.equals(new PersUserWidgetSelection((long)1, (long)1, (long)1,"test")));
- assertEquals(persUserWidgetSelection.hashCode(), persUserWidgetSelection1.hashCode());
- }
-
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.model.Result;
-
-public class ResultTest {
-
- public Result mockResult(){
-
- Result result= new Result("test");
-
- result.setResult("test");
- return result;
- }
-
- @Test
- public void resultTest(){
-
- Result result = mockResult();
- result.setResult("test");
-
- assertEquals(result.getResult(), "test");
-
- }
-
-
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.Date;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.SharedContext;
-
-public class SharedContextTest {
-
- public SharedContext mockSharedContext(){
-
- SharedContext sharedContext = new SharedContext();
- sharedContext.setId((long)1);
- sharedContext.setCreate_time(new Date());
- sharedContext.setContext_id("test");
- sharedContext.setCkey("test");
- sharedContext.setCvalue("test");
-
- return sharedContext;
- }
-
- @Test
- public void sharedContextTest(){
- SharedContext sharedContext = mockSharedContext();
-
- assertEquals(sharedContext.getId(), new Long(1));
- // assertEquals(sharedContext.getCreate_time(), new Date());
- assertEquals(sharedContext.getContext_id(), "test");
- assertEquals(sharedContext.getCkey(), "test");
- assertEquals(sharedContext.getCvalue(), "test");
-
-
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.UserIdRoleId;
-
-public class UserIdRoleIdTest {
-
- public UserIdRoleId mockUserIdRoleId(){
- UserIdRoleId userIdRoleId = new UserIdRoleId();
- userIdRoleId.setUser_Id("test");
- userIdRoleId.setRoleId("test");
- userIdRoleId.setOrgUserId("test");
- userIdRoleId.setAppId("test");
-
- return userIdRoleId;
- }
-
- @Test
- public void userIdRoleIdTest(){
- UserIdRoleId userIdRoleId = mockUserIdRoleId();
-
- assertEquals(userIdRoleId.getUser_Id(), "test");
- assertEquals(userIdRoleId.getRoleId(), "test");
- assertEquals(userIdRoleId.getOrgUserId(), "test");
- assertEquals(userIdRoleId.getAppId(), "test");
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.WidgetCatalogParameter;
-
-public class WidgetCatalogParameterTest {
-
- public WidgetCatalogParameter mockWidgetCatalogParameter(){
- WidgetCatalogParameter widgetCatalogParameter = new WidgetCatalogParameter();
-
- widgetCatalogParameter.setId((long)1);
- widgetCatalogParameter.setWidgetId((long)1);
- widgetCatalogParameter.setUserId((long)1);
- widgetCatalogParameter.setParamId((long)1);
- widgetCatalogParameter.setUser_value("test");
-
- return widgetCatalogParameter;
- }
-
- @Test
- public void widgetCatalogParameterTest(){
- WidgetCatalogParameter widgetCatalogParameter = mockWidgetCatalogParameter();
-
- assertEquals(widgetCatalogParameter.getId(), new Long(1));
- assertEquals(widgetCatalogParameter.getWidgetId(), new Long(1));
- assertEquals(widgetCatalogParameter.getUserId(), new Long(1));
- assertEquals(widgetCatalogParameter.getParamId(), new Long(1));
- assertEquals(widgetCatalogParameter.getUser_value(), "test");
- assertEquals(widgetCatalogParameter.toString(), "WidgetCatalogParameter [id=1, widgetId=1, userId=1, paramId=1, user_value=test]");
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.*;
-import static org.junit.Assert.assertEquals;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.App;
-import org.openecomp.portalapp.portal.domain.RoleApp;
-import org.openecomp.portalapp.portal.domain.WidgetCatalog;
-
-public class WidgetCatalogTest {
-
- public WidgetCatalog mockWidgetCatalog() {
-
- WidgetCatalog widgetCatalog = new WidgetCatalog();
-
- Set<RoleApp> roleAppSet = new HashSet<RoleApp>();
- // App
- App app = new App();
- app.setAppId((long) 1);
- app.setAppName("test");
-
- // RoleApp
- RoleApp roleApp = new RoleApp();
- roleApp.setRoleId((long) 1);
- roleApp.setRoleName("test");
- roleApp.setApp(app);
- roleApp.setWidgets(null);
-
- roleAppSet.add(roleApp);
-
- widgetCatalog.setId((long) 1);
- widgetCatalog.setName("test");
- widgetCatalog.setDesc("test");
- widgetCatalog.setFileLocation("test");
- widgetCatalog.setAllowAllUser("test");
- widgetCatalog.setServiceId((long) 1);
- widgetCatalog.setSortOrder("test");
- widgetCatalog.setStatusCode("test");
-
- widgetCatalog.setWidgetRoles(roleAppSet);
-
- return widgetCatalog;
-
- }
-
- @Test
- public void widgetCatalogTest() {
-
- // App
- App app = new App();
- app.setAppId((long) 1);
- app.setAppName("test");
-
- Set<RoleApp> roleAppSet = new HashSet<RoleApp>();
- // RoleApp
- RoleApp roleApp = new RoleApp();
- roleApp.setRoleId((long) 1);
- roleApp.setRoleName("test");
- roleApp.setApp(app);
- roleApp.setWidgets(null);
-
- roleAppSet.add(roleApp);
-
- WidgetCatalog widgetCatalog = mockWidgetCatalog();
-
-
- assertEquals(widgetCatalog.getId(), (long)1);
- assertEquals(widgetCatalog.getName(), "test");
- assertEquals(widgetCatalog.getDesc(), "test");
- assertEquals(widgetCatalog.getFileLocation(), "test");
- assertEquals(widgetCatalog.getAllowAllUser(), "test");
- assertEquals(widgetCatalog.getServiceId(), new Long (1));
- assertEquals(widgetCatalog.getSortOrder(), "test");
- assertEquals(widgetCatalog.getStatusCode(), "test");
- assertEquals(widgetCatalog.getWidgetRoles().size(),1);
-
- assertEquals("WidgetCatalog [id=1, name=test, desc=test, fileLocation=test, allowAllUser=test]", widgetCatalog.toString());
- }
-
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.WidgetParameterResult;
-
-public class WidgetParameterResultTest {
-
- public WidgetParameterResult mockWidgetParameterResult(){
-
- WidgetParameterResult widgetParameterResult = new WidgetParameterResult();
- widgetParameterResult.setParam_id((long)1);
- widgetParameterResult.setParam_key("test");
- widgetParameterResult.setUser_value("test");
- widgetParameterResult.setDefault_value("test");
-
- return widgetParameterResult;
- }
-
- @Test
- public void widgetParameterResultTest(){
-
- WidgetParameterResult widgetParameterResult = mockWidgetParameterResult();
-
- assertEquals(widgetParameterResult.getParam_key(), "test");
- assertEquals(widgetParameterResult.getParam_id(), new Long(1));
- assertEquals(widgetParameterResult.getUser_value(), "test");
- assertEquals(widgetParameterResult.getDefault_value(), "test");
-
- assertEquals("WidgetParameterResult [param_id=1, param_key=test, user_value=test, default_value=test]", widgetParameterResult.toString());
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.domain;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.Widget;
-
-public class WidgetTest {
-
- public Widget mockWidget(){
-
- Widget widget = new Widget();
- widget.setName("test");
- widget.setWidth(100);
- widget.setHeight(100);
- widget.setUrl("test");
- widget.setAppId((long)1);
-
- return widget;
- }
-
- @Test
- public void widgetTest(){
- Widget widget = mockWidget();
-
- assertEquals(widget.getName(), "test");
- assertTrue(widget.getWidth() == 100);
- assertTrue(widget.getHeight() == 100);
- assertEquals(widget.getUrl(), "test");
- assertEquals(widget.getAppId(), new Long(1));
-
-
- }
-}
+++ /dev/null
-/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ================================================================================
- */
-package org.openecomp.portalapp.portal.test.framework;
-
-import java.io.IOException;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.openecomp.portalsdk.core.conf.AppConfig;
-//import org.openecomp.portalapp.conf.ExternalAppConfig;
-//import org.openecomp.portalapp.conf.HibernateMappingLocations;
-import org.openecomp.portalsdk.core.conf.HibernateConfiguration;
-import org.openecomp.portalsdk.core.conf.HibernateMappingLocatable;
-import org.openecomp.portalsdk.core.objectcache.AbstractCacheManager;
-import org.openecomp.portalsdk.core.util.CacheManager;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.FilterType;
-import org.springframework.context.annotation.Profile;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-import org.springframework.test.context.ActiveProfiles;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.test.context.transaction.TransactionConfiguration;
-import org.springframework.test.context.web.AnnotationConfigWebContextLoader;
-import org.springframework.test.context.web.WebAppConfiguration;
-import org.springframework.test.web.servlet.MockMvc;
-import org.springframework.test.web.servlet.setup.MockMvcBuilders;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.context.WebApplicationContext;
-import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
-
-/**
- *
- * In order to write a unit test, 1. inherit this class 2. place the "war"
- * folder on your test class's classpath 3. run the test with the following VM
- * argument; This is important because when starting the application from
- * Container, the System Properties file (SystemProperties.java) can have the
- * direct path but, when running from the Mock Junit container, the path should
- * be prefixed with "classpath" to enable the mock container to search for the
- * file in the classpath -Dcontainer.classpath="classpath:"
- */
-
-@SuppressWarnings("deprecation")
-@RunWith(SpringJUnit4ClassRunner.class)
-@WebAppConfiguration
-@ContextConfiguration(loader = AnnotationConfigWebContextLoader.class, classes = { MockAppConfig.class })
-@ActiveProfiles(value = "test")
-public class ApplicationCommonContextTestSuite {
-
- @Autowired
- public WebApplicationContext wac;
-
- private MockMvc mockMvc;
-
- @Before
- public void setup() {
- if (mockMvc == null) {
- this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
-
- }
- }
-
- public Object getBean(String name) {
- return this.wac.getBean(name);
- }
-
- public MockMvc getMockMvc() {
- return mockMvc;
- }
-
- public void setMockMvc(MockMvc mockMvc) {
- this.mockMvc = mockMvc;
- }
-
- public WebApplicationContext getWebApplicationContext() {
- return wac;
- }
-
-}
-
-@Configuration
-@ComponentScan(basePackages = "org.openecomp", excludeFilters = {
- // the following source configurations should not be scanned; instead of
- // using Exclusion filter, we can use the @Profile annotation to exclude
- // them
- @ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.openecomp.portalsdk.core.controller.LogoutController*"),
- @ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.openecomp.portalsdk.core.controller.SDKLoginController*"),
- @ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.openecomp.portalapp.conf.ExternalAppConfig*"),
- @ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.openecomp.*.*InitUebHandler*") })
-@Profile("test")
-class MockAppConfig extends AppConfig {
-
- @Bean
- HibernateMappingLocatable locatable() {
- return new MockHibernateMappingLocations();
- }
-
- @Bean
- HibernateConfiguration hibConfiguration() {
- return new HibernateConfiguration();
- }
-
- @Bean
- public SystemProperties systemProperties() {
- return new MockSystemProperties();
- }
-
- @Bean
- public AbstractCacheManager cacheManager() {
- return new CacheManager() {
-
- public void configure() throws IOException {
-
- }
- };
- }
-
- public String[] tileDefinitions() {
- return new String[] { "classpath:/WEB-INF/fusion/defs/definitions.xml",
- "classpath:/WEB-INF/defs/definitions.xml" };
- }
-
- public void addInterceptors(InterceptorRegistry registry) {
- // registry.addInterceptor(new
- // SessionTimeoutInterceptor()).excludePathPatterns(getExcludeUrlPathsForSessionTimeout());
- // registry.addInterceptor(resourceInterceptor());
- }
-
- public static class MockSystemProperties extends SystemProperties {
-
- public MockSystemProperties() {
- }
-
- }
-
-}
-
-@Profile("test")
-class MockHibernateMappingLocations implements HibernateMappingLocatable {
-
- public Resource[] getMappingLocations() {
- return new Resource[] { new ClassPathResource("WEB-INF/fusion/orm/Fusion.hbm.xml"),
- new ClassPathResource("WEB-INF/fusion/orm/EP.hbm.xml"),
- new ClassPathResource("WEB-INF/fusion/orm/Workflow.hbm.xml") };
-
- }
-
- public String[] getPackagesToScan() {
- return new String[] { "org.openecomp", "src" };
- }
-
-}
+++ /dev/null
-/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ================================================================================
- */
-package org.openecomp.portalapp.portal.test.framework;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletRequestWrapper;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import org.junit.runner.RunWith;
-import org.mockito.Mockito;
-import org.mockito.runners.MockitoJUnitRunner;
-
-@RunWith(MockitoJUnitRunner.class)
-public class MockitoTestSuite {
-
-
- public MockHttpServletRequestWrapper mockedRequest = new MockHttpServletRequestWrapper(
- Mockito.mock(HttpServletRequest.class));
- public HttpServletResponse mockedResponse = Mockito.mock(HttpServletResponse.class);
-
- public MockHttpServletRequestWrapper getMockedRequest() {
- return mockedRequest;
- }
-
- public HttpServletResponse getMockedResponse() {
- return mockedResponse;
- }
-
- public class MockHttpServletRequestWrapper extends HttpServletRequestWrapper {
-
- HttpSession session = Mockito.mock(HttpSession.class);
-
- public MockHttpServletRequestWrapper(HttpServletRequest request) {
- super(request);
-
- }
-
- @Override
- public HttpSession getSession() {
-
- return session;
- }
-
- @Override
- public HttpSession getSession(boolean create) {
-
- return session;
- }
-
- }
-
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.service;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.domain.AppContactUs;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.ecomp.model.AppCategoryFunctionsItem;
-import org.openecomp.portalapp.portal.ecomp.model.AppContactUsItem;
-import org.openecomp.portalapp.portal.service.AppContactUsService;
-import org.openecomp.portalapp.portal.service.AppContactUsServiceImpl;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.service.DataAccessServiceImpl;
-
-public class AppContactUsServiceImplTest {
-
-
- @Mock
- DataAccessService dataAccessService = new DataAccessServiceImpl();
-
- @Mock
- AppContactUsService AppContactUsService = new AppContactUsServiceImpl();
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- @InjectMocks
- AppContactUsServiceImpl appContactUsServiceImpl = new AppContactUsServiceImpl();
-
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
- NullPointerException nullPointerException = new NullPointerException();
-
-
- public EPApp getApp() {
- EPApp app = new EPApp();
- app.setName("Test");
- app.setImageUrl("test");
- app.setDescription("test");
- app.setNotes("test");
- app.setUrl("test");
- app.setId((long) 1);
- app.setAppRestEndpoint("test");
- app.setAlternateUrl("test");
- app.setName("test");
- app.setMlAppName("test");
- app.setMlAppAdminId("test");
- app.setUsername("test");
- app.setAppPassword("test");
- app.setOpen(true);
- app.setEnabled(false);
- app.setUebKey("test");
- app.setUebSecret("test");
- app.setUebTopicName("test");
- app.setAppType(1);
- return app;
- }
- @Test
- public void getAppContactUsTest() throws Exception
- {
-
- List<AppContactUsItem> contactUsItemList = new ArrayList<>();
- AppContactUsItem appContactUsItem= new AppContactUsItem();
- appContactUsItem.setAppName("testNew");
- contactUsItemList.add(appContactUsItem);
- AppContactUsItem appContactUsItem1= new AppContactUsItem();
- appContactUsItem1.setAppName("test");
- contactUsItemList.add(appContactUsItem1);
- Mockito.when(dataAccessService.executeNamedQuery("getAppContactUsItems", null, null)).thenReturn(contactUsItemList);
- List<AppContactUsItem> expectedcontactUsItemList = appContactUsServiceImpl.getAppContactUs();
- assertEquals(expectedcontactUsItemList, contactUsItemList);
- }
-
- @Test
- public void getAppsAndContactsTest() throws Exception
- {
- List<AppContactUsItem> contactUsItemList = new ArrayList<>();
- AppContactUsItem appContactUsItem= new AppContactUsItem();
- appContactUsItem.setAppName("testNew");
- contactUsItemList.add(appContactUsItem);
- AppContactUsItem appContactUsItem1= new AppContactUsItem();
- appContactUsItem1.setAppName("test");
- contactUsItemList.add(appContactUsItem1);
- Mockito.when(dataAccessService.executeNamedQuery("getAppsAndContacts", null, null)).thenReturn(contactUsItemList);
- List<AppContactUsItem> expectedcontactUsItemList = appContactUsServiceImpl.getAppsAndContacts();
- assertEquals(expectedcontactUsItemList, contactUsItemList);
- }
-
- @Test
- public void getAppCategoryFunctionsTest() throws Exception
- {
- List<AppCategoryFunctionsItem> list = new ArrayList<>();
- Mockito.when(dataAccessService.executeNamedQuery("getAppCategoryFunctions", null, null)).thenReturn(list);
- List<AppCategoryFunctionsItem> expectedlist = appContactUsServiceImpl.getAppCategoryFunctions();
- assertEquals(list, expectedlist);
- }
-
- @Test(expected = java.lang.Exception.class)
- public void saveAppContactUsTest() throws Exception
- {
- HashMap<String, Object> map = new HashMap<String, Object>();
- List<AppContactUsItem> contactUsModelList = new ArrayList<>();
- AppContactUsItem appContactUsItem= new AppContactUsItem();
- appContactUsItem.setAppId((long) 1);
- contactUsModelList.add(appContactUsItem);
- AppContactUs appContact = new AppContactUs();
- Mockito.when(dataAccessService.getDomainObject(AppContactUs.class, 1, map)).thenReturn(appContact);
- EPApp app = getApp();
- Mockito.when(dataAccessService.getDomainObject(EPApp.class, 1, new HashMap<String, Object>())).thenReturn(app);
- AppContactUs contactUs = new AppContactUs();
- contactUs.setApp(app);
- contactUs.setDescription(appContactUsItem.getDescription());
- contactUs.setContactName(appContactUsItem.getContactName());
- contactUs.setContactEmail(appContactUsItem.getContactEmail());
- contactUs.setActiveYN(appContactUsItem.getActiveYN());
- contactUs.setUrl(appContactUsItem.getUrl());
- Mockito.doNothing().when(dataAccessService).saveDomainObject(contactUs,map);
- appContactUsServiceImpl.saveAppContactUs(contactUsModelList);
- }
-
- @Test(expected = java.lang.NullPointerException.class)
- public void deleteContactUsTest() throws Exception
- {
- HashMap<String, Object> map = new HashMap<String, Object>();
- AppContactUs contactUs = new AppContactUs();
- Mockito.when((AppContactUs) dataAccessService.getDomainObject(AppContactUs.class, 1, map)).thenReturn(contactUs);
- appContactUsServiceImpl.deleteContactUs((long) 1);
- }
-
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.service;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.ecomp.model.SearchResultItem;
-import org.openecomp.portalapp.portal.service.DashboardSearchServiceImpl;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
-import org.openecomp.portalapp.portal.transport.CommonWidget;
-import org.openecomp.portalapp.portal.transport.CommonWidgetMeta;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-
-public class DashboardSearchServiceImplTest {
-
- @Mock
- DataAccessService dataAccessService;
-
- @InjectMocks
- DashboardSearchServiceImpl dashboardSearchServiceImpl = new DashboardSearchServiceImpl();
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- NullPointerException nullPointerException = new NullPointerException();
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
- MockEPUser mockUser = new MockEPUser();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-
- @Test
- public void searchResultsTest()
- {
- Map<String, String> params = new HashMap<>();
- params.put("userId", "guestT");
- params.put("searchQuery", "test");
-
- List<SearchResultItem> list = new ArrayList<>();
- SearchResultItem searchResultItem= new SearchResultItem();
- searchResultItem.setCategory("test");
- list.add(searchResultItem);
- Mockito.when(dataAccessService.executeNamedQuery("searchPortal", params, null)).thenReturn(list);
- Map<String, List<SearchResultItem>> result = dashboardSearchServiceImpl.searchResults("guestT", "test");
- assertTrue(result.keySet().contains("test"));
- }
-
- @Test
- public void getRelatedUsersTest()
- {
- List<String> activeUsers = new ArrayList<>();
- Map<String, String> params = new HashMap<>();
- params.put("userId", "guestT");
- Mockito.when(dataAccessService.executeNamedQuery("relatedUsers", params, null)).thenReturn(activeUsers);
- List<String> expectedActiveUsers = dashboardSearchServiceImpl.getRelatedUsers("guestT");
- assertEquals(expectedActiveUsers,activeUsers);
- }
- @Test
- public void getWidgetDataTest()
- {
- CommonWidgetMeta CommonWidgetMeta = null;
- Map<String, String> params = new HashMap<>();
- params.put("cat", "test");
- @SuppressWarnings("unchecked")
- List<CommonWidget> widgetItems = new ArrayList<>();
- CommonWidget commonWidget = new CommonWidget();
- widgetItems.add(commonWidget);
- Mockito.when(dataAccessService.executeNamedQuery("getCommonWidgetItem", params, null)).thenReturn(widgetItems);
- CommonWidgetMeta expectedCommonWidgetMeta =dashboardSearchServiceImpl.getWidgetData("test");
- assertEquals(expectedCommonWidgetMeta.getCategory(), "test");
- }
-
- @Test
- public void saveWidgetDataBulkTest()
- {
- CommonWidgetMeta CommonWidgetMeta = new CommonWidgetMeta();
- List<CommonWidget> widgetList = new ArrayList<>();
- CommonWidget commonWidget = new CommonWidget();
- widgetList.add(commonWidget);
- CommonWidgetMeta.setItems(widgetList);
- Mockito.doNothing().when(dataAccessService).saveDomainObject(commonWidget, null);
- assertEquals(dashboardSearchServiceImpl.saveWidgetDataBulk(CommonWidgetMeta), "success");
- }
-
- @Test
- public void saveWidgetDataTest()
- {
- CommonWidget commonWidget = new CommonWidget();
- Mockito.doNothing().when(dataAccessService).saveDomainObject(commonWidget, null);
- assertEquals(dashboardSearchServiceImpl.saveWidgetData(commonWidget), "success");
- }
-
- @Test
- public void deleteWidgetDataTest()
- {
- CommonWidget commonWidget = new CommonWidget();
- Mockito.doNothing().when(dataAccessService).deleteDomainObject(commonWidget, null);
- assertEquals(dashboardSearchServiceImpl.deleteWidgetData(commonWidget), "success");
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.service;
-
-import static org.junit.Assert.*;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-
-import org.hibernate.SessionFactory;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.domain.CentralRoleFunction;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.service.EPRoleFunctionServiceCentralizedImpl;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.openecomp.portalsdk.core.domain.RoleFunction;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest(SystemProperties.class)
-public class EPRoleFunctionServiceCentralizedImplTest {
-
-
- @Mock
- DataAccessService dataAccessService;
-
- @Mock
- SessionFactory sessionFactory;
-
- @InjectMocks
- EPRoleFunctionServiceCentralizedImpl ePRoleFunctionServiceCentralizedImpl = new EPRoleFunctionServiceCentralizedImpl();
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- NullPointerException nullPointerException = new NullPointerException();
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
- MockEPUser mockUser = new MockEPUser();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-
- @Test
- public void getRoleFunctions()
- {
- List<CentralRoleFunction> getRoleFuncList = new ArrayList<>();
- CentralRoleFunction centralRoleFunction = new CentralRoleFunction();
- getRoleFuncList.add(centralRoleFunction);
- List<RoleFunction> getRoleFuncListOfPortal = new ArrayList<>();
- RoleFunction roleFunction = new RoleFunction();
- getRoleFuncListOfPortal.add(roleFunction);
- final Map<String, Long> params = new HashMap<>();
- params.put("appId", (long) 1);
- Mockito.when(dataAccessService.executeNamedQuery("getAllRoleFunctions", params, null)).thenReturn(getRoleFuncList);
- List<RoleFunction> expectedGetRoleFuncListOfPortal = ePRoleFunctionServiceCentralizedImpl.getRoleFunctions();
- assertEquals(expectedGetRoleFuncListOfPortal.size(),getRoleFuncListOfPortal.size());
- }
-
- @Test
- public void getRoleFunctionsNewTest()
- {
- HttpSession session = mockedRequest.getSession();
- EPUser user = mockUser.mockEPUser();
- user.setId((long) 1);
- String userId = user.getId().toString();
- final Map<String, String> params = new HashMap<>();
- params.put("userId", userId);
- @SuppressWarnings("unused")
- List getRoleFuncListOfPortal = new ArrayList<>();
- Mockito.when(dataAccessService.executeNamedQuery("getRoleFunctionsOfUser", params, null)).thenReturn(getRoleFuncListOfPortal);
- Set<String> getRoleFuncListOfPortalSet = ePRoleFunctionServiceCentralizedImpl.getRoleFunctions(mockedRequest, user);
- assertTrue(getRoleFuncListOfPortalSet.size() == 0);
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.service;
-
-import static org.junit.Assert.*;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.domain.EPRole;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.service.EPRoleFunctionServiceImpl;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.domain.RoleFunction;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({ SystemProperties.class, EPUserUtils.class })
-public class EPRoleFunctionServiceImplTest {
-
- @Mock
- DataAccessService dataAccessService;
-
- @InjectMocks
- EPRoleFunctionServiceImpl ePRoleFunctionServiceImpl = new EPRoleFunctionServiceImpl();
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- NullPointerException nullPointerException = new NullPointerException();
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
- MockEPUser mockUser = new MockEPUser();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-
- @Test
- public void getRoleFunctionsTest() {
- List<RoleFunction> functions = new ArrayList<>();
- Mockito.when(dataAccessService.getList(RoleFunction.class, null)).thenReturn(functions);
- List<RoleFunction> expectedFunctions = ePRoleFunctionServiceImpl.getRoleFunctions();
- assertEquals(expectedFunctions, functions);
- }
-
- @Test
- public void getRoleFunctionsRequestTest() {
- EPUser user = mockUser.mockEPUser();
- HashSet roleFunctions = new HashSet<>();
- PowerMockito.mockStatic(SystemProperties.class);
- HttpSession session = mockedRequest.getSession();
- Mockito.when(session.getAttribute(SystemProperties.getProperty(SystemProperties.ROLE_FUNCTIONS_ATTRIBUTE_NAME)))
- .thenReturn(roleFunctions);
- HashSet expectedRoleFunctions = (HashSet) ePRoleFunctionServiceImpl.getRoleFunctions(mockedRequest, user);
- assertEquals(expectedRoleFunctions, roleFunctions);
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void getRoleFunctionsRequestIfNullTest() {
- EPUser user = mockUser.mockEPUser();
- HashSet roleFunctions = null;
- PowerMockito.mockStatic(SystemProperties.class);
- PowerMockito.mockStatic(EPUserUtils.class);
- HttpSession session = mockedRequest.getSession();
- Mockito.when(session.getAttribute(SystemProperties.getProperty(SystemProperties.ROLE_FUNCTIONS_ATTRIBUTE_NAME)))
- .thenReturn(roleFunctions);
- HashMap roles = new HashMap<>();
- EPRole role = new EPRole();
- SortedSet<RoleFunction> roleFunctionSet = new TreeSet<RoleFunction>();
- RoleFunction rolefun = new RoleFunction();
- roleFunctionSet.add(rolefun);
- role.setRoleFunctions(roleFunctionSet);
- roles.put((long) 1, role);
- Mockito.when(EPUserUtils.getRoles(mockedRequest)).thenReturn(roles);
- HashSet expectedRoleFunctions = (HashSet) ePRoleFunctionServiceImpl.getRoleFunctions(mockedRequest, user);
- assertTrue(expectedRoleFunctions.size() == 1);
-
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.service;
-
-import static org.junit.Assert.*;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.domain.EPRole;
-import org.openecomp.portalapp.portal.service.EPRoleServiceImpl;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.openecomp.portalsdk.core.domain.RoleFunction;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-
-public class EPRoleServiceImplTest {
-
- @Mock
- DataAccessService dataAccessService;
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- @InjectMocks
- EPRoleServiceImpl ePRoleServiceImpl = new EPRoleServiceImpl();
-
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
- NullPointerException nullPointerException = new NullPointerException();
- MockEPUser mockUser = new MockEPUser();
-
- @Test
- public void getRoleFunctionsTest() {
- List<RoleFunction> roleFunctionList = new ArrayList<>();
- Mockito.when(dataAccessService.getList(RoleFunction.class, null)).thenReturn(roleFunctionList);
- List<RoleFunction> expectedRoleFunctionList = ePRoleServiceImpl.getRoleFunctions();
- assertEquals(roleFunctionList, expectedRoleFunctionList);
- }
-
- @Test
- public void getAvailableChildRolesIfRoleIdIsNullTest() {
- List<EPRole> roleList = new ArrayList<>();
- EPRole role = new EPRole();
- EPRole role1 = new EPRole();
- role.addChildRole(role1);
- roleList.add(role);
- Mockito.when(dataAccessService.getList(EPRole.class, null)).thenReturn(roleList);
- List<EPRole> expectedRoleList = ePRoleServiceImpl.getAvailableChildRoles(null);
- assertEquals(roleList, expectedRoleList);
- }
-
- // @Test
- // public void getAvailableChildRolesIfRoleIdNotNullTest()
- // {
- // List<EPRole> roleList = new ArrayList<>();
- // EPRole role = new EPRole();
- // EPRole role1= new EPRole();
- // role.addChildRole(role1);
- // roleList.add(role);
- // Mockito.when(dataAccessService.getDomainObject(EPRole.class, 1,
- // null)).thenReturn(role);
- // Mockito.when(dataAccessService.getList(EPRole.class,
- // null)).thenReturn(roleList);
- //
- // List<EPRole> expectedRoleList =
- // ePRoleServiceImpl.getAvailableChildRoles((long) 1);
- // System.out.println(expectedRoleList);
- // assertEquals(roleList,expectedRoleList);
- // }
- //
- @Test
- public void getRoleFunctionTest() {
- RoleFunction roleFunction = new RoleFunction();
- Mockito.when(dataAccessService.getDomainObject(RoleFunction.class, "test", null)).thenReturn(roleFunction);
- RoleFunction expectedRoleFunction = ePRoleServiceImpl.getRoleFunction("test");
- assertEquals(expectedRoleFunction, roleFunction);
- }
-
- @Test
- public void saveRoleFunctionTest() {
- EPRole role = new EPRole();
- Mockito.doNothing().when(dataAccessService).saveDomainObject(role, null);
- ePRoleServiceImpl.saveRole(role);
- }
-
- @Test
- public void deleteRoleFunctionTest() {
- RoleFunction roleFunction = new RoleFunction();
- Mockito.doNothing().when(dataAccessService).deleteDomainObject(roleFunction, null);
- ePRoleServiceImpl.deleteRoleFunction(roleFunction);
- }
-
- @Test
- public void getRoleTest() {
- EPRole role = null;
- Mockito.when(dataAccessService.getDomainObject(EPRole.class, 1, null)).thenReturn(role);
- EPRole expectedRole = ePRoleServiceImpl.getRole((long) 1);
- assertEquals(expectedRole, role);
- }
-
- @Test
- public void getRoleIfappIdNullTest() {
- assertNull(ePRoleServiceImpl.getRole(null, null));
-
- }
-
- @Test
- public void getRoleIfappIdNotNullTest() {
- List<EPRole> roles = new ArrayList<>();
- EPRole role = new EPRole();
- roles.add(role);
- String sql = "SELECT * FROM fn_role where APP_ID = 1 AND APP_ROLE_ID = 1";
- Mockito.when(dataAccessService.executeSQLQuery(sql, EPRole.class, null)).thenReturn(roles);
- EPRole expectedRole = ePRoleServiceImpl.getRole((long) 1, (long) 1);
- assertEquals(expectedRole, role);
-
- }
-
- @Test
- public void getRoleIfListSizeIsMoreThan1Test() {
- List<EPRole> roles = new ArrayList<>();
- EPRole role = new EPRole();
- EPRole role1 = new EPRole();
- roles.add(role);
- roles.add(role1);
- String sql = "SELECT * FROM fn_role where APP_ID = 1 AND APP_ROLE_ID = 1";
- Mockito.when(dataAccessService.executeSQLQuery(sql, EPRole.class, null)).thenReturn(roles);
- EPRole expectedRole = ePRoleServiceImpl.getRole((long) 1, (long) 1);
- assertEquals(expectedRole, role);
-
- }
-
- @Test
- public void getRoleIfListSizeIsEmptyTest() {
- List<EPRole> roles = new ArrayList<>();
- String sql = "SELECT * FROM fn_role where APP_ID = 1 AND APP_ROLE_ID = 1";
- Mockito.when(dataAccessService.executeSQLQuery(sql, EPRole.class, null)).thenReturn(roles);
- assertNull(ePRoleServiceImpl.getRole((long) 1, (long) 1));
-
- }
-
- @Test
- public void saveRoleTest() {
- EPRole role = new EPRole();
- Mockito.doNothing().when(dataAccessService).saveDomainObject(role, null);
- ePRoleServiceImpl.saveRole(role);
- }
-
- @Test
- public void deleteRoleTest() {
- EPRole role = new EPRole();
- Mockito.doNothing().when(dataAccessService).deleteDomainObject(role, null);
- ePRoleServiceImpl.deleteRole(role);
- }
-
- @Test
- public void getAvailableRolesTest() {
- List<EPRole> roleList = new ArrayList<>();
- Mockito.when(dataAccessService.getList(EPRole.class, null)).thenReturn(roleList);
- List<EPRole> expectedRoleList = ePRoleServiceImpl.getAvailableRoles();
- assertEquals(expectedRoleList, roleList);
- }
-
- @Test
- public void getAppRolesTest() {
- final Map<String, String> portalParams = null;
- List<EPRole> roleList = new ArrayList<>();
- Mockito.when(dataAccessService.executeNamedQuery("getPortalAppRoles", portalParams, null)).thenReturn(roleList);
- assertNull(ePRoleServiceImpl.getAppRole("test", (long) 1));
-
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void getAppRolesIfNotPortalTest() {
- final Map<String, String> params = null;
- List<EPRole> roleList = new ArrayList<>();
- EPRole role = new EPRole();
- EPRole role1 = new EPRole();
- roleList.add(role);
- roleList.add(role1);
- Mockito.when((List<EPRole>) dataAccessService.executeNamedQuery("getAppRoles", params, null))
- .thenReturn(roleList);
- List<EPRole> expectedRoleList = (List<EPRole>) ePRoleServiceImpl.getAppRole("test", (long) 10);
- System.out.println(expectedRoleList);
-
- }
-
- @Test
- public void saveRoleFunction() {
- RoleFunction domainRoleFunction = new RoleFunction();
- Mockito.doNothing().when(dataAccessService).saveDomainObject(domainRoleFunction, null);
- ePRoleServiceImpl.saveRoleFunction(domainRoleFunction);
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.service;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Matchers;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.domain.CentralRoleFunction;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPAppRoleFunction;
-import org.openecomp.portalapp.portal.domain.EPRole;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.service.ExternalAccessRolesServiceImpl;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
-import org.openecomp.portalapp.portal.transport.ExternalAccessPerms;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.openecomp.portalsdk.core.domain.Role;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.service.DataAccessServiceImpl;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.client.HttpClientErrorException;
-import org.springframework.web.client.RestTemplate;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({ EcompPortalUtils.class, SystemProperties.class, EPCommonSystemProperties.class })
-public class ExternalAccessRolesServiceImplTest {
- @Mock
- DataAccessService dataAccessService1 = new DataAccessServiceImpl();
-
- @Mock
- RestTemplate template = new RestTemplate();
-
- @InjectMocks
- ExternalAccessRolesServiceImpl externalAccessRolesServiceImpl = new ExternalAccessRolesServiceImpl();
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
- NullPointerException nullPointerException = new NullPointerException();
- MockEPUser mockUser = new MockEPUser();
-
- public EPApp mockApp() {
- EPApp app = new EPApp();
- app.setName("Test");
- app.setImageUrl("test");
- app.setDescription("test");
- app.setNotes("test");
- app.setUrl("test");
- app.setId((long) 10);
- app.setAppRestEndpoint("test");
- app.setAlternateUrl("test");
- app.setName("test");
- app.setMlAppName("test");
- app.setMlAppAdminId("test");
- app.setUsername("test");
- app.setAppPassword("test");
- app.setOpen(false);
- app.setEnabled(false);
- app.setUebKey("test");
- app.setUebSecret("test");
- app.setUebTopicName("test");
- app.setAppType(1);
- return app;
- }
-
- @Test
- public void getAppRolesIfAppIsPortalTest() throws Exception {
- List<EPRole> applicationRoles = new ArrayList<>();
- Mockito.when(dataAccessService1.getList(EPRole.class, "test", null, null)).thenReturn(applicationRoles);
- List<EPRole> expectedApplicationRoles = externalAccessRolesServiceImpl.getAppRoles((long) 1);
- assertEquals(expectedApplicationRoles, applicationRoles);
- }
-
- @Test
- public void getAppRolesTest() throws Exception {
- List<EPRole> applicationRoles = new ArrayList<>();
- Mockito.when(dataAccessService1.getList(EPRole.class, "test", null, null)).thenReturn(applicationRoles);
- List<EPRole> expectedApplicationRoles = externalAccessRolesServiceImpl.getAppRoles((long) 10);
- assertEquals(expectedApplicationRoles, applicationRoles);
- }
-
- // @SuppressWarnings("null")
- // @Test(expected = java.lang.Exception.class)
- // public void getAppRolesExceptionTest() throws Exception{
- // List<EPRole> applicationRoles = new ArrayList<>();
- // DataAccessService dataAccessService = null ;
- // Mockito.when(dataAccessService.getList(EPRole.class, "where app_id = 10",
- // null, null)).thenThrow(nullPointerException);
- // List<EPRole> expectedApplicationRoles =
- // externalAccessRolesServiceImpl.getAppRoles((long) 10);
- // assertEquals(expectedApplicationRoles,applicationRoles);
- // }
-
- @Test(expected = java.lang.Exception.class)
- public void getAppExceptionTest() throws Exception {
- List<EPApp> app = new ArrayList<>();
- String uebKey = "test-ueb-key";
- Mockito.when(dataAccessService1.getList(EPApp.class, " where ueb_key = '" + uebKey + "'", null, null))
- .thenReturn(app);
- List<EPApp> expectedapp = externalAccessRolesServiceImpl.getApp(uebKey);
- assertEquals(app, expectedapp);
- }
-
- @Test(expected = java.lang.Exception.class)
- public void getAppTest() throws Exception {
- List<EPApp> appList = new ArrayList<>();
- EPApp app = mockApp();
- appList.add(app);
- String uebKey = "test-ueb-key";
- Mockito.when(dataAccessService1.getList(EPApp.class, " where ueb_key = '" + uebKey + "'", null, null))
- .thenReturn(appList);
- List<EPApp> expectedapp = externalAccessRolesServiceImpl.getApp(uebKey);
- }
-
- @Test
- public void getAppErrorTest() throws Exception {
- List<EPApp> appList = new ArrayList<>();
- EPApp app = mockApp();
- app.setId((long) 1);
- appList.add(app);
- String uebKey = "test-ueb-key";
- Mockito.when(dataAccessService1.getList(EPApp.class, " where ueb_key = '" + uebKey + "'", null, null))
- .thenReturn(appList);
- List<EPApp> expectedapp = externalAccessRolesServiceImpl.getApp(uebKey);
- assertEquals(appList, expectedapp);
- }
-
- @Test
- public void addRoleTest() throws Exception {
- HttpHeaders headers = new HttpHeaders();
- PowerMockito.mockStatic(EcompPortalUtils.class);
- PowerMockito.mockStatic(SystemProperties.class);
- PowerMockito.mockStatic(EPCommonSystemProperties.class);
- String uebKey = "test-ueb-key";
- Role role = new Role();
- role.setId((long) 25);
- EPApp app = mockApp();
- app.setEnabled(true);
- app.setId((long) 10);
- app.setNameSpace("test_namesapce");
- Mockito.when(EcompPortalUtils.base64encodeKeyForAAFBasicAuth()).thenReturn(headers);
- List<EPApp> appList = new ArrayList<>();
- appList.add(app);
- List<EPRole> roleList = new ArrayList<>();
- EPRole ePRole = new EPRole();
- role.setName("Test Role");
- roleList.add(ePRole);
- Mockito.when(dataAccessService1.getList(EPApp.class, " where ueb_key = '" + uebKey + "'", null, null))
- .thenReturn(appList);
- Mockito.when(dataAccessService1.getList(EPRole.class, " where app_role_id = " + role.getId(), null, null))
- .thenReturn(roleList);
- Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL))
- .thenReturn("Testurl");
- ResponseEntity<String> addResponse = new ResponseEntity<>(HttpStatus.CREATED);
- Mockito.when(template.exchange(Matchers.anyString(), Matchers.eq(HttpMethod.POST),
- Matchers.<HttpEntity<String>>any(), Matchers.eq(String.class))).thenReturn(addResponse);
-
- assertTrue(externalAccessRolesServiceImpl.addRole(role, uebKey));
- }
-
- @Test
- public void addRoleMethodNotAllowedTest() throws Exception {
- HttpHeaders headers = new HttpHeaders();
- PowerMockito.mockStatic(EcompPortalUtils.class);
- PowerMockito.mockStatic(SystemProperties.class);
- PowerMockito.mockStatic(EPCommonSystemProperties.class);
- String uebKey = "test-ueb-key";
- Role role = new Role();
- role.setId((long) 25);
- EPApp app = mockApp();
- app.setEnabled(true);
- app.setId((long) 10);
- app.setNameSpace("test_namesapce");
- Mockito.when(EcompPortalUtils.base64encodeKeyForAAFBasicAuth()).thenReturn(headers);
- List<EPApp> appList = new ArrayList<>();
- appList.add(app);
- List<EPRole> roleList = new ArrayList<>();
- EPRole ePRole = new EPRole();
- role.setName("Test Role");
- roleList.add(ePRole);
- Mockito.when(dataAccessService1.getList(EPApp.class, " where ueb_key = '" + uebKey + "'", null, null))
- .thenReturn(appList);
- Mockito.when(dataAccessService1.getList(EPRole.class, " where app_role_id = " + role.getId(), null, null))
- .thenReturn(roleList);
- Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL))
- .thenReturn("Testurl");
- ResponseEntity<String> addResponse = new ResponseEntity<>(HttpStatus.METHOD_NOT_ALLOWED);
- Mockito.when(template.exchange(Matchers.anyString(), Matchers.eq(HttpMethod.POST),
- Matchers.<HttpEntity<String>>any(), Matchers.eq(String.class))).thenReturn(addResponse);
-
- assertFalse(externalAccessRolesServiceImpl.addRole(role, uebKey));
- }
-
- public EPApp getApp() {
- EPApp app = new EPApp();
- app.setName("Test");
- app.setImageUrl("test");
- app.setDescription("test");
- app.setNotes("test");
- app.setUrl("test");
- app.setId((long) 1);
- app.setAppRestEndpoint("test");
- app.setAlternateUrl("test");
- app.setName("test");
- app.setMlAppName("test");
- app.setMlAppAdminId("test");
- app.setUsername("test");
- app.setAppPassword("test");
- app.setOpen(true);
- app.setEnabled(false);
- app.setUebKey("test");
- app.setUebSecret("test");
- app.setUebTopicName("test");
- app.setAppType(1);
- return app;
- }
-
- @Test
- public void deleteCentralRoleFunctionTest() throws Exception {
- final Map<String, String> params = new HashMap<>();
- EPApp app = mockApp();
- params.put("functionCd", "menu_fun_code");
- params.put("appId", String.valueOf(10));
- List<CentralRoleFunction> centralRoleFunctionList = new ArrayList<>();
- CentralRoleFunction domainCentralRoleFunction = new CentralRoleFunction();
- domainCentralRoleFunction.setCode("menu_fun_code");
- centralRoleFunctionList.add(domainCentralRoleFunction);
- Mockito.when(dataAccessService1.executeNamedQuery("getAppFunctionDetails", params, null))
- .thenReturn(centralRoleFunctionList);
- ResponseEntity<String> addResponse = new ResponseEntity<>(HttpStatus.OK);
- Mockito.when(template.exchange(Matchers.anyString(), Matchers.eq(HttpMethod.DELETE),
- Matchers.<HttpEntity<String>>any(), Matchers.eq(String.class))).thenReturn(addResponse);
- HttpHeaders headers = new HttpHeaders();
- PowerMockito.mockStatic(EcompPortalUtils.class);
- Mockito.when(EcompPortalUtils.base64encodeKeyForAAFBasicAuth()).thenReturn(headers);
-
- Mockito.doNothing().when(dataAccessService1).deleteDomainObjects(EPAppRoleFunction.class,
- "app_id = " + app.getId() + " and function_cd = '" + "menu_fun_code" + "'", null);
-
- assertTrue(externalAccessRolesServiceImpl.deleteCentralRoleFunction("menu_fun_code", app));
- }
-
- @Test
- public void deleteCentralRoleFunctionFailTest() throws Exception {
- final Map<String, String> params = new HashMap<>();
- EPApp app = mockApp();
- params.put("functionCd", "menu_fun_code");
- params.put("appId", String.valueOf(10));
- List<CentralRoleFunction> centralRoleFunctionList = new ArrayList<>();
- CentralRoleFunction domainCentralRoleFunction = new CentralRoleFunction();
- domainCentralRoleFunction.setCode("menu_fun_code");
- centralRoleFunctionList.add(domainCentralRoleFunction);
- HttpClientErrorException httpClientErrorException = new HttpClientErrorException(HttpStatus.NOT_FOUND);
- Mockito.when(dataAccessService1.executeNamedQuery("getAppFunctionDetails", params, null))
- .thenReturn(centralRoleFunctionList);
- ResponseEntity<String> addResponse = new ResponseEntity<>(HttpStatus.NOT_FOUND);
- Mockito.when(template.exchange(Matchers.anyString(), Matchers.eq(HttpMethod.DELETE),
- Matchers.<HttpEntity<String>>any(), Matchers.eq(String.class))).thenThrow(httpClientErrorException);
- HttpHeaders headers = new HttpHeaders();
- PowerMockito.mockStatic(EcompPortalUtils.class);
- Mockito.when(EcompPortalUtils.base64encodeKeyForAAFBasicAuth()).thenReturn(headers);
-
- Mockito.doNothing().when(dataAccessService1).deleteDomainObjects(EPAppRoleFunction.class,
- "app_id = " + app.getId() + " and function_cd = '" + "menu_fun_code" + "'", null);
-
- assertTrue(externalAccessRolesServiceImpl.deleteCentralRoleFunction("menu_fun_code", app));
- }
-
- @Test
- public void deleteCentralRoleFunctionExceptionTest() {
- final Map<String, String> params = new HashMap<>();
- EPApp app = mockApp();
- params.put("functionCd", "menu_fun_code");
- params.put("appId", String.valueOf(10));
- List<CentralRoleFunction> centralRoleFunctionList = new ArrayList<>();
- CentralRoleFunction domainCentralRoleFunction = new CentralRoleFunction();
- domainCentralRoleFunction.setCode("menu_fun_code");
- centralRoleFunctionList.add(domainCentralRoleFunction);
- Mockito.when(dataAccessService1.executeNamedQuery("getAppFunctionDetails", params, null))
- .thenThrow(nullPointerException);
- assertFalse(externalAccessRolesServiceImpl.deleteCentralRoleFunction("menu_fun_code", app));
- }
-
- @Test
- public void getUserTest() {
- List<EPUser> userList = new ArrayList<>();
- EPUser user = mockUser.mockEPUser();
- userList.add(user);
- Mockito.when(dataAccessService1.getList(EPUser.class, " where org_user_id = '" + "guestT" + "'", null, null))
- .thenReturn(userList);
- List<EPUser> expectedUserList = externalAccessRolesServiceImpl.getUser("guestT");
- assertEquals(expectedUserList, userList);
- }
-
- public void saveCentralRoleFunctionTest() throws Exception {
- CentralRoleFunction centralRoleFunction = new CentralRoleFunction();
- centralRoleFunction.setCode("menu_test");
- EPApp app = mockApp();
- app.setId((long) 1);
- final Map<String, String> params = new HashMap<>();
- params.put("functionCd", "menu_test");
- params.put("appId", String.valueOf(1));
- ExternalAccessPerms extPerms = new ExternalAccessPerms();
- PowerMockito.mockStatic(EcompPortalUtils.class);
- HttpHeaders headers = new HttpHeaders();
- Mockito.when(EcompPortalUtils.base64encodeKeyForAAFBasicAuth()).thenReturn(headers);
- List<CentralRoleFunction> appRoleFunc = new ArrayList<>();
- appRoleFunc.add(centralRoleFunction);
- Mockito.when(dataAccessService1.executeNamedQuery("getAppFunctionDetails", params,
- null)).thenReturn(appRoleFunc);
- ResponseEntity<String> addResponse = new ResponseEntity<>(HttpStatus.OK);
- Mockito.when(template.exchange(Matchers.anyString(), Matchers.eq(HttpMethod.GET),
- Matchers.<HttpEntity<String>>any(), Matchers.eq(String.class))).thenReturn(addResponse);
- }
-}
+++ /dev/null
-/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ================================================================================
- */
-package org.openecomp.portalapp.portal.test.service;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.domain.FunctionalMenuItemWithAppID;
-import org.openecomp.portalapp.portal.service.FunctionalMenuService;
-import org.openecomp.portalapp.portal.service.FunctionalMenuServiceImpl;
-import org.openecomp.portalapp.portal.transport.FavoritesFunctionalMenuItemJson;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuItem;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuRole;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.test.framework.ApplicationCommonContextTestSuite;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({SystemProperties.class, EPCommonSystemProperties.class})
-public class FunctionalMenuMockServiceImplTest extends ApplicationCommonContextTestSuite {
-
- @Mock
- FunctionalMenuService functionalMenuService;
-
- @Mock
- DataAccessService dataAccessService;
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- @InjectMocks
- FunctionalMenuServiceImpl functionalMenuServiceImpl= new FunctionalMenuServiceImpl();
-
- @Test
- public void assignHelpURLsTest(){
- List<FunctionalMenuItem> menuItems = new ArrayList<FunctionalMenuItem>();
- FunctionalMenuItem functionalMenuItem1 = new FunctionalMenuItem();
- functionalMenuItem1.text = "Contact Us";
- FunctionalMenuItem functionalMenuItem2 = new FunctionalMenuItem();
- functionalMenuItem2.text = "Get Access";
- FunctionalMenuItem functionalMenuItem3 = new FunctionalMenuItem();
- functionalMenuItem3.text = "User Guide";
- menuItems.add(functionalMenuItem1);
- menuItems.add(functionalMenuItem2);
- menuItems.add(functionalMenuItem3);
-
- PowerMockito.mockStatic(SystemProperties.class);
- Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.USER_GUIDE_URL)).thenReturn("http://todo_enter_user_guide_link");
-// Mockito.doNothing().when(functionalMenuServiceImpl).assignHelpURLs(menuItems);
- functionalMenuServiceImpl.assignHelpURLs(menuItems);
- }
-
- @Test
- public void getFunctionalMenuItemsTest(){
- String sql = "SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn, r.app_id FROM fn_menu_functional m, "
- + "fn_menu_functional_roles r WHERE m.menu_id = r.menu_id AND UPPER(m.active_yn) = 'Y' AND r.role_id != '900' "
- + "UNION SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn,-1 app_id FROM fn_menu_functional m "
- + "WHERE m.url='' AND UPPER(m.active_yn) = 'Y'";
- List<FunctionalMenuItem> actualResult = new ArrayList<FunctionalMenuItem>();
- List<FunctionalMenuItem> expectedResult = new ArrayList<FunctionalMenuItem>();
-
- Mockito.when(dataAccessService.executeSQLQuery(sql, FunctionalMenuItemWithAppID.class, null)).thenReturn(expectedResult);
-
- actualResult = functionalMenuServiceImpl.getFunctionalMenuItems(true);
- assertEquals(actualResult, expectedResult);
- }
-
- @Test
- public void getFunctionalMenuItemsNegativeTest(){
- String sql = "SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn, r.app_id FROM fn_menu_functional m, "
- + "fn_menu_functional_roles r WHERE m.menu_id = r.menu_id AND UPPER(m.active_yn) = 'Y' AND r.role_id != '900' "
- + "UNION SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn,-1 app_id FROM fn_menu_functional m "
- + "WHERE m.url='' AND UPPER(m.active_yn) = 'Y'";
- List<FunctionalMenuItem> actualResult = new ArrayList<FunctionalMenuItem>();
- List<FunctionalMenuItem> expectedResult = new ArrayList<FunctionalMenuItem>();
-
- Mockito.when(dataAccessService.executeSQLQuery(sql, FunctionalMenuItemWithAppID.class, null)).thenReturn(expectedResult);
-
- actualResult = functionalMenuServiceImpl.getFunctionalMenuItems(false);
- assertEquals(actualResult, expectedResult);
- }
-
- @Test
- public void getFunctionalMenuItemsForNotificationTreeTest(){
- String sql = "SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn, r.app_id FROM fn_menu_functional m, fn_menu_functional_roles r "
- + "WHERE m.menu_id = r.menu_id AND UPPER(m.active_yn) = 'Y' AND r.role_id != '900' UNION SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id,"
- + " m.url, m.active_yn,-1 app_id FROM fn_menu_functional m WHERE m.url='' AND UPPER(m.active_yn) = 'Y'";
- List<FunctionalMenuItem> actualResult = new ArrayList<FunctionalMenuItem>();
- List<FunctionalMenuItem> expectedResult = new ArrayList<FunctionalMenuItem>();
-
- Mockito.when(dataAccessService.executeSQLQuery(sql, FunctionalMenuItemWithAppID.class, null)).thenReturn(expectedResult);
-
- actualResult = functionalMenuServiceImpl.getFunctionalMenuItemsForNotificationTree(true);
- assertEquals(actualResult, expectedResult);
-
- }
-
- @Test
- public void getFunctionalMenuItemsForNotificationNegativeTreeTest(){
- String sql = "SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn, r.app_id FROM fn_menu_functional m, fn_menu_functional_roles r "
- + "WHERE m.menu_id = r.menu_id AND UPPER(m.active_yn) = 'Y' AND r.role_id != '900' UNION SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id,"
- + " m.url, m.active_yn,-1 app_id FROM fn_menu_functional m WHERE m.url='' AND UPPER(m.active_yn) = 'Y'";
- List<FunctionalMenuItem> actualResult = new ArrayList<FunctionalMenuItem>();
- List<FunctionalMenuItem> expectedResult = new ArrayList<FunctionalMenuItem>();
-
- Mockito.when(dataAccessService.executeSQLQuery(sql, FunctionalMenuItemWithAppID.class, null)).thenReturn(expectedResult);
-
- actualResult = functionalMenuServiceImpl.getFunctionalMenuItemsForNotificationTree(false);
- assertEquals(actualResult, expectedResult);
- }
-
- @Test
- public void getFunctionalMenuItemsForAppTest(){
- String sql = "SELECT DISTINCT m1.menu_id, m1.column_num, m1.text, m1.parent_menu_id, m1.url, m.active_yn "
- + "FROM fn_menu_functional m, fn_menu_functional m1, fn_menu_functional_ancestors a, fn_menu_functional_roles mr "
- + "WHERE mr.app_id='1' AND mr.menu_id = m.menu_id AND UPPER(m.active_yn) = 'Y' AND UPPER(m1.active_yn) ='Y' AND a.menu_id = m.menu_id "
- + "AND a.ancestor_menu_id = m1.menu_id";
- Integer appId = 1;
- List<FunctionalMenuItem> actualResult = new ArrayList<FunctionalMenuItem>();
- List<FunctionalMenuItem> expectedResult = new ArrayList<FunctionalMenuItem>();
-
- Mockito.when(dataAccessService.executeSQLQuery(sql, FunctionalMenuItemWithAppID.class, null)).thenReturn(expectedResult);
-
- actualResult = functionalMenuServiceImpl.getFunctionalMenuItemsForApp(appId);
- assertEquals(actualResult, expectedResult);
- }
-
- @Test
- public void getFunctionalMenuItemsForUserTest(){
- String orgUserId = "test";
- String sql = "SELECT DISTINCT m1.menu_id, m1.column_num, m1.text, m1.parent_menu_id, m1.url, m.active_yn "
- + "FROM fn_menu_functional m, fn_menu_functional m1, fn_menu_functional_ancestors a, fn_menu_functional_roles mr, fn_user u , fn_user_role ur "
- + "WHERE u.org_user_id='test' AND u.user_id = ur.user_id AND ur.app_id = mr.app_id AND (ur.role_id = mr.role_id OR ur.role_id = '999') "
- + "AND m.menu_id = mr.menu_id AND UPPER(m.active_yn) = 'Y' AND UPPER(m1.active_yn) ='Y' AND a.menu_id = m.menu_id "
- + "AND a.ancestor_menu_id = m1.menu_id UNION select m1.menu_id, m1.column_num, m1.text, m1.parent_menu_id, m1.url, m1.active_yn "
- + "FROM fn_menu_functional m, fn_menu_functional_roles mr, fn_menu_functional m1, fn_menu_functional_ancestors a where a.menu_id = m.menu_id AND a.ancestor_menu_id = m1.menu_id AND m.menu_id != m1.menu_id AND m.menu_id = mr.menu_id AND mr.role_id = '900' AND UPPER(m.active_yn) = 'Y' AND UPPER(m1.active_yn) ='Y' UNION SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn FROM fn_menu_functional m WHERE m.text in ('Favorites','Get Access','Contact Us','Support','User Guide','Help')";
- List<FunctionalMenuItem> actualResult = new ArrayList<FunctionalMenuItem>();
- List<FunctionalMenuItem> expectedResult = new ArrayList<FunctionalMenuItem>();
-
- Mockito.when(dataAccessService.executeSQLQuery(sql, FunctionalMenuItemWithAppID.class, null)).thenReturn(expectedResult);
-
- actualResult = functionalMenuServiceImpl.getFunctionalMenuItemsForUser(orgUserId);
- assertEquals(actualResult, expectedResult);
- }
-
- @Test
- public void getFunctionalMenuItemDetailsTest(){
- Integer menuid = 1;
- String sql = "SELECT * FROM fn_menu_functional_roles WHERE menu_id = '1'";
- FunctionalMenuItem actualResult = null;
- FunctionalMenuItem expectedResult = null;
- List<FunctionalMenuRole> roleItems = new ArrayList<FunctionalMenuRole>();
- Mockito.when(dataAccessService.executeSQLQuery(sql, FunctionalMenuItemWithAppID.class, null)).thenReturn(roleItems);
-
- actualResult = functionalMenuServiceImpl.getFunctionalMenuItemDetails(menuid);
- assertEquals(actualResult, expectedResult);
- }
-
- @Test
- public void getFavoriteItemsTest(){
- Long userId = (long)1;
- String sql = "SELECT DISTINCT f.user_id,f.menu_id,m.text,m.url "
- + "FROM fn_menu_favorites f, fn_menu_functional m, fn_menu_functional_roles mr "
- + "WHERE f.user_id='1' AND f.menu_id = m.menu_id AND f.menu_id = mr.menu_id AND mr.role_id != '900' ";
- List<FavoritesFunctionalMenuItemJson> actualResult = new ArrayList<FavoritesFunctionalMenuItemJson>();
- List<FavoritesFunctionalMenuItemJson> expectedResult = new ArrayList<FavoritesFunctionalMenuItemJson>();
-
- Mockito.when(dataAccessService.executeSQLQuery(sql, FavoritesFunctionalMenuItemJson.class, null)).thenReturn(expectedResult);
-
- actualResult = functionalMenuServiceImpl.getFavoriteItems(userId);
- assertEquals(actualResult, expectedResult);
- }
-}
+++ /dev/null
-/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ================================================================================
- */
-package org.openecomp.portalapp.portal.test.service;
-
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.service.FunctionalMenuService;
-import org.openecomp.portalapp.portal.transport.BusinessCardApplicationRole;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuRole;
-import org.openecomp.portalapp.test.framework.ApplicationCommonContextTestSuite;
-import org.springframework.beans.factory.annotation.Autowired;
-
-public class FunctionalMenuServiceImplTest extends ApplicationCommonContextTestSuite {
-
- @Autowired
- FunctionalMenuService functionalMenuService;
-
- @Test
- public void getAppListTestService() throws Exception {
-
- String userId = "guestT";
- List<BusinessCardApplicationRole> userAppRolesActualResult = null;
-
- List<BusinessCardApplicationRole> userAppRolesExpectedResult = new ArrayList<BusinessCardApplicationRole>();
- BusinessCardApplicationRole businessCardApplicationRole = new BusinessCardApplicationRole();
- businessCardApplicationRole.setAppName("ECOMP Portal");
- businessCardApplicationRole.setRoleName("System Administrator");
- userAppRolesExpectedResult.add(businessCardApplicationRole);
- Map<String, String> params = new HashMap<String, String>();
- params.put("userId", userId);
- userAppRolesActualResult = functionalMenuService.getUserAppRolesList(userId);
- assertTrue(userAppRolesActualResult.contains(businessCardApplicationRole));
-
- }
-
- @Test
- public void getFunctionalMenuRoleTest() throws Exception {
-
- FunctionalMenuRole expectedFunctionalMenuRole = new FunctionalMenuRole();
- expectedFunctionalMenuRole.setId(new Integer(-1));
-
- expectedFunctionalMenuRole.setMenuId((long) 137);
- expectedFunctionalMenuRole.setAppId(new Integer(456));
- expectedFunctionalMenuRole.setRoleId(new Integer(6214));
- List<FunctionalMenuRole> actualFunctionalMenuRoleList = null;
- actualFunctionalMenuRoleList = functionalMenuService.getFunctionalMenuRole();
- assertTrue(actualFunctionalMenuRoleList.contains(expectedFunctionalMenuRole));
-
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.service;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.GetAccessResult;
-import org.openecomp.portalapp.portal.service.GetAccessServiceImpl;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.service.DataAccessServiceImpl;
-
-public class GetAccessServiceImplTest {
-
-
- @Mock
- DataAccessService dataAccessService = new DataAccessServiceImpl();
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- @InjectMocks
- GetAccessServiceImpl getAccessServiceImpl = new GetAccessServiceImpl();
-
- MockEPUser mockUser = new MockEPUser();
-
- @Test
- public void getAppAccessListTest()
- {
- EPUser user = mockUser.mockEPUser();
- Map<String, Long> params = new HashMap<>();
- params.put("userId", user.getId());
- List<GetAccessResult> appAccessList = new ArrayList<>();
- Mockito.when(dataAccessService.executeNamedQuery("getAppAccessFunctionRole", params, null)).thenReturn(appAccessList);
-
- List<GetAccessResult> expectedAppAccessList = getAccessServiceImpl.getAppAccessList(user);
- assertEquals(expectedAppAccessList, appAccessList);
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.service;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
-import java.io.IOException;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.lm.LicenseableClassImpl;
-
-public class LicenseableClassImplTest {
-
- @InjectMocks
- LicenseableClassImpl licenseableClassImpl= new LicenseableClassImpl();
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- @Test
- public void getApplicationNameTest()
- {
- assertEquals(licenseableClassImpl.getApplicationName(), "");
- }
- @Test
- public void getPublicKeystoreAsInputStreamTest() throws IOException
- {
- assertNull(licenseableClassImpl.getPublicKeystoreAsInputStream());
- }
- @Test
- public void getAliasTest()
- {
- assertEquals(licenseableClassImpl.getAlias(), "");
- }
- @Test
- public void getKeyPasswdTest()
- {
- assertEquals(licenseableClassImpl.getKeyPasswd(), "");
- }
- @Test
- public void getPublicKeystorePasswordTest()
- {
- assertEquals(licenseableClassImpl.getPublicKeystorePassword(), "");
- }
- @Test
- public void getCipherParamPasswordTest()
- {
- assertEquals(licenseableClassImpl.getPublicKeystorePassword(), "");
- }
- @Test
- public void getClassToLicenseTest()
- {
- assertEquals(licenseableClassImpl.getClassToLicense(), LicenseableClassImpl.class);
- }
-
-
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.service;
-
-import static org.junit.Assert.assertTrue;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.jar.Attributes;
-
-import javax.servlet.ServletContext;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.service.ManifestServiceImpl;
-
-public class ManifestServiceImplTest {
-
- @Mock
- ServletContext context;
-
- @Mock
- ServletContext context1 = null;
-
- @InjectMocks
- ManifestServiceImpl manifestServiceImpl = new ManifestServiceImpl();
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- NullPointerException nullPointerException = new NullPointerException();
-
- @Test
- public void getWebappManifestTest() throws IOException {
- final String MANIFEST_RESOURCE_PATH = "/META-INF/MANIFEST.MF";
- InputStream inputStream = new ByteArrayInputStream("test data".getBytes());
- Mockito.when(context.getResourceAsStream(MANIFEST_RESOURCE_PATH)).thenReturn(inputStream);
- Attributes attributes = manifestServiceImpl.getWebappManifest();
- assertTrue(attributes.size() == 0);
- }
-
- @Test(expected = java.lang.NullPointerException.class)
- public void getWebappManifestExceptionTest() throws IOException {
- final String MANIFEST_RESOURCE_PATH = "/META-INF/MANIFEST.MF";
- InputStream inputStream = new ByteArrayInputStream("test data".getBytes());
- Mockito.when(context1.getResourceAsStream(MANIFEST_RESOURCE_PATH)).thenThrow(nullPointerException);
- Attributes attributes = manifestServiceImpl.getWebappManifest();
- assertTrue(attributes.size() == 0);
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.test.service;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.EPUserApp;
-import org.openecomp.portalapp.portal.domain.PersUserAppSelection;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.PersUserAppServiceImpl;
-import org.openecomp.portalapp.portal.service.UserRolesService;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-
-public class PersUserAppServiceImplTest {
-
- @Mock
- DataAccessService dataAccessService;
- @Mock
- AdminRolesService adminRolesService;
- @Mock
- UserRolesService userRolesService;
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- @InjectMocks
- PersUserAppServiceImpl persUserAppServiceImpl = new PersUserAppServiceImpl();
-
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
- NullPointerException nullPointerException = new NullPointerException();
- MockEPUser mockUser = new MockEPUser();
-
- public EPApp getApp() {
- EPApp app = new EPApp();
- app.setName("Test");
- app.setImageUrl("test");
- app.setDescription("test");
- app.setNotes("test");
- app.setUrl("test");
- app.setId((long) 1);
- app.setAppRestEndpoint("test");
- app.setAlternateUrl("test");
- app.setName("test");
- app.setMlAppName("test");
- app.setMlAppAdminId("test");
- app.setUsername("test");
- app.setAppPassword("test");
- app.setOpen(true);
- app.setEnabled(false);
- app.setUebKey("test");
- app.setUebSecret("test");
- app.setUebTopicName("test");
- app.setAppType(1);
- return app;
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void setPersUserAppValueIfUserNull() {
- persUserAppServiceImpl.setPersUserAppValue(null, null, false, false);
- }
-
- @Test
- public void setPersUserAppValueTest() {
- EPApp app = getApp();
- EPUser user = mockUser.mockEPUser();
- List<PersUserAppSelection> persUserAppSelectionList = new ArrayList<>();
- PersUserAppSelection persUserAppSelection = new PersUserAppSelection();
- persUserAppSelection.setId((long) 1);
- persUserAppSelectionList.add(persUserAppSelection);
- Mockito.when(dataAccessService.getList(PersUserAppSelection.class, "test", null, null))
- .thenReturn(persUserAppSelectionList);
- Mockito.doNothing().when(dataAccessService).deleteDomainObject(persUserAppSelection, null);
- persUserAppServiceImpl.setPersUserAppValue(user, app, false, true);
- }
-
- @Test
- public void setPersUserAppValueIfSelectTest() {
- EPApp app = getApp();
- EPUser user = mockUser.mockEPUser();
- List<PersUserAppSelection> persUserAppSelectionList = new ArrayList<>();
- PersUserAppSelection persUserAppSelection = new PersUserAppSelection();
- persUserAppSelection.setId((long) 1);
- persUserAppSelectionList.add(persUserAppSelection);
- Mockito.when(dataAccessService.getList(PersUserAppSelection.class, "test", null, null))
- .thenReturn(persUserAppSelectionList);
- Mockito.doNothing().when(dataAccessService).saveDomainObject(persUserAppSelection, null);
- persUserAppServiceImpl.setPersUserAppValue(user, app, true, true);
- }
-
- @Test
- public void setPersUserAppValueIfOpenTest() {
- EPApp app = getApp();
- app.setOpen(false);
- EPUser user = mockUser.mockEPUser();
- List<PersUserAppSelection> persUserAppSelectionList = new ArrayList<>();
- PersUserAppSelection persUserAppSelection = new PersUserAppSelection();
- persUserAppSelection.setId((long) 1);
- persUserAppSelectionList.add(persUserAppSelection);
- Mockito.when(dataAccessService.getList(PersUserAppSelection.class, "test", null, null))
- .thenReturn(persUserAppSelectionList);
- Mockito.doNothing().when(dataAccessService).saveDomainObject(persUserAppSelection, null);
- persUserAppServiceImpl.setPersUserAppValue(user, app, true, true);
- }
-
- @Test
- public void setPersUserAppValueIfAppNotOpenTest() {
- EPApp app = getApp();
- app.setOpen(false);
- EPUser user = mockUser.mockEPUser();
- List<PersUserAppSelection> persUserAppSelectionList = new ArrayList<>();
- PersUserAppSelection persUserAppSelection = new PersUserAppSelection();
- persUserAppSelection.setId((long) 1);
- persUserAppSelectionList.add(persUserAppSelection);
- Mockito.when(dataAccessService.getList(PersUserAppSelection.class, "test", null, null))
- .thenReturn(persUserAppSelectionList);
- Mockito.doNothing().when(dataAccessService).saveDomainObject(persUserAppSelection, null);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- List<EPUserApp> roles = new ArrayList<>();
- EPUserApp epUserApp = new EPUserApp();
- roles.add(epUserApp);
- Mockito.when(userRolesService.getCachedAppRolesForUser(app.getId(), user.getId())).thenReturn(roles);
- persUserAppServiceImpl.setPersUserAppValue(user, app, true, false);
- }
-
- @Test
- public void setPersUserAppValueIfNotPortalAdminTest() {
- EPApp app = getApp();
- app.setOpen(false);
- EPUser user = mockUser.mockEPUser();
- List<PersUserAppSelection> persUserAppSelectionList = new ArrayList<>();
- PersUserAppSelection persUserAppSelection = new PersUserAppSelection();
- persUserAppSelection.setId((long) 1);
- persUserAppSelectionList.add(persUserAppSelection);
- Mockito.when(dataAccessService.getList(PersUserAppSelection.class, "test", null, null))
- .thenReturn(persUserAppSelectionList);
- Mockito.doNothing().when(dataAccessService).deleteDomainObject(persUserAppSelection, null);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
- List<EPUserApp> roles = new ArrayList<>();
- EPUserApp epUserApp = new EPUserApp();
- roles.add(epUserApp);
- Mockito.when(userRolesService.getCachedAppRolesForUser(app.getId(), user.getId())).thenReturn(roles);
- persUserAppServiceImpl.setPersUserAppValue(user, app, true, false);
- }
-
- @Test
- public void setPersUserAppValueNewTest() {
- EPApp app = getApp();
- app.setOpen(false);
- EPUser user = mockUser.mockEPUser();
- List<PersUserAppSelection> persUserAppSelectionList = new ArrayList<>();
- PersUserAppSelection persUserAppSelection = new PersUserAppSelection();
- persUserAppSelection.setId((long) 1);
- persUserAppSelectionList.add(persUserAppSelection);
- Mockito.when(dataAccessService.getList(PersUserAppSelection.class, "test", null, null))
- .thenReturn(persUserAppSelectionList);
- Mockito.doNothing().when(dataAccessService).saveDomainObject(persUserAppSelection, null);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- List<EPUserApp> roles = new ArrayList<>();
- EPUserApp epUserApp = new EPUserApp();
- roles.add(epUserApp);
- Mockito.when(userRolesService.getCachedAppRolesForUser(app.getId(), user.getId())).thenReturn(roles);
- persUserAppServiceImpl.setPersUserAppValue(user, app, false, false);
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.Analytics;
-
-public class AnalyticsTest {
-
- public Analytics mockAnalytics(){
- Analytics analytics = new Analytics();
-
- analytics.setAction("test");
- analytics.setPage("test");
- analytics.setFunction("test");
- analytics.setUserid("test");
- analytics.setType("test");
-
- return analytics;
- }
-
- @Test
- public void analyticsTest(){
- Analytics analytics = mockAnalytics();
-
- assertEquals(analytics.getAction(), "test");
- assertEquals(analytics.getPage(), "test");
- assertEquals(analytics.getFunction(), "test");
- assertEquals(analytics.getUserid(), "test");
- assertEquals(analytics.getType(), "test");
-
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-
-public class AppCatalogPersonalizationTest {
-
- public AppCatalogPersonalization mockAppCatalogPersonalization(){
- AppCatalogPersonalization appCatalogPersonalization = new AppCatalogPersonalization();
-
- return appCatalogPersonalization;
- }
-
- @Test
- public void appCatalogPersonalizationTest(){
- AppCatalogPersonalization appCatalogPersonalization = mockAppCatalogPersonalization();
-
- AppCatalogPersonalization appCatalogPersonalization1 = new AppCatalogPersonalization();
-
- assertEquals(appCatalogPersonalization.hashCode(), appCatalogPersonalization1.hashCode());
- assertTrue(appCatalogPersonalization.equals(appCatalogPersonalization1));
- }
-
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.AppNameIdIsAdmin;
-
-public class AppNameIdIsAdminTest {
-
- public AppNameIdIsAdmin mockAppNameIdIsAdmin(){
- AppNameIdIsAdmin appNameIdIsAdmin = new AppNameIdIsAdmin();
- appNameIdIsAdmin.setId((long)1);
- appNameIdIsAdmin.setAppName("test");
- appNameIdIsAdmin.setRestrictedApp(false);
- appNameIdIsAdmin.setIsAdmin(false);
- return appNameIdIsAdmin;
- }
-
- @Test
- public void appNameIdIsAdminTest(){
- AppNameIdIsAdmin appNameIdIsAdmin = mockAppNameIdIsAdmin();
-
- AppNameIdIsAdmin appNameIdIsAdmin1 = new AppNameIdIsAdmin();
- appNameIdIsAdmin1.setId((long)1);
- appNameIdIsAdmin1.setAppName("test");
- appNameIdIsAdmin1.setRestrictedApp(false);
- appNameIdIsAdmin1.setIsAdmin(false);
-
- assertEquals(appNameIdIsAdmin.getId(), new Long(1));
- assertEquals(appNameIdIsAdmin.getAppName(), "test");
- assertEquals(appNameIdIsAdmin.getRestrictedApp(), false);
- assertEquals(appNameIdIsAdmin.getIsAdmin(), false);
-
- assertEquals(appNameIdIsAdmin.toString(), "AppNameIdIsAdmin [id=1, appName=test, isAdmin=false, restrictedApp=false]");
- assertEquals(appNameIdIsAdmin.hashCode(), appNameIdIsAdmin1.hashCode());
- assertTrue(appNameIdIsAdmin.equals(appNameIdIsAdmin1));
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import org.junit.Test;
-import static org.junit.Assert.assertEquals;
-import org.openecomp.portalapp.portal.transport.AppWithRolesForUser;
-
-public class AppWithRolesForUserTest {
-
- public AppWithRolesForUser mockAppWithRolesForUser(){
- AppWithRolesForUser appWithRolesForUser = new AppWithRolesForUser();
-
- // List<RoleInAppForUser> appRoles = new ArrayList<RoleInAppForUser>();
-
- appWithRolesForUser.setOrgUserId("test");
- appWithRolesForUser.setAppId((long)1);
- appWithRolesForUser.setAppName("test");
- appWithRolesForUser.setAppRoles(null);
-
- return appWithRolesForUser;
- }
-
- @Test
- public void roleInAppForUserTest(){
- AppWithRolesForUser appWithRolesForUser = mockAppWithRolesForUser();
-
- assertEquals(appWithRolesForUser.getOrgUserId(), "test");
- assertEquals(appWithRolesForUser.getAppId(), new Long(1));
- assertEquals(appWithRolesForUser.getAppName(), "test");
- assertEquals(appWithRolesForUser.getAppRoles(), null);
- assertEquals(appWithRolesForUser.toString(), "AppWithRolesForUser [orgUserId=test, appId=1, appName=test, appRoles=null]");
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.*;
-
-import java.util.ArrayList;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.AppNameIdIsAdmin;
-import org.openecomp.portalapp.portal.transport.AppsListWithAdminRole;
-
-public class AppsListWithAdminRoleTest {
-
- public AppsListWithAdminRole mockAppsListWithAdminRole(){
- AppsListWithAdminRole appsListWithAdminRole = new AppsListWithAdminRole();
-
- ArrayList<AppNameIdIsAdmin> appsRoles = new ArrayList<AppNameIdIsAdmin>();
- AppNameIdIsAdmin appNameIdIsAdmin = new AppNameIdIsAdmin();
- appsRoles.add(appNameIdIsAdmin);
-
- appsListWithAdminRole.setOrgUserId("test");
- appsListWithAdminRole.setAppsRoles(appsRoles);
-
- return appsListWithAdminRole;
- }
-
- @Test
- public void appsListWithAdminRoleTest(){
- AppsListWithAdminRole appsListWithAdminRole = mockAppsListWithAdminRole();
-
- AppsListWithAdminRole appsListWithAdminRole1 = new AppsListWithAdminRole();
-
- ArrayList<AppNameIdIsAdmin> appsRoles = new ArrayList<AppNameIdIsAdmin>();
- AppNameIdIsAdmin appNameIdIsAdmin = new AppNameIdIsAdmin();
- appsRoles.add(appNameIdIsAdmin);
-
- appsListWithAdminRole1.setOrgUserId("test");
- appsListWithAdminRole1.setAppsRoles(appsRoles);
-
- assertEquals(appsListWithAdminRole.getOrgUserId(), "test");
- assertEquals(appsListWithAdminRole.getAppsRoles(), appsRoles);
-
- assertTrue(appsListWithAdminRole.equals(appsListWithAdminRole1));
- assertEquals(appsListWithAdminRole.hashCode(), appsListWithAdminRole1.hashCode());
- assertEquals(appsListWithAdminRole.toString(), "AppsListWithAdminRole [orgUserId=test, appsRoles=[AppNameIdIsAdmin [id=null, appName=null, isAdmin=null, restrictedApp=null]]]");
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.BulkUploadRoleFunction;
-
-public class BulkUploadRoleFunctionTest {
-
- public BulkUploadRoleFunction mockBulkUploadRoleFunction(){
-
- BulkUploadRoleFunction bulkUploadRoleFunction = new BulkUploadRoleFunction();
-
- bulkUploadRoleFunction.setFunctionName("test");
- bulkUploadRoleFunction.setFunctionCd("test");
-
- return bulkUploadRoleFunction;
- }
-
- @Test
- public void bulkUploadRoleFunctionTest(){
- BulkUploadRoleFunction bulkUploadRoleFunction = mockBulkUploadRoleFunction();
-
- BulkUploadRoleFunction bulkUploadRoleFunction1 = new BulkUploadRoleFunction();
-
- bulkUploadRoleFunction1.setFunctionName("test");
- bulkUploadRoleFunction1.setFunctionCd("test");
-
- assertEquals(bulkUploadRoleFunction.getFunctionCd(), "test");
- assertEquals(bulkUploadRoleFunction.getFunctionName(), "test");
- assertEquals(bulkUploadRoleFunction.hashCode(), bulkUploadRoleFunction1.hashCode());
- assertTrue(bulkUploadRoleFunction.equals(bulkUploadRoleFunction1));
-
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.BulkUploadUserRoles;
-
-public class BulkUploadUserRolesTest {
-
- public BulkUploadUserRoles mockBulkUploadUserRoles(){
- BulkUploadUserRoles bulkUploadUserRoles = new BulkUploadUserRoles();
-
- bulkUploadUserRoles.setRoleName("test");
- bulkUploadUserRoles.setOrgUserId("test");
- bulkUploadUserRoles.setAppNameSpace("test");
-
- return bulkUploadUserRoles;
- }
-
- @Test
- public void bulkUploadUserRolesTest(){
- BulkUploadUserRoles bulkUploadUserRoles = mockBulkUploadUserRoles();
-
- BulkUploadUserRoles bulkUploadUserRoles1 = new BulkUploadUserRoles();
-
- bulkUploadUserRoles1.setRoleName("test");
- bulkUploadUserRoles1.setOrgUserId("test");
- bulkUploadUserRoles1.setAppNameSpace("test");
-
- assertEquals(bulkUploadUserRoles.getRoleName(), "test");
- assertEquals(bulkUploadUserRoles.getOrgUserId(), "test");
- assertEquals(bulkUploadUserRoles.getAppNameSpace(), "test");
-
- assertEquals(bulkUploadUserRoles.hashCode(), bulkUploadUserRoles1.hashCode());
- assertTrue(bulkUploadUserRoles.equals(bulkUploadUserRoles1));
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-public class BusinessCardApplicationRoleTest {
-
- public BusinessCardApplicationRole mockBusinessCardApplicationRole(){
- BusinessCardApplicationRole businessCardApplicationRole = new BusinessCardApplicationRole();
-
- return businessCardApplicationRole;
- }
-
- @Test
- public void businessCardApplicationRoleTest(){
- BusinessCardApplicationRole businessCardApplicationRole = mockBusinessCardApplicationRole();
-
- BusinessCardApplicationRole businessCardApplicationRole1 = new BusinessCardApplicationRole();
-
- assertEquals(businessCardApplicationRole.hashCode(), businessCardApplicationRole1.hashCode());
- assertTrue(businessCardApplicationRole.equals(businessCardApplicationRole1));
- assertEquals(businessCardApplicationRole.toString(), "BusinessCardUserApplicationRoles [appName=null, roleName=null]");
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-public class BusinessCardApplicationRolesListTest {
-
- public BusinessCardApplicationRolesList mockBusinessCardApplicationRolesList(){
- BusinessCardApplicationRolesList businessCardApplicationRolesList = new BusinessCardApplicationRolesList();
-
- return businessCardApplicationRolesList;
- }
-
- @Test
- public void businessCardApplicationRolesListTest(){
- BusinessCardApplicationRolesList businessCardApplicationRolesList = mockBusinessCardApplicationRolesList();
-
- BusinessCardApplicationRolesList businessCardApplicationRolesList1 = new BusinessCardApplicationRolesList();
-
- assertEquals(businessCardApplicationRolesList.hashCode(), businessCardApplicationRolesList1.hashCode());
- assertTrue(businessCardApplicationRolesList.equals(businessCardApplicationRolesList1));
- assertEquals(businessCardApplicationRolesList.toString(), "BusinessCardUserAppRoles [appName=null, roleNames=null]");
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.CentralApp;
-
-public class CentralAppTest {
-
- public CentralApp mockCentralApp(){
- CentralApp centralApp = new CentralApp((long)1, null, null, (long)1, (long)1, (long)1, "test", "test", "test", "test", "test", "test", "test", "test", "test",
- "test", "test", "test", "test", null, "test", "test", "test", "test");
-
-
- /* public CentralApp(Long id, Date created, Date modified, Long createdId, Long modifiedId, Long rowNum, String name,
- String imageUrl, String description, String notes, String url, String alternateUrl, String restEndpoint,
- String mlAppName, String mlAppAdminId, String motsId, String appPassword, String open, String enabled,
- byte[] thumbnail, String username, String uebKey, String uebSecret, String uebTopicName)*/
-
- centralApp.setId((long)1);
- centralApp.setCreatedId((long)1);
- centralApp.setModifiedId((long)1);
- centralApp.setRowNum((long)1);
- centralApp.setName("test");
- centralApp.setImageUrl("test");
- centralApp.setDescription("test");
- centralApp.setNotes("test");
- centralApp.setUrl("test");
- centralApp.setAlternateUrl("test");
- centralApp.setRestEndpoint("test");
- centralApp.setMlAppName("test");
- centralApp.setMlAppAdminId("test");
- centralApp.setMotsId("test");
- centralApp.setAppPassword("test");
- centralApp.setOpen("test");
- centralApp.setEnabled("test");
- centralApp.setUsername("test");
- centralApp.setUebKey("test");
- centralApp.setUebSecret("test");
- centralApp.setUebTopicName("test");
-
- return centralApp;
- }
-
- @Test
- public void centralAppTest(){
- CentralApp centralApp = mockCentralApp();
-
- CentralApp centralApp1 = new CentralApp((long)1, null, null, (long)1, (long)1, (long)1, "test", "test", "test", "test", "test", "test", "test", "test", "test",
- "test", "test", "test", "test", null, "test", "test", "test", "test");
-
- /*centralApp1.setId((long)1);
- centralApp1.setCreatedId((long)1);
- centralApp1.setModifiedId((long)1);
- centralApp1.setRowNum((long)1);
- centralApp1.setName("test");
- centralApp1.setImageUrl("test");
- centralApp1.setDescription("test");
- centralApp1.setNotes("test");
- centralApp1.setUrl("test");
- centralApp1.setAlternateUrl("test");
- centralApp1.setRestEndpoint("test");
- centralApp1.setMlAppName("test");
- centralApp1.setMlAppAdminId("test");
- centralApp1.setMotsId("test");
- centralApp1.setAppPassword("test");
- centralApp1.setOpen("test");
- centralApp1.setEnabled("test");
- centralApp1.setUsername("test");
- centralApp1.setUebKey("test");
- centralApp1.setUebSecret("test");
- centralApp1.setUebTopicName("test");*/
-
- assertEquals(centralApp.getId(), new Long(1));
- assertEquals(centralApp.getCreatedId(), new Long(1));
- assertEquals(centralApp.getModifiedId(), new Long(1));
- assertEquals(centralApp.getRowNum(), new Long(1));
- assertEquals(centralApp.getName(), "test");
- assertEquals(centralApp.getImageUrl(), "test");
- assertEquals(centralApp.getDescription(), "test");
- assertEquals(centralApp.getNotes(), "test");
- assertEquals(centralApp.getUrl(), "test");
- assertEquals(centralApp.getAlternateUrl(), "test");
- assertEquals(centralApp.getRestEndpoint(), "test");
- assertEquals(centralApp.getMlAppName(), "test");
- assertEquals(centralApp.getMlAppAdminId(), "test");
- assertEquals(centralApp.getMotsId(), "test");
- assertEquals(centralApp.getAppPassword(), "test");
- assertEquals(centralApp.getOpen(), "test");
- assertEquals(centralApp.getEnabled(), "test");
- assertEquals(centralApp.getUsername(), "test");
- assertEquals(centralApp.getUebKey(), "test");
- assertEquals(centralApp.getUebSecret(), "test");
- assertEquals(centralApp.getUebTopicName(), "test");
-
- assertTrue(centralApp.equals(centralApp1));
- assertEquals(centralApp.hashCode(), centralApp1.hashCode());
- /* assertTrue(centralApp.equals(new CentralApp((long)1, null, null, (long)1, (long)1, (long)1, "test", "test", "test", "test", "test", "test", "test", "test", "test",
- "test", "test", "test", "test", null, "test", "test", "test", "test")));*/
- }
-
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.*;
-
-import java.util.Date;
-import java.util.SortedSet;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.CentralRoleFunction;
-import org.openecomp.portalapp.portal.transport.CentralRole;
-
-public class CentralRoleTest {
-
- public CentralRole mockCentralRole(){
- CentralRole centralRole = new CentralRole((long)1, null, null, (long)1, (long)1, (long)1,
- "test", false, 1, null, null, null);
-
- centralRole.setId((long)1);
- centralRole.setCreatedId((long)1);
- centralRole.setModifiedId((long)1);
- centralRole.setRowNum((long)1);
- centralRole.setName("test");
- centralRole.setActive(false);
- centralRole.setPriority(1);
-
- centralRole.setCreated(null);
- centralRole.setModified(null);
- centralRole.setRoleFunctions(null);
- centralRole.setChildRoles(null);
- centralRole.setParentRoles(null);
-
- return centralRole;
- }
-
- @Test
- public void centralRoleTest(){
- CentralRole centralRole = mockCentralRole();
-
- CentralRole centralRole1 = new CentralRole((long)1, null, null, (long)1, (long)1, (long)1,
- "test", false, 1, null, null, null);
-
- CentralRole centralRole2 = new CentralRole((long)1, "test");
-
- assertEquals(centralRole.getId(), new Long(1));
- assertEquals(centralRole.getCreatedId(), new Long(1));
- assertEquals(centralRole.getModifiedId(), new Long(1));
- assertEquals(centralRole.getRowNum(), new Long(1));
- assertEquals(centralRole.getName(), "test");
- assertEquals(centralRole.isActive(), false);
- assertEquals(centralRole.getCreated(), null);
- assertEquals(centralRole.getModified(), null);
- assertEquals(centralRole.getRoleFunctions(), null);
- assertEquals(centralRole.getChildRoles(), null);
- assertEquals(centralRole.getParentRoles(), null);
- assertEquals(centralRole.getPriority().toString(), "1");
- assertEquals(centralRole.hashCode(), centralRole1.hashCode());
- assertTrue(centralRole.equals(centralRole1));
- assertEquals(centralRole, centralRole1);
- assertEquals(centralRole2, new CentralRole((long)1, "test"));
- }
-
-
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.CentralApp;
-import org.openecomp.portalapp.portal.transport.CentralRole;
-import org.openecomp.portalapp.portal.transport.CentralUserApp;
-
-public class CentralUserAppTest {
-
- public CentralUserApp mockCentralUserApp(){
- CentralUserApp centralUserApp = new CentralUserApp();
-
- CentralApp app = new CentralApp((long)1, null, null, (long)1, (long)1, (long)1, "test", "test", "test", "test", "test", "test", "test", "test", "test",
- "test", "test", "test", "test", null, "test", "test", "test", "test");
-
- CentralRole role = new CentralRole();
-
- centralUserApp.setUserId((long)1);
- centralUserApp.setApp(app);
- centralUserApp.setRole(role);
- centralUserApp.setPriority((short) 123);
-
- return centralUserApp;
- }
-
- @Test
- public void centralUserAppTest(){
- CentralUserApp centralUserApp = mockCentralUserApp();
-
- CentralApp app1 = new CentralApp((long)1, null, null, (long)1, (long)1, (long)1, "test", "test", "test", "test", "test", "test", "test", "test", "test",
- "test", "test", "test", "test", null, "test", "test", "test", "test");
-
- CentralRole role1 = new CentralRole();
-
- assertEquals(centralUserApp.getUserId(), new Long(1));
- assertEquals(centralUserApp.getPriority(), new Short((short) 123));
- assertEquals(centralUserApp.getApp(), app1);
- assertEquals(centralUserApp.getRole(), role1);
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.*;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.CentralRole;
-import org.openecomp.portalapp.portal.transport.CentralUser;
-import org.openecomp.portalapp.portal.transport.CentralUserApp;
-
-public class CentralUserTest {
-
- public CentralUser mockCentralUser(){
- Set<CentralUserApp> userApps = new HashSet<CentralUserApp>();
- Set<CentralRole> pseudoRoles = new HashSet<CentralRole>();
- CentralUser centralUser = new CentralUser((long)1, null, null, (long)1, (long)1, (long)1, (long)1,
- (long)1, "test", "test", "test", "test", "test",
- "test", "test", (long)1, "test", "test", "test",
- "test", "test", "test", "test", "test", "test", "test",
- "test", "test", "test", "test",
- "test", "test", "test", "test", "test",
- "test", "test", "test", "test", "test",
- "test", "test", "test", "test", null,
- false, false, (long)1, (long)1, false, "test", userApps, pseudoRoles);
-
- return centralUser;
- }
-
- @Test
- public void centralRoleTest(){
- CentralUser centralUser = mockCentralUser();
-
- Set<CentralUserApp> userApps = new HashSet<CentralUserApp>();
- Set<CentralRole> pseudoRoles = new HashSet<CentralRole>();
- CentralUser centralUser1 = new CentralUser((long)1, null, null, (long)1, (long)1, (long)1, (long)1,
- (long)1, "test", "test", "test", "test", "test",
- "test", "test", (long)1, "test", "test", "test",
- "test", "test", "test", "test", "test", "test", "test",
- "test", "test", "test", "test",
- "test", "test", "test", "test", "test",
- "test", "test", "test", "test", "test",
- "test", "test", "test", "test", null,
- false, false, (long)1, (long)1, false, "test", userApps, pseudoRoles);
-
-
- assertEquals(centralUser, centralUser1);
- assertEquals(centralUser.hashCode(), centralUser1.hashCode());
- assertTrue(centralUser.equals(centralUser1));
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.EPAppsManualPreference;
-
-public class EPAppsManualPreferenceTest {
-
- public EPAppsManualPreference mockEPAppsManualPreference(){
- EPAppsManualPreference epAppsManualPreference = new EPAppsManualPreference();
-
- epAppsManualPreference.setAppid((long)1);
- epAppsManualPreference.setCol(1);
- epAppsManualPreference.setHeaderText("test");
- epAppsManualPreference.setImageLink("test");
- epAppsManualPreference.setOrder(1);
- epAppsManualPreference.setRestrictedApp(false);
- epAppsManualPreference.setRow(1);
- epAppsManualPreference.setSizeX(1);
- epAppsManualPreference.setSizeY(1);
- epAppsManualPreference.setSubHeaderText("test");
- epAppsManualPreference.setUrl("test");
- epAppsManualPreference.setAddRemoveApps(false);
-
- return epAppsManualPreference;
- }
-
- @Test
- public void epAppsManualPreferenceTest(){
-
- EPAppsManualPreference epAppsManualPreference = mockEPAppsManualPreference();
-
- assertEquals(epAppsManualPreference.getAppid(), new Long(1));
- assertEquals(epAppsManualPreference.getCol(), 1);
- assertEquals(epAppsManualPreference.getHeaderText(), "test");
- assertEquals(epAppsManualPreference.getImageLink(), "test");
- assertEquals(epAppsManualPreference.getOrder(), 1);
- assertEquals(epAppsManualPreference.isRestrictedApp(), false);
- assertEquals(epAppsManualPreference.getRow(), 1);
- assertEquals(epAppsManualPreference.getSizeX(), 1);
- assertEquals(epAppsManualPreference.getSizeY(), 1);
- assertEquals(epAppsManualPreference.getSubHeaderText(), "test");
- assertEquals(epAppsManualPreference.getUrl(), "test");
- assertEquals(epAppsManualPreference.isAddRemoveApps(), false);
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.EPAppsSortPreference;
-
-public class EPAppsSortPreferenceTest {
-
- public EPAppsSortPreference mockEPAppsSortPreference(){
- EPAppsSortPreference epAppsSortPreference = new EPAppsSortPreference();
-
- epAppsSortPreference.setIndex(1);
- epAppsSortPreference.setValue("test");
- epAppsSortPreference.setTitle("test");
-
- return epAppsSortPreference;
- }
-
- @Test
- public void epAppsSortPreferenceTest(){
- EPAppsSortPreference epAppsSortPreference = mockEPAppsSortPreference();
-
- assertEquals(epAppsSortPreference.getIndex(), 1);
- assertEquals(epAppsSortPreference.getValue(), "test");
- assertEquals(epAppsSortPreference.getTitle(), "test");
-
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.EPDeleteAppsManualSortPref;
-
-public class EPDeleteAppsManualSortPrefTest {
-
- public EPDeleteAppsManualSortPref mockEPDeleteAppsManualSortPref(){
- EPDeleteAppsManualSortPref epDeleteAppsManualSortPref = new EPDeleteAppsManualSortPref();
-
- epDeleteAppsManualSortPref.setAppId((long)1);
- epDeleteAppsManualSortPref.setSelect(false);
- epDeleteAppsManualSortPref.setPending(false);
-
- return epDeleteAppsManualSortPref;
- }
-
- @Test
- public void epDeleteAppsManualSortPrefTest(){
- EPDeleteAppsManualSortPref epDeleteAppsManualSortPref = mockEPDeleteAppsManualSortPref();
-
- assertEquals(epDeleteAppsManualSortPref.getAppId(), new Long(1));
- assertEquals(epDeleteAppsManualSortPref.isSelect(), false);
- assertEquals(epDeleteAppsManualSortPref.isPending(), false);
-
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.EPUserAppCurrentRoles;
-
-public class EPUserAppCurrentRolesTest {
-
- public EPUserAppCurrentRoles mockEPUserAppCurrentRoles(){
- EPUserAppCurrentRoles epUserAppCurrentRoles = new EPUserAppCurrentRoles();
-
- epUserAppCurrentRoles.setRoleName("test");
- epUserAppCurrentRoles.setUserId((long)1);
- epUserAppCurrentRoles.setPriority("test");
- epUserAppCurrentRoles.setRoleId((long)1);
-
- return epUserAppCurrentRoles;
- }
-
- @Test
- public void epUserAppCurrentRolesTest(){
- EPUserAppCurrentRoles epUserAppCurrentRoles = mockEPUserAppCurrentRoles();
-
- EPUserAppCurrentRoles epUserAppCurrentRoles1 = new EPUserAppCurrentRoles();
-
- epUserAppCurrentRoles1.setRoleName("test");
- epUserAppCurrentRoles1.setUserId((long)1);
- epUserAppCurrentRoles1.setPriority("test");
- epUserAppCurrentRoles1.setRoleId((long)1);
-
- assertEquals(epUserAppCurrentRoles.getRoleName(), "test");
- assertEquals(epUserAppCurrentRoles.getUserId(), new Long(1));
- assertEquals(epUserAppCurrentRoles.getRoleId(), new Long(1));
- assertEquals(epUserAppCurrentRoles.getPriority(), "test");
- assertEquals(epUserAppCurrentRoles.hashCode(), epUserAppCurrentRoles1.hashCode());
- assertTrue(epUserAppCurrentRoles.equals(epUserAppCurrentRoles1));
-
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.EPWidgetsSortPreference;
-
-public class EPWidgetsSortPreferenceTest {
-
- public EPWidgetsSortPreference mockEPWidgetsSortPreference(){
- EPWidgetsSortPreference epWidgetsSortPreference = new EPWidgetsSortPreference();
-
- epWidgetsSortPreference.setSizeX(1);
- epWidgetsSortPreference.setSizeY(1);
- epWidgetsSortPreference.setHeaderText("test");
- epWidgetsSortPreference.setUrl("test");
- epWidgetsSortPreference.setWidgetid((long)1);
- epWidgetsSortPreference.setWidgetIdentifier("test");
- epWidgetsSortPreference.setRow(1);
- epWidgetsSortPreference.setCol(1);
-
- return epWidgetsSortPreference;
- }
-
- @Test
- public void epWidgetsSortPreferenceTest(){
- EPWidgetsSortPreference epWidgetsSortPreference = mockEPWidgetsSortPreference();
-
- assertEquals(epWidgetsSortPreference.getSizeX(), 1);
- assertEquals(epWidgetsSortPreference.getSizeY(), 1);
- assertEquals(epWidgetsSortPreference.getHeaderText(), "test");
- assertEquals(epWidgetsSortPreference.getUrl(), "test");
- assertEquals(epWidgetsSortPreference.getWidgetid(), new Long(1));
- assertEquals(epWidgetsSortPreference.getWidgetIdentifier(), "test");
- assertEquals(epWidgetsSortPreference.getRow(), 1);
- assertEquals(epWidgetsSortPreference.getRow(), 1);
-
- }
-
-
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.EcompUserAppRoles;
-
-public class EcompUserAppRolesTest {
-
- public EcompUserAppRoles mockEcompUserAppRoles(){
- EcompUserAppRoles ecompUserAppRoles = new EcompUserAppRoles();
-
- ecompUserAppRoles.setAppId("test");
- ecompUserAppRoles.setUserId((long)1);
- ecompUserAppRoles.setPriority("test");
- ecompUserAppRoles.setRoleId((long)1);
- ecompUserAppRoles.setRoleName("test");
-
- return ecompUserAppRoles;
- }
-
- @Test
- public void ecompUserAppRolesTest(){
-
- EcompUserAppRoles ecompUserAppRoles = mockEcompUserAppRoles();
-
- assertEquals(ecompUserAppRoles.getAppId(), "test");
- assertEquals(ecompUserAppRoles.getPriority(), "test");
- assertEquals(ecompUserAppRoles.getRoleName(), "test");
- assertEquals(ecompUserAppRoles.getUserId(), new Long(1));
- assertEquals(ecompUserAppRoles.getRoleId(), new Long(1));
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.EpNotificationItemExtVO;
-
-public class EpNotificationItemExtVOTest {
-
- public EpNotificationItemExtVO mockEpNotificationItemExtVO(){
- EpNotificationItemExtVO epNotificationItemExtVO = new EpNotificationItemExtVO();
-
- //epNotificationItemExtVO.setActiveYn("abc");
- epNotificationItemExtVO.setMsgHeader("test");
- epNotificationItemExtVO.setMsgDescription("test");
- epNotificationItemExtVO.setPriority(1);
- epNotificationItemExtVO.setCreatorId(1);
- epNotificationItemExtVO.setLoginId("test");
-
- return epNotificationItemExtVO;
- }
-
- @Test
- public void epNotificationItemExtVOTest(){
- EpNotificationItemExtVO epNotificationItemExtVO = mockEpNotificationItemExtVO();
-
- assertEquals(epNotificationItemExtVO.getMsgHeader(), "test");
- assertEquals(epNotificationItemExtVO.getMsgDescription(), "test");
- assertEquals(epNotificationItemExtVO.getPriority().toString(), "1");
- assertEquals(epNotificationItemExtVO.getCreatorId().toString(), "1");
- assertEquals(epNotificationItemExtVO.getLoginId(), "test");
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.EpNotificationItem;
-
-public class EpNotificationItemTest {
-
- public EpNotificationItem mockEpNotificationItem(){
- EpNotificationItem epNotificationItem = new EpNotificationItem();
-
- epNotificationItem.setNotificationId((long)1);
- epNotificationItem.setIsForOnlineUsers("test");
- epNotificationItem.setIsForAllRoles("test");
- epNotificationItem.setActiveYn("test");
- epNotificationItem.setMsgHeader("test");
- epNotificationItem.setMsgDescription("test");
- epNotificationItem.setMsgSource("test");
-
- epNotificationItem.setPriority((long)1);
- epNotificationItem.setCreatedId((long)1);
- epNotificationItem.setNotificationHyperlink("test");
-
- return epNotificationItem;
- }
-
- @Test
- public void epNotificationItemTest(){
- EpNotificationItem epNotificationItem = mockEpNotificationItem();
-
- EpNotificationItem epNotificationItem1 = new EpNotificationItem();
- epNotificationItem1.setNotificationId((long)1);
- epNotificationItem1.setIsForOnlineUsers("test");
- epNotificationItem1.setIsForAllRoles("test");
- epNotificationItem1.setActiveYn("test");
- epNotificationItem1.setMsgHeader("test");
- epNotificationItem1.setMsgDescription("test");
- epNotificationItem1.setMsgSource("test");
-
- epNotificationItem1.setPriority((long)1);
- epNotificationItem1.setCreatedId((long)1);
- epNotificationItem1.setNotificationHyperlink("test");
-
- assertEquals(epNotificationItem.getNotificationId(), new Long(1));
- assertEquals(epNotificationItem.getIsForOnlineUsers(), "test");
- assertEquals(epNotificationItem.getIsForAllRoles(), "test");
- assertEquals(epNotificationItem.getActiveYn(), "test");
- assertEquals(epNotificationItem.getMsgHeader(), "test");
- assertEquals(epNotificationItem.getMsgDescription(), "test");
- assertEquals(epNotificationItem.getMsgSource(), "test");
- assertEquals(epNotificationItem.getPriority(), new Long(1));
- assertEquals(epNotificationItem.getCreatedId(), new Long(1));
- assertEquals(epNotificationItem.getNotificationHyperlink(), "test");
-
- assertEquals(epNotificationItem.toString(), "EpNotificationItem [notificationId=1, isForOnlineUsers=test, isForAllRoles=test, activeYn=test, msgHeader=test, msgDescription=test, msgSource=test, startTime=null, endTime=null, priority=1, creatorId=null, createdDate=null, roles=null, roleIds=null]");
- assertEquals(epNotificationItem.hashCode(), epNotificationItem1.hashCode());
- assertTrue(epNotificationItem.equals(epNotificationItem1));
-
- }
-
-}
-
-
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.Date;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.EpNotificationItemVO;
-
-public class EpNotificationItemVOTest {
-
- public EpNotificationItemVO mockEpNotificationItemVO(){
- EpNotificationItemVO epNotificationItemVO = new EpNotificationItemVO();
-
- epNotificationItemVO.setNotificationId(1);
- epNotificationItemVO.setIsForOnlineUsers('a');
- epNotificationItemVO.setIsForAllRoles('a');
- epNotificationItemVO.setActiveYn('a');
- epNotificationItemVO.setMsgHeader("test");
- epNotificationItemVO.setMsgDescription("test");
- epNotificationItemVO.setMsgSource("test");
- epNotificationItemVO.setPriority(1);
- epNotificationItemVO.setCreatorId(1);
- epNotificationItemVO.setLoginId("test");
- epNotificationItemVO.setNotificationHyperlink("test");
-
- return epNotificationItemVO;
- }
-
- @Test
- public void epNotificationItemVOTest(){
- EpNotificationItemVO epNotificationItemVO = mockEpNotificationItemVO();
-
- assertEquals(epNotificationItemVO.getNotificationId().toString(), "1");
- /*assertEquals(epNotificationItemVO.getIsForOnlineUsers(), 'a');
- assertEquals(epNotificationItemVO.getIsForAllRoles(), 'a');
- assertEquals(epNotificationItemVO.getActiveYn(), 'a');*/
- assertEquals(epNotificationItemVO.getMsgHeader(), "test");
- assertEquals(epNotificationItemVO.getMsgDescription(), "test");
- assertEquals(epNotificationItemVO.getMsgSource(), "test");
- assertEquals(epNotificationItemVO.getPriority().toString(), "1");
- assertEquals(epNotificationItemVO.getCreatorId().toString(), "1");
- assertEquals(epNotificationItemVO.getLoginId(), "test");
- assertEquals(epNotificationItemVO.getNotificationHyperlink(), "test");
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.EpRoleNotificationItem;
-
-public class EpRoleNotificationItemTest {
-
- public EpRoleNotificationItem mockEpRoleNotificationItem(){
- EpRoleNotificationItem epRoleNotificationItem = new EpRoleNotificationItem();
-
- epRoleNotificationItem.setId((long)1);
- epRoleNotificationItem.setNotificationId((long)1);
- epRoleNotificationItem.setRoleId(1);
- epRoleNotificationItem.setRecvUserId(1);
-
- return epRoleNotificationItem;
- }
-
- @Test
- public void epRoleNotificationItemTest(){
- EpRoleNotificationItem epRoleNotificationItem = mockEpRoleNotificationItem();
-
- assertEquals(epRoleNotificationItem.getId(), new Long(1));
- assertEquals(epRoleNotificationItem.getNotificationId(), new Long(1));
- assertEquals(epRoleNotificationItem.getRoleId().toString(), "1");
- assertEquals(epRoleNotificationItem.getRecvUserId().toString(), "1");
- }
-
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.ExternalAccessPermsDetail;
-
-public class ExternalAccessPermsDetailTest {
-
- public ExternalAccessPermsDetail mockExternalAccessPermsDetail(){
- ExternalAccessPermsDetail externalAccessPermsDetail = new ExternalAccessPermsDetail();
-
- List<String> roles = new ArrayList<String>();
-
- externalAccessPermsDetail.setType("test");
- externalAccessPermsDetail.setInstance("test");
- externalAccessPermsDetail.setAction("test");
- externalAccessPermsDetail.setDescription("test");
- externalAccessPermsDetail.setRoles(roles);
-
- return externalAccessPermsDetail;
- }
-
- @Test
- public void externalAccessPermsDetailTest(){
- ExternalAccessPermsDetail externalAccessPermsDetail = mockExternalAccessPermsDetail();
-
- List<String> roles = new ArrayList<String>();
-
- assertEquals(externalAccessPermsDetail.getType(), "test");
- assertEquals(externalAccessPermsDetail.getInstance(), "test");
- assertEquals(externalAccessPermsDetail.getAction(), "test");
- assertEquals(externalAccessPermsDetail.getDescription(), "test");
- assertEquals(externalAccessPermsDetail.getRoles(), roles);
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.ExternalAccessPerms;
-
-public class ExternalAccessPermsTest {
-
- public ExternalAccessPerms mockExternalAccessPerms(){
- ExternalAccessPerms externalAccessPerms = new ExternalAccessPerms();
-
- externalAccessPerms.setType("test");
- externalAccessPerms.setInstance("test");
- externalAccessPerms.setAction("test");
- externalAccessPerms.setDescription("test");
-
- return externalAccessPerms;
- }
-
- @Test
- public void externalAccessPermsTest(){
- ExternalAccessPerms externalAccessPerms = mockExternalAccessPerms();
-
- ExternalAccessPerms externalAccessPerms1 = new ExternalAccessPerms("test", "test", "test");
- ExternalAccessPerms externalAccessPerms2 = new ExternalAccessPerms("test", "test", "test", "test");
- ExternalAccessPerms externalAccessPerms3 = new ExternalAccessPerms();
- externalAccessPerms3.setType("test");
- externalAccessPerms3.setInstance("test");
- externalAccessPerms3.setAction("test");
- externalAccessPerms3.setDescription("test");
-
- assertEquals(externalAccessPerms.getType(), "test");
- assertEquals(externalAccessPerms.getInstance(), "test");
- assertEquals(externalAccessPerms.getAction(), "test");
- assertEquals(externalAccessPerms.getDescription(), "test");
- assertEquals(externalAccessPerms.hashCode(), externalAccessPerms3.hashCode());
-
- assertTrue(externalAccessPerms1.equals(new ExternalAccessPerms("test", "test", "test")));
- assertTrue(externalAccessPerms2.equals(new ExternalAccessPerms("test", "test", "test", "test")));
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.ExternalAccessPerms;
-import org.openecomp.portalapp.portal.transport.ExternalAccessRolePerms;
-
-public class ExternalAccessRolePermsTest {
-
- public ExternalAccessRolePerms mockExternalAccessRolePerms(){
- ExternalAccessPerms externalAccessPerms = new ExternalAccessPerms();
- externalAccessPerms.setAction("test");
- externalAccessPerms.setDescription("test");
- externalAccessPerms.setInstance("test");
- externalAccessPerms.setType("test");
- ExternalAccessRolePerms ExternalAccessRolePerms = new ExternalAccessRolePerms(externalAccessPerms, "test");
-
- return ExternalAccessRolePerms;
- }
-
- @Test
- public void externalAccessRolePermsTest(){
- ExternalAccessPerms externalAccessPerms = new ExternalAccessPerms();
- externalAccessPerms.setAction("test");
- externalAccessPerms.setDescription("test");
- externalAccessPerms.setInstance("test");
- externalAccessPerms.setType("test");
-
- ExternalAccessRolePerms ExternalAccessRolePerms = mockExternalAccessRolePerms();
-
- assertEquals(ExternalAccessRolePerms.getRole(), "test");
- assertEquals(ExternalAccessRolePerms.getPerm(), externalAccessPerms);
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.ExternalAccessRole;
-
-public class ExternalAccessRoleTest {
-
- public ExternalAccessRole mockExternalAccessRole(){
- ExternalAccessRole externalAccessRole = new ExternalAccessRole();
-
- externalAccessRole.setName("test");
- externalAccessRole.setDescription("test");
-
- return externalAccessRole;
- }
-
- @Test
- public void externalAccessRoleTest(){
- ExternalAccessRole externalAccessRole = mockExternalAccessRole();
-
- assertEquals(externalAccessRole.getName(), "test");
- assertEquals(externalAccessRole.getDescription(), "test");
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.ExternalAccessUserRoleDetail;
-import org.openecomp.portalapp.portal.transport.ExternalRoleDescription;
-
-public class ExternalAccessUserRoleDetailTest {
-
- public ExternalAccessUserRoleDetail mockExternalAccessUserRoleDetail(){
-
- ExternalRoleDescription externalRoleDescription = new ExternalRoleDescription();
- externalRoleDescription.setId("test");
- externalRoleDescription.setName("test");
- externalRoleDescription.setActive("test");
- externalRoleDescription.setPriority("test");
- externalRoleDescription.setAppId("test");
- externalRoleDescription.setAppRoleId("test");
-
- ExternalAccessUserRoleDetail externalAccessUserRoleDetail = new ExternalAccessUserRoleDetail("test", externalRoleDescription);
-
- externalAccessUserRoleDetail.setName("test");
- externalAccessUserRoleDetail.setDescription(externalRoleDescription);
- return externalAccessUserRoleDetail;
- }
-
- @Test
- public void externalAccessUserRoleDetailTest(){
- ExternalAccessUserRoleDetail externalAccessUserRoleDetail = mockExternalAccessUserRoleDetail();
-
- ExternalRoleDescription externalRoleDescription1 = new ExternalRoleDescription();
- externalRoleDescription1.setId("test");
- externalRoleDescription1.setName("test");
- externalRoleDescription1.setActive("test");
- externalRoleDescription1.setPriority("test");
- externalRoleDescription1.setAppId("test");
- externalRoleDescription1.setAppRoleId("test");
-
- ExternalAccessUserRoleDetail externalAccessUserRoleDetail1 = new ExternalAccessUserRoleDetail("test", externalRoleDescription1);
-
- assertEquals(externalAccessUserRoleDetail.getName(), externalAccessUserRoleDetail1.getName());
- assertEquals(externalAccessUserRoleDetail.getDescription(), externalAccessUserRoleDetail1.getDescription());
- assertEquals(externalAccessUserRoleDetail.hashCode(), externalAccessUserRoleDetail1.hashCode());
- assertTrue(externalAccessUserRoleDetail.equals(externalAccessUserRoleDetail1));
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.ExternalAccessUser;
-
-public class ExternalAccessUserTest {
-
- public ExternalAccessUser mockExternalAccessUser(){
- ExternalAccessUser externalAccessUser = new ExternalAccessUser("test", "test");
-
- return externalAccessUser;
- }
-
- @Test
- public void externalAccessUserTest(){
- ExternalAccessUser externalAccessUser = mockExternalAccessUser();
-
- assertEquals(externalAccessUser.getRole(), "test");
- assertEquals(externalAccessUser.getUser(), "test");
-
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.ExternalRoleDescription;
-
-public class ExternalRoleDescriptionTest {
-
- public ExternalRoleDescription mockExternalRoleDescription(){
-
- ExternalRoleDescription externalRoleDescription = new ExternalRoleDescription();
-
- externalRoleDescription.setId("test");
- externalRoleDescription.setName("test");
- externalRoleDescription.setActive("test");
- externalRoleDescription.setPriority("test");
- externalRoleDescription.setAppId("test");
- externalRoleDescription.setAppRoleId("test");
-
- return externalRoleDescription;
- }
-
- @Test
- public void externalRoleDescriptionTest(){
- ExternalRoleDescription externalRoleDescription = mockExternalRoleDescription();
-
- assertEquals(externalRoleDescription.getId(), "test");
- assertEquals(externalRoleDescription.getName(), "test");
- assertEquals(externalRoleDescription.getActive(), "test");
- assertEquals(externalRoleDescription.getPriority(), "test");
- assertEquals(externalRoleDescription.getAppId(), "test");
- assertEquals(externalRoleDescription.getAppRoleId(), "test");
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuItem;
-
-public class FunctionalMenuItemTest {
-
- public FunctionalMenuItem mockFunctionalMenuItem(){
- FunctionalMenuItem functionalMenuItem = new FunctionalMenuItem();
-
- List<Integer> roles = new ArrayList<Integer>();
-
- functionalMenuItem.setRestrictedApp(false);
- functionalMenuItem.setUrl("test");
- functionalMenuItem.setRoles(roles);
-
- return functionalMenuItem;
- }
-
- @Test
- public void functionalMenuItemTest(){
- FunctionalMenuItem functionalMenuItem = mockFunctionalMenuItem();
-
- FunctionalMenuItem functionalMenuItem1 = mockFunctionalMenuItem();
-
- List<Integer> roles = new ArrayList<Integer>();
-
- functionalMenuItem1.setRestrictedApp(false);
- functionalMenuItem1.setUrl("test");
- functionalMenuItem1.setRoles(roles);
-
- assertEquals(functionalMenuItem.getRoles(), functionalMenuItem1.getRoles());
- assertEquals(functionalMenuItem.toString(), "FunctionalMenuItem [menuId=null, column=null, text=null, parentMenuId=null, url=test, active_yn=null, appid=null, roles=[], restrictedApp=false]");
- // assertTrue(functionalMenuItem.normalize(), functionalMenuItem1.normalize());
- }
-
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuRole;
-
-public class FunctionalMenuRoleTest {
-
- public FunctionalMenuRole mockFunctionalMenuRole(){
- FunctionalMenuRole functionalMenuRole = new FunctionalMenuRole();
-
- functionalMenuRole.setId(1);
- functionalMenuRole.setMenuId((long)1);
- functionalMenuRole.setAppId(1);
- functionalMenuRole.setRoleId(1);
-
- return functionalMenuRole;
- }
-
- @Test
- public void functionalMenuRoleTest(){
- FunctionalMenuRole functionalMenuRole = mockFunctionalMenuRole();
-
- FunctionalMenuRole functionalMenuRole1 = new FunctionalMenuRole();
- functionalMenuRole1.setId(1);
- functionalMenuRole1.setMenuId((long)1);
- functionalMenuRole1.setAppId(1);
- functionalMenuRole1.setRoleId(1);
-
- assertEquals(functionalMenuRole.getId().toString(), "1");
- assertEquals(functionalMenuRole.getMenuId(), new Long(1));
- assertEquals(functionalMenuRole.getAppId().toString(), "1");
- assertEquals(functionalMenuRole.getRoleId().toString(), "1");
- assertEquals(functionalMenuRole.toString(), "FunctionalMenuRole [id=1, menuId=1, appId=1, roleId=1]");
- assertTrue(functionalMenuRole.equals(functionalMenuRole1));
- assertEquals(functionalMenuRole.hashCode(), functionalMenuRole1.hashCode());
-
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.RemoteRole;
-import org.openecomp.portalapp.portal.transport.RemoteUserWithRoles;
-
-public class RemoteUserWithRolesTest {
-
- public RemoteUserWithRoles mockRemoteUserWithRoles(){
- RemoteUserWithRoles remoteUserWithRoles = new RemoteUserWithRoles();
-
- List<RemoteRole> roles = new ArrayList<RemoteRole>();
- RemoteRole remoteRole = new RemoteRole();
- remoteRole.setId((long)1);
- remoteRole.setName("test");
- roles.add(remoteRole);
-
- remoteUserWithRoles.setOrgId((long)1);
- remoteUserWithRoles.setManagerId((long)1);
- remoteUserWithRoles.setFirstName("test");
- remoteUserWithRoles.setMiddleInitial("test");
- remoteUserWithRoles.setLastName("test");
- remoteUserWithRoles.setPhone("test");
- remoteUserWithRoles.setEmail("test");
- remoteUserWithRoles.setHrid("test");
- remoteUserWithRoles.setOrgUserId("test");
- remoteUserWithRoles.setOrgCode("test");
- remoteUserWithRoles.setOrgManagerUserId("test");
- remoteUserWithRoles.setJobTitle("test");
- remoteUserWithRoles.setLoginId("test");
- remoteUserWithRoles.setActive(false);
- remoteUserWithRoles.setRoles(roles);
-
- return remoteUserWithRoles;
- }
-
- @Test
- public void remoteUserWithRolesTest(){
- RemoteUserWithRoles remoteUserWithRoles = mockRemoteUserWithRoles();
-
- assertEquals(remoteUserWithRoles.getOrgId(), new Long(1));
- assertEquals(remoteUserWithRoles.getManagerId(), new Long(1));
- assertEquals(remoteUserWithRoles.getFirstName(), "test");
- assertEquals(remoteUserWithRoles.getMiddleInitial(), "test");
- assertEquals(remoteUserWithRoles.getLastName(), "test");
- assertEquals(remoteUserWithRoles.getPhone(), "test");
- assertEquals(remoteUserWithRoles.getEmail(), "test");
- assertEquals(remoteUserWithRoles.getHrid(), "test");
- assertEquals(remoteUserWithRoles.getOrgUserId(), "test");
- assertEquals(remoteUserWithRoles.getOrgCode(), "test");
- assertEquals(remoteUserWithRoles.getOrgManagerUserId(), "test");
- assertEquals(remoteUserWithRoles.getJobTitle(), "test");
- assertEquals(remoteUserWithRoles.getLoginId(), "test");
- assertEquals(remoteUserWithRoles.getActive(), false);
- assertEquals(remoteUserWithRoles.getRoles().size(), 1);
- assertEquals(remoteUserWithRoles.toString(), "RemoteUserWithRoles [orgId=1, managerId=1, firstName=test, middleInitial=test, lastName=test, phone=test, "
- + "email=test, hrid=test, orgUserId=test, orgCode=test, orgManagerUserId=test, jobTitle=test, loginId=test, active=false, roles=[RemoteRole [id=1, name=test]]]");
-
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.RoleInAppForUser;
-
-public class RoleInAppForUserTest {
-
- public RoleInAppForUser mockRoleInAppForUser(){
- RoleInAppForUser roleInAppForUser = new RoleInAppForUser((long)1 , "test");
- roleInAppForUser.setRoleId((long)1);
- roleInAppForUser.setRoleName("test");
- roleInAppForUser.setIsApplied(false);
-
- return roleInAppForUser;
- }
-
- @Test
- public void roleInAppForUserTest(){
- RoleInAppForUser roleInAppForUser = mockRoleInAppForUser();
-
- RoleInAppForUser roleInAppForUser1 = new RoleInAppForUser((long)1 , "test");
- roleInAppForUser1.setRoleId((long)1);
- roleInAppForUser1.setRoleName("test");
- roleInAppForUser1.setIsApplied(false);
-
- assertEquals(roleInAppForUser.getRoleId(), new Long(1));
- assertEquals(roleInAppForUser.getRoleName(), "test");
- assertEquals(roleInAppForUser.getIsApplied(), false);
-
- assertEquals(roleInAppForUser.toString(), "RoleInAppForUser [roleId=1, roleName=test, isApplied=false]");
- assertTrue(roleInAppForUser.equals(roleInAppForUser1));
- assertEquals(roleInAppForUser.hashCode(), roleInAppForUser1.hashCode());
- //constructor
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.RemoteRole;
-import org.openecomp.portalapp.portal.transport.UserApplicationRoles;
-
-public class UserApplicationRolesTest {
-
- public UserApplicationRoles mockUserApplicationRoles(){
- UserApplicationRoles userApplicationRoles = new UserApplicationRoles();
-
- List<RemoteRole> roles = new ArrayList<RemoteRole>();
- RemoteRole remoteRole = new RemoteRole();
- remoteRole.setId((long)1);
- remoteRole.setName("test");
- roles.add(remoteRole);
-
- userApplicationRoles.setAppId((long)1);
- userApplicationRoles.setOrgUserId("test");
- userApplicationRoles.setFirstName("test");
- userApplicationRoles.setLastName("test");
- userApplicationRoles.setRoles(roles);
-
- return userApplicationRoles;
- }
-
- @Test
- public void userApplicationRolesTest(){
- UserApplicationRoles userApplicationRoles = mockUserApplicationRoles();
-
- UserApplicationRoles userApplicationRoles1 = new UserApplicationRoles();
-
- List<RemoteRole> roles = new ArrayList<RemoteRole>();
- RemoteRole remoteRole = new RemoteRole();
- remoteRole.setId((long)1);
- remoteRole.setName("test");
- roles.add(remoteRole);
-
- userApplicationRoles1.setAppId((long)1);
- userApplicationRoles1.setOrgUserId("test");
- userApplicationRoles1.setFirstName("test");
- userApplicationRoles1.setLastName("test");
- userApplicationRoles1.setRoles(roles);
-
- assertEquals(userApplicationRoles.getAppId(), userApplicationRoles1.getAppId());
- assertEquals(userApplicationRoles.getOrgUserId(), userApplicationRoles1.getOrgUserId());
- assertEquals(userApplicationRoles.getFirstName(), userApplicationRoles1.getFirstName());
- assertEquals(userApplicationRoles.getLastName(), userApplicationRoles1.getLastName());
- assertEquals(userApplicationRoles.getRoles(), userApplicationRoles1.getRoles());
-
-
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.UserWithNameSurnameTitle;
-
-public class UserWithNameSurnameTitleTest {
-
- @Test
- public void userWithNameSurnameTitleTest(){
-
- UserWithNameSurnameTitle userWithNameSurnameTitle = new UserWithNameSurnameTitle("test", "test", "test", "test");
-
- assertEquals(userWithNameSurnameTitle, new UserWithNameSurnameTitle("test", "test", "test", "test"));
- assertEquals(userWithNameSurnameTitle.hashCode(), new UserWithNameSurnameTitle("test", "test", "test", "test").hashCode());
- assertTrue(userWithNameSurnameTitle.equals(new UserWithNameSurnameTitle("test", "test", "test", "test")));
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.WidgetCatalogPersonalization;
-
-public class WidgetCatalogPersonalizationTest {
-
- public WidgetCatalogPersonalization mockWidgetCatalogPersonalization(){
- WidgetCatalogPersonalization widgetCatalogPersonalization = new WidgetCatalogPersonalization();
-
- widgetCatalogPersonalization.setWidgetId((long)1);
- widgetCatalogPersonalization.setSelect(false);
- return widgetCatalogPersonalization;
- }
-
- @Test
- public void widgetCatalogPersonalizationTest(){
- WidgetCatalogPersonalization widgetCatalogPersonalization = mockWidgetCatalogPersonalization();
-
- assertEquals(widgetCatalogPersonalization.getWidgetId(), new Long(1));
- assertEquals(widgetCatalogPersonalization.getSelect(), false);
- }
-}
+++ /dev/null
-package org.openecomp.portalapp.test.exceptions;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.exceptions.NoHealthyServiceException;
-
-public class NoHealthyServiceExceptionTest {
-
- public NoHealthyServiceException mockNoHealthyServiceException(){
- NoHealthyServiceException noHealthyServiceException = new NoHealthyServiceException("test");
-
- return noHealthyServiceException;
- }
-
- @Test
- public void noHealthyServiceExceptionTest(){
- NoHealthyServiceException noHealthyServiceException = mockNoHealthyServiceException();
-
- // assertEquals(noHealthyServiceException, new NoHealthyServiceException("test"));
- assertEquals(noHealthyServiceException.toString(), "NoHealthyServiceException [] test");
- }
-}
+++ /dev/null
-/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ================================================================================
- */
-package org.openecomp.portalapp.test.framework;
-
-import java.io.IOException;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.openecomp.portalsdk.core.conf.AppConfig;
-//import org.openecomp.portalapp.conf.ExternalAppConfig;
-//import org.openecomp.portalapp.conf.HibernateMappingLocations;
-import org.openecomp.portalsdk.core.conf.HibernateConfiguration;
-import org.openecomp.portalsdk.core.conf.HibernateMappingLocatable;
-import org.openecomp.portalsdk.core.objectcache.AbstractCacheManager;
-import org.openecomp.portalsdk.core.util.CacheManager;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.FilterType;
-import org.springframework.context.annotation.Profile;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-import org.springframework.test.context.ActiveProfiles;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.test.context.transaction.TransactionConfiguration;
-import org.springframework.test.context.web.AnnotationConfigWebContextLoader;
-import org.springframework.test.context.web.WebAppConfiguration;
-import org.springframework.test.web.servlet.MockMvc;
-import org.springframework.test.web.servlet.setup.MockMvcBuilders;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.context.WebApplicationContext;
-import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
-
-/**
- *
- * In order to write a unit test, 1. inherit this class 2. place the "war"
- * folder on your test class's classpath 3. run the test with the following VM
- * argument; This is important because when starting the application from
- * Container, the System Properties file (SystemProperties.java) can have the
- * direct path but, when running from the Mock Junit container, the path should
- * be prefixed with "classpath" to enable the mock container to search for the
- * file in the classpath -Dcontainer.classpath="classpath:"
- */
-
-@SuppressWarnings("deprecation")
-@RunWith(SpringJUnit4ClassRunner.class)
-@WebAppConfiguration
-@ContextConfiguration(loader = AnnotationConfigWebContextLoader.class, classes = { MockAppConfig.class })
-@ActiveProfiles(value = "test")
-public class ApplicationCommonContextTestSuite {
-
- @Autowired
- public WebApplicationContext wac;
-
- private MockMvc mockMvc;
-
- @Before
- public void setup() {
- if (mockMvc == null) {
- this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
-
- }
- }
-
- public Object getBean(String name) {
- return this.wac.getBean(name);
- }
-
- public MockMvc getMockMvc() {
- return mockMvc;
- }
-
- public void setMockMvc(MockMvc mockMvc) {
- this.mockMvc = mockMvc;
- }
-
- public WebApplicationContext getWebApplicationContext() {
- return wac;
- }
-
-}
-
-@Configuration
-@ComponentScan(basePackages = "org.openecomp", excludeFilters = {
- // the following source configurations should not be scanned; instead of
- // using Exclusion filter, we can use the @Profile annotation to exclude
- // them
- @ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.openecomp.portalsdk.core.controller.LogoutController*"),
- @ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.openecomp.portalsdk.core.controller.SDKLoginController*"),
- @ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.openecomp.portalapp.conf.ExternalAppConfig*"),
- @ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.openecomp.*.*InitUebHandler*") })
-@Profile("test")
-class MockAppConfig extends AppConfig {
-
- @Bean
- HibernateMappingLocatable locatable() {
- return new MockHibernateMappingLocations();
- }
-
- @Bean
- HibernateConfiguration hibConfiguration() {
- return new HibernateConfiguration();
- }
-
- @Bean
- public SystemProperties systemProperties() {
- return new MockSystemProperties();
- }
-
- @Bean
- public AbstractCacheManager cacheManager() {
- return new CacheManager() {
-
- public void configure() throws IOException {
-
- }
- };
- }
-
- public String[] tileDefinitions() {
- return new String[] { "classpath:/WEB-INF/fusion/defs/definitions.xml",
- "classpath:/WEB-INF/defs/definitions.xml" };
- }
-
- public void addInterceptors(InterceptorRegistry registry) {
- // registry.addInterceptor(new
- // SessionTimeoutInterceptor()).excludePathPatterns(getExcludeUrlPathsForSessionTimeout());
- // registry.addInterceptor(resourceInterceptor());
- }
-
- public static class MockSystemProperties extends SystemProperties {
-
- public MockSystemProperties() {
- }
-
- }
-
-}
-
-@Profile("test")
-class MockHibernateMappingLocations implements HibernateMappingLocatable {
-
- public Resource[] getMappingLocations() {
- return new Resource[] { new ClassPathResource("WEB-INF/fusion/orm/Fusion.hbm.xml"),
- new ClassPathResource("WEB-INF/fusion/orm/EP.hbm.xml"),
- new ClassPathResource("WEB-INF/fusion/orm/Workflow.hbm.xml") };
-
- }
-
- public String[] getPackagesToScan() {
- return new String[] { "org.openecomp", "src" };
- }
-
-}
+++ /dev/null
-/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ================================================================================
- */
-package org.openecomp.portalapp.test.framework;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletRequestWrapper;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import org.junit.runner.RunWith;
-import org.mockito.Mockito;
-import org.mockito.runners.MockitoJUnitRunner;
-
-@RunWith(MockitoJUnitRunner.class)
-public class MockitoTestSuite {
-
-
- public MockHttpServletRequestWrapper mockedRequest = new MockHttpServletRequestWrapper(
- Mockito.mock(HttpServletRequest.class));
- public HttpServletResponse mockedResponse = Mockito.mock(HttpServletResponse.class);
-
- public MockHttpServletRequestWrapper getMockedRequest() {
- return mockedRequest;
- }
-
- public HttpServletResponse getMockedResponse() {
- return mockedResponse;
- }
-
- public class MockHttpServletRequestWrapper extends HttpServletRequestWrapper {
-
- HttpSession session = Mockito.mock(HttpSession.class);
-
- public MockHttpServletRequestWrapper(HttpServletRequest request) {
- super(request);
-
- }
-
- @Override
- public HttpSession getSession() {
-
- return session;
- }
-
- @Override
- public HttpSession getSession(boolean create) {
-
- return session;
- }
-
- }
-
-}
+++ /dev/null
----
--- ================================================================================
--- ECOMP Portal
--- ================================================================================
--- Copyright (C) 2017 AT&T Intellectual Property
--- ================================================================================
--- 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.
--- See the License for the specific language governing permissions and
--- limitations under the License.
--- ================================================================================
----
-insert into fn_user values(-1,null,null,'test',null,'test',null,null,null,null,null,null,null,'guestT',null,null,null,null,true,null,null,null,null,false,null,null,null,
-null,null,null,null,null,null,null,null,null,null,null,null,null,null,null);
-insert into fn_user_role values(-1,1, null,1);
-insert into fn_user_role values(-1,16, null,1);
-insert into fn_user_role values(-1,999, null,1);
-insert into fn_user_role values(-1,1010, null,1);
-insert into fn_menu_functional values(-1,3,'Network Analytics',5,'http://test.portal.onap.org:8080/welcome.htm','Y',null);
-insert into fn_menu_functional_roles values(-1, 137,456, 6214);
-insert into fn_menu_favorites values(-1, 141);
-insert into ep_web_analytics_source values(-1,1,'test_url','test');
-INSERT INTO ep_notification (notification_ID, is_for_online_users, is_for_all_roles, active_YN, msg_header, msg_description,msg_source,start_time,end_time,priority,creator_ID,created_date)
-VALUES ('-1', 'Y', 'N', 'Y', 'CISCO_1921C1_ISR_G2', '{}','aotstm','2017-03-26 12:18:55.0','2017-04-25 12:18:55.0','2',NULL,'2017-04-25 21:18:11.0');
-INSERT INTO ep_role_notification (ID,notification_ID,role_ID,recv_user_id ) VALUES (0,-1,NULL,10)
+++ /dev/null
----
--- ================================================================================
--- ECOMP Portal
--- ================================================================================
--- Copyright (C) 2017 AT&T Intellectual Property
--- ================================================================================
--- 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.
--- See the License for the specific language governing permissions and
--- limitations under the License.
--- ================================================================================
----
-delete from fn_user_role where user_id =-1;
-delete from ep_user_notification where user_id=-1;
-delete from fn_audit_log where user_id=-1;
-delete from fn_menu_favorites where user_id=-1 and menu_id=141;
-delete from fn_user where user_id=-1;
-delete from fn_menu_functional_roles where id=-1;
-delete from fn_menu_functional_ancestors where menu_id=-1;
-delete from fn_menu_functional where menu_id=-1;
-delete from fn_menu_favorites where user_id=-1 and menu_id=141;
-delete from ep_web_analytics_source where resource_id=-1;
-delete from ep_role_notification where notification_ID='-1';
-delete from ep_notification where notification_ID='-1';
.classpath
.project
.settings/
+/logs
+/debug-logs
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
- <groupId>org.onap.portal</groupId>
+ <parent>
+ <groupId>org.onap.portal</groupId>
+ <artifactId>onap-portal-parent</artifactId>
+ <version>1.3.0-SNAPSHOT</version>
+ </parent>
+
<artifactId>ecompportal-be-common</artifactId>
<packaging>war</packaging>
- <!-- Version number is managed manually; no Jenkins build.number -->
- <version>1.3.0-SNAPSHOT</version>
<properties>
- <springframework.version>4.2.0.RELEASE</springframework.version>
- <hibernate.version>4.3.11.Final</hibernate.version>
- <eelf.version>1.0.0</eelf.version>
- <fasterxml.version>2.7.4</fasterxml.version>
- <epsdk.version>1.3.0</epsdk.version>
- <encoding>UTF-8</encoding>
- <!-- Tests usually require some setup that maven cannot do, so skip. -->
<skipTests>false</skipTests>
- <nexusproxy>https://nexus.onap.org</nexusproxy>
- <snapshotNexusPath>/content/repositories/snapshots/</snapshotNexusPath>
- <stagingNexusPath>content/repositories/staging/</stagingNexusPath>
- <releaseNexusPath>/content/repositories/releases/</releaseNexusPath>
</properties>
- <repositories>
- <repository>
- <id>onap-releases</id>
- <name>ONAP - Release Repository</name>
- <url>${nexusproxy}/${releaseNexusPath}</url>
- </repository>
- <repository>
- <id>onap-staging</id>
- <name>ONAP - Staging Repository</name>
- <url>${nexusproxy}/${stagingNexusPath}</url>
- </repository>
- <repository>
- <id>onap-snapshots</id>
- <name>ONAP - Snapshot Repository</name>
- <url>${nexusproxy}/${snapshotNexusPath}</url>
- </repository>
- </repositories>
-
- <profiles>
- <!-- disable doclint, a new feature in Java 8, when generating javadoc -->
- <profile>
- <id>doclint-java8-disable</id>
- <activation>
- <jdk>[1.8,)</jdk>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <additionalparam>-Xdoclint:none</additionalparam>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- </profiles>
-
<build>
<!-- The war file name carries no version number -->
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
- <groupId>org.jacoco</groupId>
- <artifactId>jacoco-maven-plugin</artifactId>
- <version>0.7.6.201602180812</version>
- <inherited>True</inherited>
- <executions>
- <!-- Unit-Tests -->
- <execution>
- <id>prepare-agent</id>
- <goals>
- <goal>prepare-agent</goal>
- </goals>
- <configuration>
- <destFile>${sonar.jacoco.reportPath}</destFile>
- </configuration>
- </execution>
- <execution>
- <id>report</id>
- <goals>
- <goal>report</goal>
- </goals>
- <configuration>
- <dataFile>${sonar.jacoco.reportPath}</dataFile>
- <outputDirectory>${project.basedir}/target/site/jacoco</outputDirectory>
- </configuration>
- </execution>
- <!-- Will see build errors while running the test cases because of dual
- instrumentation -->
- <execution>
- <id>default-instrument</id>
- <goals>
- <goal>instrument</goal>
- </goals>
- </execution>
- <execution>
- <id>default-restore-instrumented-classes</id>
- <goals>
- <goal>restore-instrumented-classes</goal>
- </goals>
- </execution>
- <!-- Integration Tests (Only report goal) -->
- <execution>
- <id>report-integration</id>
- <goals>
- <goal>report-integration</goal>
- </goals>
- <configuration>
- <dataFile>${sonar.jacoco.itReportPath}</dataFile>
- <outputDirectory>${project.basedir}/target/site/it-jacoco</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.1</version>
- <configuration>
- <source>1.8</source>
- <target>1.8</target>
- </configuration>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <version>0.7.6.201602180812</version>
+ <inherited>True</inherited>
+ <executions>
+ <!-- Unit-Tests -->
+ <execution>
+ <id>prepare-agent</id>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ <configuration>
+ <skipTests>false</skipTests>
+ <destFile>${sonar.jacoco.reportPath}</destFile>
+ </configuration>
+ </execution>
+ <execution>
+ <id>default-instrument</id>
+ <goals>
+ <goal>instrument</goal>
+ </goals>
+ <configuration>
+ <skipTests>false</skipTests>
+ </configuration>
+ </execution>
+ <execution>
+ <id>default-restore-instrumented-classes</id>
+ <phase>test</phase>
+ <goals>
+ <goal>restore-instrumented-classes</goal>
+ </goals>
+ <configuration>
+ <skipTests>false</skipTests>
+ </configuration>
+ </execution>
+ <execution>
+ <id>post-unit-test</id>
+ <phase>test</phase>
+ <goals>
+ <goal>report</goal>
+ </goals>
+ <configuration>
+ <skipTests>false</skipTests>
+ <dataFile>${sonar.jacoco.reportPath}</dataFile>
+ <outputDirectory>${project.basedir}/target/site/jacoco</outputDirectory>
+ </configuration>
+ </execution>
+ <execution>
+ <id>report-integration</id>
+ <phase>test</phase>
+ <goals>
+ <goal>report-integration</goal>
+ </goals>
+ <configuration>
+ <skipTests>false</skipTests>
+ <dataFile>${sonar.jacoco.itReportPath}</dataFile>
+ <outputDirectory>${project.basedir}/target/site/it-jacoco</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
</plugin>
<!-- Generate javadoc jar; see profile for Java 8 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
- <version>2.10.3</version>
+ <version>3.0.0-M1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
</configuration>
</plugin>
-
+
<!-- No deployment step for this project -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
</exclusion>
</exclusions>
</dependency>
-
<!-- Hibernate -->
<dependency>
</dependency>
<!-- Oracle JDBC driver -->
-<!-- <dependency>
- <groupId>com.oracle</groupId>
- <artifactId>ojdbc6</artifactId>
- <version>11.2.0.4</version>
- </dependency> -->
+ <!-- <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc6</artifactId>
+ <version>11.2.0.4</version> </dependency> -->
<!-- Apache Tiles -->
<dependency>
<groupId>org.apache.tiles</groupId>
<version>1.8.5</version>
</dependency>
<dependency>
- <groupId>org.jacoco</groupId>
- <artifactId>jacoco-maven-plugin</artifactId>
- <version>0.7.6.201602180812</version>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <version>0.7.6.201602180812</version>
</dependency>
<dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
- <version>2.5.0</version>
+ <version>2.7.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
- <version>2.5.0</version>
+ <version>2.7.0</version>
</dependency>
-
+
<!-- Schedulers required Libraries -->
-
- <dependency>
- <groupId>com.googlecode.json-simple</groupId>
- <artifactId>json-simple</artifactId>
- <version>1.1.1</version>
- </dependency>
- <dependency>
- <groupId>org.glassfish.jersey.core</groupId>
- <artifactId>jersey-client</artifactId>
- <version>2.23.1</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.jaxrs</groupId>
- <artifactId>jackson-jaxrs-json-provider</artifactId>
- <version>2.6.3</version>
- </dependency>
- <dependency>
- <groupId>org.glassfish.jersey.connectors</groupId>
- <artifactId>jersey-jetty-connector</artifactId>
- <version>2.23.1</version>
- </dependency>
+
+ <dependency>
+ <groupId>com.googlecode.json-simple</groupId>
+ <artifactId>json-simple</artifactId>
+ <version>1.1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.core</groupId>
+ <artifactId>jersey-client</artifactId>
+ <version>2.23.1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.jaxrs</groupId>
+ <artifactId>jackson-jaxrs-json-provider</artifactId>
+ <version>2.6.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.jersey.connectors</groupId>
+ <artifactId>jersey-jetty-connector</artifactId>
+ <version>2.23.1</version>
+ </dependency>
</dependencies>
-
<!-- No deployment descriptor. -->
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package jarutil;
import java.io.Reader;
import java.io.Writer;
import java.net.URL;
-import java.util.ArrayList;
import java.util.jar.JarEntry;
import java.util.jar.JarInputStream;
public class ExtractJar {
- /**
- * @param args
- */
-
public static int bufferSize = 8192;
public static String JARFILE = "raptor_upgrade.jar";
-
+
public static void main(String[] args) throws Exception {
- if(args.length > 0 && args[0]!=null && args[0].length()>0)
+ if (args.length > 0 && args[0] != null && args[0].length() > 0)
extractFilesFromJar(args[0]);
else {
System.out.println("Current Directory is taken as webapp path");
extractFilesFromJar(currentDir);
}
}
-
- public static void readJar(File jarFile) throws Exception{
- JarInputStream in = new JarInputStream(new FileInputStream(jarFile));
- ArrayList entries = new ArrayList( );
- JarEntry je;
- while((je=in.getNextJarEntry( ))!=null){
- if( je.isDirectory() == false ) {
- if(je.getName().startsWith("att/raptor/config/")) {
- //while((je=in.getNextJarEntry( ))!=null) {
- System.out.println(je.getName() + " " + je.getTime());
- //}
-
- }
- }
- }
- in.close( );
- }
-
- public static void extractFilesFromJar(String directory) throws IOException{
- //JarFile jar = new JarFile(jarFile);
- Class clazz = ExtractJar.class;
+
+ public static void readJar(File jarFile) throws Exception {
+ JarInputStream in = new JarInputStream(new FileInputStream(jarFile));
+ JarEntry je;
+ while ((je = in.getNextJarEntry()) != null) {
+ if (je.isDirectory() == false) {
+ if (je.getName().startsWith("att/raptor/config/")) {
+ // while((je=in.getNextJarEntry( ))!=null) {
+ System.out.println(je.getName() + " " + je.getTime());
+ // }
+
+ }
+ }
+ }
+ in.close();
+ }
+
+ public static void extractFilesFromJar(String directory) throws IOException {
+ // JarFile jar = new JarFile(jarFile);
+ Class clazz = ExtractJar.class;
String classContainer = clazz.getProtectionDomain().getCodeSource().getLocation().toString();
- //System.out.println("classContainer ---------> " + classContainer);
- URL jarUrl = clazz.getProtectionDomain().getCodeSource().getLocation();
-
- JarInputStream entryStream = new JarInputStream(jarUrl.openStream());
- JarEntry entry;
- while(true) {
- entry = entryStream.getNextJarEntry();
- if(entry == null)
- break;
- if(entry.getName().indexOf("jarutil") < 0) {
- System.out.println(entry.getName());
- File file=new File(directory,entry.getName());
- if(entry.isDirectory()) {
- if (!file.exists())
- file.mkdirs();
- } else {
- // make directory (some jars don't list dirs)
- File dir = new File(file.getParent());
- if (!dir.exists())
- dir.mkdirs();
- if(file.exists()) file.delete();
- // Make file
- FileOutputStream fout = new FileOutputStream(file);
- copy(entryStream,fout);
- fout.close();
-
- // touch the file.
- if (entry.getTime()>=0)
- file.setLastModified(entry.getTime());
- }
-
- }
- entryStream.closeEntry();
- }
- entryStream.close();
- System.out.println("************************************************");
- System.out.println("* *");
- System.out.println("* *");
- System.out.println("* RAPTOR SETUP COMPLETE. *");
- System.out.println("* *");
- System.out.println("* Thank you for upgrading. *");
- System.out.println("* *");
- System.out.println("************************************************");
- }
-
-
- public static void copy(InputStream in, OutputStream out, long byteCount)
- throws IOException {
- byte buffer[] = new byte[bufferSize];
- int len=bufferSize;
- if (byteCount>=0) {
- while (byteCount>0) {
- if (byteCount<bufferSize)
- len=in.read(buffer,0,(int)byteCount);
- else
- len=in.read(buffer,0,bufferSize);
- if (len==-1)
- break;
-
- byteCount -= len;
- out.write(buffer,0,len);
- }
- } else {
- while (true) {
- len=in.read(buffer,0,bufferSize);
- if (len<0 )
- break;
- out.write(buffer,0,len);
- }
- }
- }
-
-/* ------------------------------------------------------------------- */
-/** Copy Reader to Writer for byteCount bytes or until EOF or exception.
-*/
- public static void copy(Reader in, Writer out, long byteCount)
- throws IOException {
- char buffer[] = new char[bufferSize];
- int len=bufferSize;
- if (byteCount>=0) {
- while (byteCount>0) {
- if (byteCount<bufferSize)
- len=in.read(buffer,0,(int)byteCount);
- else
- len=in.read(buffer,0,bufferSize);
-
- if (len==-1)
- break;
- byteCount -= len;
- out.write(buffer,0,len);
- }
- } else {
- while (true) {
- len=in.read(buffer,0,bufferSize);
- if (len==-1)
- break;
- out.write(buffer,0,len);
- }
- }
- }
-
- /* ------------------------------------------------------------------- */
- /** Copy Stream in to Stream out until EOF or exception.
- */
- public static void copy(InputStream in, OutputStream out)
- throws IOException
- {
- copy(in,out,-1);
- }
-
- // Deletes all files and subdirectories under dir.
- // Returns true if all deletions were successful.
- // If a deletion fails, the method stops attempting to delete and returns false.
- public static boolean deleteDir(File dir) {
- if (dir.isDirectory()) {
- String[] children = dir.list();
- for (int i=0; i<children.length; i++) {
- boolean success = deleteDir(new File(dir, children[i]));
- if (!success) {
- return false;
- }
- }
- }
-
- // The directory is now empty so delete it
- return dir.delete();
- }
-
-
+ // System.out.println("classContainer ---------> " + classContainer);
+ URL jarUrl = clazz.getProtectionDomain().getCodeSource().getLocation();
+
+ JarInputStream entryStream = new JarInputStream(jarUrl.openStream());
+ JarEntry entry;
+ while (true) {
+ entry = entryStream.getNextJarEntry();
+ if (entry == null)
+ break;
+ if (entry.getName().indexOf("jarutil") < 0) {
+ System.out.println(entry.getName());
+ File file = new File(directory, entry.getName());
+ if (entry.isDirectory()) {
+ if (!file.exists())
+ file.mkdirs();
+ } else {
+ // make directory (some jars don't list dirs)
+ File dir = new File(file.getParent());
+ if (!dir.exists())
+ dir.mkdirs();
+ if (file.exists())
+ file.delete();
+ // Make file
+ FileOutputStream fout = new FileOutputStream(file);
+ copy(entryStream, fout);
+ fout.close();
+
+ // touch the file.
+ if (entry.getTime() >= 0)
+ file.setLastModified(entry.getTime());
+ }
+
+ }
+ entryStream.closeEntry();
+ }
+ entryStream.close();
+ System.out.println("************************************************");
+ System.out.println("* *");
+ System.out.println("* *");
+ System.out.println("* RAPTOR SETUP COMPLETE. *");
+ System.out.println("* *");
+ System.out.println("* Thank you for upgrading. *");
+ System.out.println("* *");
+ System.out.println("************************************************");
+ }
+
+ public static void copy(InputStream in, OutputStream out, long byteCount) throws IOException {
+ byte buffer[] = new byte[bufferSize];
+ int len = bufferSize;
+ if (byteCount >= 0) {
+ while (byteCount > 0) {
+ if (byteCount < bufferSize)
+ len = in.read(buffer, 0, (int) byteCount);
+ else
+ len = in.read(buffer, 0, bufferSize);
+ if (len == -1)
+ break;
+
+ byteCount -= len;
+ out.write(buffer, 0, len);
+ }
+ } else {
+ while (true) {
+ len = in.read(buffer, 0, bufferSize);
+ if (len < 0)
+ break;
+ out.write(buffer, 0, len);
+ }
+ }
+ }
+
+ /* ------------------------------------------------------------------- */
+ /**
+ * Copy Reader to Writer for byteCount bytes or until EOF or exception.
+ */
+ public static void copy(Reader in, Writer out, long byteCount) throws IOException {
+ char buffer[] = new char[bufferSize];
+ int len = bufferSize;
+ if (byteCount >= 0) {
+ while (byteCount > 0) {
+ if (byteCount < bufferSize)
+ len = in.read(buffer, 0, (int) byteCount);
+ else
+ len = in.read(buffer, 0, bufferSize);
+
+ if (len == -1)
+ break;
+ byteCount -= len;
+ out.write(buffer, 0, len);
+ }
+ } else {
+ while (true) {
+ len = in.read(buffer, 0, bufferSize);
+ if (len == -1)
+ break;
+ out.write(buffer, 0, len);
+ }
+ }
+ }
+
+ /* ------------------------------------------------------------------- */
+ /**
+ * Copy Stream in to Stream out until EOF or exception.
+ */
+ public static void copy(InputStream in, OutputStream out) throws IOException {
+ copy(in, out, -1);
+ }
+
+ // Deletes all files and subdirectories under dir.
+ // Returns true if all deletions were successful.
+ // If a deletion fails, the method stops attempting to delete and returns false.
+ public static boolean deleteDir(File dir) {
+ if (dir.isDirectory()) {
+ String[] children = dir.list();
+ for (int i = 0; i < children.length; i++) {
+ boolean success = deleteDir(new File(dir, children[i]));
+ if (!success) {
+ return false;
+ }
+ }
+ }
+
+ // The directory is now empty so delete it
+ return dir.delete();
+ }
+
}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.command;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.command;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.config;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.config;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.config;
import org.openecomp.portalapp.portal.service.EPRoleFunctionService;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.config;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.config;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.controller;
import javax.servlet.http.HttpSession;
import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
import org.openecomp.portalapp.util.EPUserUtils;
import org.openecomp.portalsdk.core.controller.FusionBaseController;
import org.openecomp.portalsdk.core.domain.MenuData;
@Controller
public abstract class EPFusionBaseController extends FusionBaseController {
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPFusionBaseController.class);
-
+ private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPFusionBaseController.class);
@Override
public boolean isAccessible() {
try {
model = setMenu(menuResult);
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "messages failed", e);
}
}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.controller.sessionmgt;
@EnableAspectJAutoProxy
@EPAuditLog
public class SessionCommunicationController extends EPRestrictedRESTfulBaseController {
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SessionCommunicationController.class);
+ private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SessionCommunicationController.class);
@Autowired
private ManageService manageService;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.externalsystemapproval.model;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.externalsystemapproval.model;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.lm;
/*-
- * ================================================================================
- * eCOMP Portal SDK
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.lm;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.model;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
@EnableAspectJAutoProxy
@EPAuditLog
public class AppsController extends EPRestrictedBaseController {
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AppsController.class);
+ private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AppsController.class);
@Autowired
private AdminRolesService adminRolesService;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
* Store audit log of the specified access type.
*
* @param request
+ * HttpServletRequest
* @param affectedAppId
+ * App ID
* @param type
+ * Access type
* @param comment
+ * Comment
*/
@RequestMapping(value = "/store", method = RequestMethod.GET, produces = "application/json")
public void auditLog(HttpServletRequest request, @RequestParam String affectedAppId, @RequestParam String type,
@RequestParam String comment) {
- logger.debug(EELFLoggerDelegate.debugLogger, "auditLog: appId {}, type {], comment {}",
- affectedAppId, type, comment);
+ logger.debug(EELFLoggerDelegate.debugLogger, "auditLog: appId {}, type {], comment {}", affectedAppId, type,
+ comment);
String cd_type = null;
- try {
+ try {
EPUser user = EPUserUtils.getUserSession(request);
/* Check type of Activity CD */
if (type.equals("app")) {
} else if (type.equals("leftMenu")) {
cd_type = AuditLog.CD_ACTIVITY_LEFT_MENU_ACCESS;
} else {
- logger.error(EELFLoggerDelegate.errorLogger, "Storing auditLog failed! Activity CD type is not correct.");
+ logger.error(EELFLoggerDelegate.errorLogger,
+ "Storing auditLog failed! Activity CD type is not correct.");
}
/* Store the audit log only if it contains valid Activity CD */
if (cd_type != null) {
AuditLog auditLog = new AuditLog();
auditLog.setActivityCode(cd_type);
/*
- * Check affectedAppId and comment and see if these two values are
- * valid
+ * Check affectedAppId and comment and see if these two values are valid
*/
if (comment != null && !comment.equals("") && !comment.equals("undefined"))
auditLog.setComments(EcompPortalUtils.truncateString(comment, PortalConstants.AUDIT_LOG_COMMENT_SIZE));
auditService.logActivity(auditLog, null);
// Log file
- MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP,EPEELFLoggerAdvice.getCurrentDateTimeUTC());
- MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP,EPEELFLoggerAdvice.getCurrentDateTimeUTC());
- logger.info(EELFLoggerDelegate.auditLogger, EPLogUtil.formatAuditLogMessage("AuditLogController.auditLog",
- cd_type, user.getOrgUserId(), affectedAppId, comment));
+ MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+ MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+ logger.info(EELFLoggerDelegate.auditLogger, EPLogUtil.formatAuditLogMessage(
+ "AuditLogController.auditLog", cd_type, user.getOrgUserId(), affectedAppId, comment));
MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.controller;
import java.util.ArrayList;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
/*
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.controller;
-
import java.util.ArrayList;
import java.util.List;
@Autowired
private AuditService auditService;
-
+
private static final String UEBKEY = "uebkey";
private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ExternalAccessRolesController.class);
@Autowired
private ExternalAccessRolesService externalAccessRolesService;
- @ApiOperation(value = "Gets user role for an application.", response = String.class, responseContainer="List")
- @RequestMapping(value = {
- "/user/{loginId}" }, method = RequestMethod.GET, produces = "application/json")
- public String getUser(HttpServletRequest request, HttpServletResponse response, @PathVariable("loginId") String loginId) throws Exception {
-
+ @ApiOperation(value = "Gets user role for an application.", response = String.class, responseContainer = "List")
+ @RequestMapping(value = { "/user/{loginId}" }, method = RequestMethod.GET, produces = "application/json")
+ public String getUser(HttpServletRequest request, HttpServletResponse response,
+ @PathVariable("loginId") String loginId) throws Exception {
+
String answer = null;
try {
answer = externalAccessRolesService.getUserWithRoles(loginId, request.getHeader(UEBKEY));
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "getUser failed", e);
}
- return answer;
+ return answer;
}
-
- @ApiOperation(value = "Gets roles for an application.", response = CentralRole.class, responseContainer="Json")
- @RequestMapping(value = {
- "/roles" }, method = RequestMethod.GET, produces = "application/json")
+
+ @ApiOperation(value = "Gets roles for an application.", response = CentralRole.class, responseContainer = "Json")
+ @RequestMapping(value = { "/roles" }, method = RequestMethod.GET, produces = "application/json")
public List<CentralRole> getRolesForApp(HttpServletRequest request, HttpServletResponse response) throws Exception {
logger.debug(EELFLoggerDelegate.debugLogger, "Request received for getRolesForApp");
- List<EPApp> applicationList=new ArrayList<>();
+ List<EPApp> applicationList = new ArrayList<>();
applicationList = externalAccessRolesService.getApp(request.getHeader(UEBKEY));
EPApp app = applicationList.get(0);
- externalAccessRolesService.syncApplicationRolesWithEcompDB(app);
+ externalAccessRolesService.syncApplicationRolesWithEcompDB(app);
List<CentralRole> answer = null;
try {
answer = externalAccessRolesService.getRolesForApp(request.getHeader(UEBKEY));
} catch (HttpClientErrorException e) {
- if("Application not found".equalsIgnoreCase(e.getMessage())){
+ if ("Application not found".equalsIgnoreCase(e.getMessage())) {
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
}
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
return answer;
}
- @ApiOperation(value = "Gets all role functions for an application.", response = CentralRoleFunction.class, responseContainer="Json")
- @RequestMapping(value = {
- "/functions" }, method = RequestMethod.GET, produces = "application/json")
- public List<CentralRoleFunction> getRoleFunctionsList(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ @ApiOperation(value = "Gets all role functions for an application.", response = CentralRoleFunction.class, responseContainer = "Json")
+ @RequestMapping(value = { "/functions" }, method = RequestMethod.GET, produces = "application/json")
+ public List<CentralRoleFunction> getRoleFunctionsList(HttpServletRequest request, HttpServletResponse response)
+ throws Exception {
List<CentralRoleFunction> answer = null;
logger.debug(EELFLoggerDelegate.debugLogger, "Request received for getRoleFunctionsList");
try {
}
logger.debug(EELFLoggerDelegate.debugLogger, "Request completed for getRoleFunctionsList");
return answer;
- }
-
- @ApiOperation(value = "Gets role information for an application.", response = CentralRole.class, responseContainer="Json")
- @RequestMapping(value = {
- "/role/{role_id}" }, method = RequestMethod.GET, produces = "application/json")
- public CentralRole getRoleInfo(HttpServletRequest request, HttpServletResponse response, @PathVariable("role_id") Long roleId) throws Exception {
+ }
+
+ @ApiOperation(value = "Gets role information for an application.", response = CentralRole.class, responseContainer = "Json")
+ @RequestMapping(value = { "/role/{role_id}" }, method = RequestMethod.GET, produces = "application/json")
+ public CentralRole getRoleInfo(HttpServletRequest request, HttpServletResponse response,
+ @PathVariable("role_id") Long roleId) throws Exception {
CentralRole answer = null;
logger.debug(EELFLoggerDelegate.debugLogger, "Request received for getRoleInfo");
logger.debug(EELFLoggerDelegate.debugLogger, "Request completed for getRoleInfo");
return answer;
}
-
+
@ApiOperation(value = "Gets role information for an application provided by function code.", response = CentralRoleFunction.class, responseContainer = "Json")
@RequestMapping(value = { "/function/{code}" }, method = RequestMethod.GET, produces = "application/json")
public CentralRoleFunction getRoleFunction(HttpServletRequest request, HttpServletResponse response,
EPApp requestedApp = applicationList.get(0);
Long appId = requestedApp.getId();
try {
- String data = roleFunc;
+ String data = roleFunc;
CentralRoleFunction availableRoleFunction = mapper.readValue(data, CentralRoleFunction.class);
availableRoleFunction.setAppId(appId);
- boolean saveOrUpdateResponse = externalAccessRolesService.saveCentralRoleFunction(availableRoleFunction, requestedApp);
- if(saveOrUpdateResponse){
+ boolean saveOrUpdateResponse = externalAccessRolesService.saveCentralRoleFunction(availableRoleFunction,
+ requestedApp);
+ if (saveOrUpdateResponse) {
EPUser user = externalAccessRolesService.getUser(request.getHeader(LOGIN_ID)).get(0);
EPApp app = externalAccessRolesService.getApp(request.getHeader(UEBKEY)).get(0);
- CentralRoleFunction function = externalAccessRolesService.getRoleFunction(availableRoleFunction.getCode(), request.getHeader(UEBKEY));
- String activityCode = (function.getCode() == null) ? EcompAuditLog.CD_ACTIVITY_EXTERNAL_AUTH_ADD_FUNCTION: EcompAuditLog.CD_ACTIVITY_EXTERNAL_AUTH_UPDATE_FUNCTION;
+ CentralRoleFunction function = externalAccessRolesService
+ .getRoleFunction(availableRoleFunction.getCode(), request.getHeader(UEBKEY));
+ String activityCode = (function.getCode() == null)
+ ? EcompAuditLog.CD_ACTIVITY_EXTERNAL_AUTH_ADD_FUNCTION
+ : EcompAuditLog.CD_ACTIVITY_EXTERNAL_AUTH_UPDATE_FUNCTION;
logger.info(EELFLoggerDelegate.applicationLogger, "saveRoleFunction: succeeded for app {}, function {}",
app.getId(), availableRoleFunction.getCode());
AuditLog auditLog = new AuditLog();
auditLog.setUserId(user.getId());
auditLog.setActivityCode(activityCode);
- auditLog.setComments(EcompPortalUtils.truncateString("saveRoleFunction role for app:"+app.getId()+" and function:'"+availableRoleFunction.getCode()+"'", PortalConstants.AUDIT_LOG_COMMENT_SIZE));
+ auditLog.setComments(
+ EcompPortalUtils.truncateString(
+ "saveRoleFunction role for app:" + app.getId() + " and function:'"
+ + availableRoleFunction.getCode() + "'",
+ PortalConstants.AUDIT_LOG_COMMENT_SIZE));
auditLog.setAffectedRecordId(user.getOrgUserId());
auditService.logActivity(auditLog, null);
- MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP,
- EPEELFLoggerAdvice.getCurrentDateTimeUTC());
- MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP,
- EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+ MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+ MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
EcompPortalUtils.calculateDateTimeDifferenceForLog(
MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
logger.info(EELFLoggerDelegate.auditLogger,
- EPLogUtil.formatAuditLogMessage("ExternalAccessRolesController.saveRoleFunction",
- activityCode, String.valueOf(user.getId()),
- user.getOrgUserId(), availableRoleFunction.getCode()));
+ EPLogUtil.formatAuditLogMessage("ExternalAccessRolesController.saveRoleFunction", activityCode,
+ String.valueOf(user.getId()), user.getOrgUserId(), availableRoleFunction.getCode()));
MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
MDC.remove(SystemProperties.MDC_TIMER);
- } else{
+ } else {
logger.error(EELFLoggerDelegate.errorLogger, "saveRoleFunction failed");
- return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Failed to saveRoleFunction for '"+availableRoleFunction.getCode()+"'", "Failed");
+ return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
+ "Failed to saveRoleFunction for '" + availableRoleFunction.getCode() + "'", "Failed");
}
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "saveRoleFunction failed", e);
}
return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully Saved", "Success");
}
-
+
@ApiOperation(value = "Deletes role function for an application.", response = PortalRestResponse.class, responseContainer = "Json")
@RequestMapping(value = { "/roleFunction/{code}" }, method = RequestMethod.DELETE, produces = "application/json")
- public PortalRestResponse<String> deleteRoleFunction(HttpServletRequest request, HttpServletResponse response, @PathVariable("code") String code) throws Exception {
+ public PortalRestResponse<String> deleteRoleFunction(HttpServletRequest request, HttpServletResponse response,
+ @PathVariable("code") String code) throws Exception {
try {
EPUser user = externalAccessRolesService.getUser(request.getHeader(LOGIN_ID)).get(0);
EPApp app = externalAccessRolesService.getApp(request.getHeader(UEBKEY)).get(0);
boolean getDelFuncResponse = externalAccessRolesService.deleteCentralRoleFunction(code, app);
- if(getDelFuncResponse){
+ if (getDelFuncResponse) {
logger.info(EELFLoggerDelegate.applicationLogger, "deleteRoleFunction: succeeded for app {}, role {}",
app.getId(), code);
AuditLog auditLog = new AuditLog();
auditLog.setUserId(user.getId());
auditLog.setActivityCode(EcompAuditLog.CD_ACTIVITY_EXTERNAL_AUTH_DELETE_FUNCTION);
- auditLog.setComments(EcompPortalUtils.truncateString("Deleted function for app:"+app.getId()+" and function code:'"+code+"'", PortalConstants.AUDIT_LOG_COMMENT_SIZE));
+ auditLog.setComments(EcompPortalUtils.truncateString(
+ "Deleted function for app:" + app.getId() + " and function code:'" + code + "'",
+ PortalConstants.AUDIT_LOG_COMMENT_SIZE));
auditLog.setAffectedRecordId(user.getOrgUserId());
auditService.logActivity(auditLog, null);
- MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP,
- EPEELFLoggerAdvice.getCurrentDateTimeUTC());
- MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP,
- EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+ MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+ MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
EcompPortalUtils.calculateDateTimeDifferenceForLog(
MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
MDC.remove(SystemProperties.MDC_TIMER);
- } else{
+ } else {
logger.error(EELFLoggerDelegate.errorLogger, "deleteRoleFunction failed");
- return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Failed to deleteRoleFunction for '"+code+"'", "Failed");
+ return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
+ "Failed to deleteRoleFunction for '" + code + "'", "Failed");
}
} catch (HttpClientErrorException e) {
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
logger.error(EELFLoggerDelegate.errorLogger, "deleteRoleFunction failed", e);
- return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, "Failed to deleteRoleFunction for '"+code+"'", "Failed");
+ return new PortalRestResponse<>(PortalRestStatusEnum.ERROR,
+ "Failed to deleteRoleFunction for '" + code + "'", "Failed");
}
return new PortalRestResponse<>(PortalRestStatusEnum.OK, "Successfully Deleted", "Success");
- }
-
+ }
+
@ApiOperation(value = "Saves role for an application.", response = PortalRestResponse.class, responseContainer = "Json")
@RequestMapping(value = { "/role" }, method = RequestMethod.POST, produces = "application/json")
public PortalRestResponse<String> saveRole(HttpServletRequest request, HttpServletResponse response,
AuditLog auditLog = new AuditLog();
auditLog.setUserId(user.getId());
auditLog.setActivityCode(activityCode);
- auditLog.setComments(EcompPortalUtils.truncateString("saveRole role for app:" + app.getId() + " and role:'" + role.getName()+"'", PortalConstants.AUDIT_LOG_COMMENT_SIZE));
+ auditLog.setComments(EcompPortalUtils.truncateString(
+ "saveRole role for app:" + app.getId() + " and role:'" + role.getName() + "'",
+ PortalConstants.AUDIT_LOG_COMMENT_SIZE));
auditLog.setAffectedRecordId(user.getOrgUserId());
auditService.logActivity(auditLog, null);
MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
MDC.remove(SystemProperties.MDC_TIMER);
} else {
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
- return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, "Failed to saveRole for '"+role.getName()+"'", "Failed");
+ return new PortalRestResponse<>(PortalRestStatusEnum.ERROR,
+ "Failed to saveRole for '" + role.getName() + "'", "Failed");
}
} catch (Exception e) {
}
return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully Saved", "Success");
}
-
+
@ApiOperation(value = "Deletes role for an application.", response = PortalRestResponse.class, responseContainer = "Json")
@RequestMapping(value = { "/deleteRole/{code}" }, method = RequestMethod.DELETE, produces = "application/json")
- public PortalRestResponse<String> deleteRole(HttpServletRequest request, HttpServletResponse response,
+ public PortalRestResponse<String> deleteRole(HttpServletRequest request, HttpServletResponse response,
@PathVariable String code) throws Exception {
try {
- boolean deleteResponse = externalAccessRolesService.deleteRoleForApplication(code, request.getHeader(UEBKEY));
- if(deleteResponse){
+ boolean deleteResponse = externalAccessRolesService.deleteRoleForApplication(code,
+ request.getHeader(UEBKEY));
+ if (deleteResponse) {
EPUser user = externalAccessRolesService.getUser(request.getHeader(LOGIN_ID)).get(0);
EPApp app = externalAccessRolesService.getApp(request.getHeader(UEBKEY)).get(0);
logger.info(EELFLoggerDelegate.applicationLogger, "deleteRole: succeeded for app {}, role {}",
AuditLog auditLog = new AuditLog();
auditLog.setUserId(user.getId());
auditLog.setActivityCode(EcompAuditLog.CD_ACTIVITY_EXTERNAL_AUTH_DELETE_ROLE);
- auditLog.setComments(EcompPortalUtils.truncateString("Deleted role for app:"+app.getId()+" and role:'"+code+"'", PortalConstants.AUDIT_LOG_COMMENT_SIZE));
+ auditLog.setComments(EcompPortalUtils.truncateString(
+ "Deleted role for app:" + app.getId() + " and role:'" + code + "'",
+ PortalConstants.AUDIT_LOG_COMMENT_SIZE));
auditLog.setAffectedRecordId(user.getOrgUserId());
auditService.logActivity(auditLog, null);
- MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP,
- EPEELFLoggerAdvice.getCurrentDateTimeUTC());
- MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP,
- EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+ MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+ MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
EcompPortalUtils.calculateDateTimeDifferenceForLog(
MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
MDC.remove(SystemProperties.MDC_TIMER);
- } else{
+ } else {
logger.error(EELFLoggerDelegate.errorLogger, "deleteRole failed");
- return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Failed to deleteRole for '"+code+"'", "Failed");
+ return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
+ "Failed to deleteRole for '" + code + "'", "Failed");
}
} catch (Exception e) {
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully Deleted", "Success");
}
-
+
@ApiOperation(value = "Gets active roles for an application.", response = CentralRole.class, responseContainer = "Json")
@RequestMapping(value = { "/activeRoles" }, method = RequestMethod.GET, produces = "application/json")
- public List<CentralRole> getActiveRoles(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public List<CentralRole> getActiveRoles(HttpServletRequest request, HttpServletResponse response) throws Exception {
List<CentralRole> cenRole = null;
try {
cenRole = externalAccessRolesService.getActiveRoles(request.getHeader(UEBKEY));
logger.error(EELFLoggerDelegate.errorLogger, "getActiveRoles failed", e);
}
return cenRole;
-
+
}
-
+
@ApiOperation(value = "deletes user roles for an application.", response = PortalRestResponse.class, responseContainer = "Json")
- @RequestMapping(value = { "/deleteDependcyRoleRecord/{roleId}" }, method = RequestMethod.DELETE, produces = "application/json")
- public PortalRestResponse<String> deleteDependencyRoleRecord(HttpServletRequest request, HttpServletResponse response,
- @PathVariable("roleId") Long roleId) throws Exception {
+ @RequestMapping(value = {
+ "/deleteDependcyRoleRecord/{roleId}" }, method = RequestMethod.DELETE, produces = "application/json")
+ public PortalRestResponse<String> deleteDependencyRoleRecord(HttpServletRequest request,
+ HttpServletResponse response, @PathVariable("roleId") Long roleId) throws Exception {
try {
boolean deleteResponse = externalAccessRolesService.deleteDependencyRoleRecord(roleId,
request.getHeader(UEBKEY), request.getHeader(LOGIN_ID));
}
return new PortalRestResponse<>(PortalRestStatusEnum.OK, "Successfully Deleted", "Success");
}
-
+
@ApiOperation(value = "Bulk upload functions for an application.", response = PortalRestResponse.class, responseContainer = "Json")
@RequestMapping(value = { "/upload/portal/functions" }, method = RequestMethod.POST, produces = "application/json")
- public PortalRestResponse<String> bulkUploadFunctions(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public PortalRestResponse<String> bulkUploadFunctions(HttpServletRequest request, HttpServletResponse response)
+ throws Exception {
Integer result = 0;
try {
result = externalAccessRolesService.bulkUploadFunctions(request.getHeader(UEBKEY));
} catch (HttpClientErrorException e) {
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
logger.error(EELFLoggerDelegate.errorLogger, "bulkUploadFunctions failed", e);
- return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Failed to bulkUploadFunctions", "Failed");
+ return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Failed to bulkUploadFunctions",
+ "Failed");
}
- return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully added: "+result, "Success");
+ return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully added: " + result, "Success");
}
-
+
@ApiOperation(value = "Bulk upload roles for an application.", response = PortalRestResponse.class, responseContainer = "Json")
@RequestMapping(value = { "/upload/portal/roles" }, method = RequestMethod.POST, produces = "application/json")
- public PortalRestResponse<String> bulkUploadRoles(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public PortalRestResponse<String> bulkUploadRoles(HttpServletRequest request, HttpServletResponse response)
+ throws Exception {
Integer result = 0;
try {
result = externalAccessRolesService.bulkUploadRoles(request.getHeader(UEBKEY));
logger.error(EELFLoggerDelegate.errorLogger, "bulkUploadRoles failed", e);
return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Failed to bulkUploadRoles", "Failed");
}
- return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully added: "+result, "Success");
+ return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully added: " + result, "Success");
}
-
+
@ApiOperation(value = "Bulk upload role functions for an application.", response = PortalRestResponse.class, responseContainer = "Json")
- @RequestMapping(value = { "/upload/portal/roleFunctions" }, method = RequestMethod.POST, produces = "application/json")
- public PortalRestResponse<String> bulkUploadRoleFunctions(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ @RequestMapping(value = {
+ "/upload/portal/roleFunctions" }, method = RequestMethod.POST, produces = "application/json")
+ public PortalRestResponse<String> bulkUploadRoleFunctions(HttpServletRequest request, HttpServletResponse response)
+ throws Exception {
Integer result = 0;
try {
result = externalAccessRolesService.bulkUploadRolesFunctions(request.getHeader(UEBKEY));
} catch (HttpClientErrorException e) {
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
logger.error(EELFLoggerDelegate.errorLogger, "bulkUploadRoleFunctions failed", e);
- return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Failed to bulkUploadRoleFunctions", "Failed");
+ return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Failed to bulkUploadRoleFunctions",
+ "Failed");
}
- return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully added: "+result, "Success");
+ return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully added: " + result, "Success");
}
-
+
@ApiOperation(value = "Bulk upload user roles for an application.", response = PortalRestResponse.class, responseContainer = "Json")
@RequestMapping(value = { "/upload/portal/userRoles" }, method = RequestMethod.POST, produces = "application/json")
- public PortalRestResponse<String> bulkUploadUserRoles(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public PortalRestResponse<String> bulkUploadUserRoles(HttpServletRequest request, HttpServletResponse response)
+ throws Exception {
Integer result = 0;
try {
result = externalAccessRolesService.bulkUploadUserRoles(request.getHeader(UEBKEY));
} catch (HttpClientErrorException e) {
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
logger.error(EELFLoggerDelegate.errorLogger, "bulkUploadUserRoles failed", e);
- return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Failed to bulkUploadUserRoles", "Failed");
+ return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Failed to bulkUploadUserRoles",
+ "Failed");
}
- return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully added: "+result, "Success");
+ return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully added: " + result, "Success");
}
-
+
@ApiOperation(value = "Bulk upload functions for an partner application.", response = PortalRestResponse.class, responseContainer = "Json")
@RequestMapping(value = { "/upload/partner/functions" }, method = RequestMethod.POST, produces = "application/json")
- public PortalRestResponse<String> bulkUploadPartnerFunctions(HttpServletRequest request, HttpServletResponse response, @RequestBody List<RoleFunction> upload) throws Exception {
+ public PortalRestResponse<String> bulkUploadPartnerFunctions(HttpServletRequest request,
+ HttpServletResponse response, @RequestBody List<RoleFunction> upload) throws Exception {
try {
externalAccessRolesService.bulkUploadPartnerFunctions(request.getHeader(UEBKEY), upload);
} catch (HttpClientErrorException e) {
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
logger.error(EELFLoggerDelegate.errorLogger, "bulkUploadFunctions failed", e);
- return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Failed to bulkUploadFunctions", "Failed");
+ return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Failed to bulkUploadFunctions",
+ "Failed");
}
return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully added", "Success");
}
-
+
@ApiOperation(value = "Bulk upload roles for an partner application.", response = PortalRestResponse.class, responseContainer = "Json")
@RequestMapping(value = { "/upload/partner/roles" }, method = RequestMethod.POST, produces = "application/json")
- public PortalRestResponse<String> bulkUploadPartnerRoles(HttpServletRequest request, HttpServletResponse response, @RequestBody List<Role> upload) throws Exception {
+ public PortalRestResponse<String> bulkUploadPartnerRoles(HttpServletRequest request, HttpServletResponse response,
+ @RequestBody List<Role> upload) throws Exception {
try {
externalAccessRolesService.bulkUploadPartnerRoles(request.getHeader(UEBKEY), upload);
} catch (HttpClientErrorException e) {
}
return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully added", "Success");
}
-
+
@ApiOperation(value = "Bulk upload role functions for an partner application.", response = PortalRestResponse.class, responseContainer = "Json")
- @RequestMapping(value = { "/upload/partner/roleFunctions" }, method = RequestMethod.POST, produces = "application/json")
- public PortalRestResponse<String> bulkUploadPartnerRoleFunctions(HttpServletRequest request, HttpServletResponse response, @RequestBody List<Role> upload) throws Exception {
+ @RequestMapping(value = {
+ "/upload/partner/roleFunctions" }, method = RequestMethod.POST, produces = "application/json")
+ public PortalRestResponse<String> bulkUploadPartnerRoleFunctions(HttpServletRequest request,
+ HttpServletResponse response, @RequestBody List<Role> upload) throws Exception {
try {
externalAccessRolesService.bulkUploadPartnerRoleFunctions(request.getHeader(UEBKEY), upload);
} catch (HttpClientErrorException e) {
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
logger.error(EELFLoggerDelegate.errorLogger, "bulkUploadRoles failed", e);
- return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Failed to bulkUploadPartnerRoleFunctions", "Failed");
+ return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
+ "Failed to bulkUploadPartnerRoleFunctions", "Failed");
}
return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully added", "Success");
}
-
+
@ApiOperation(value = "Gets all functions along with global functions", response = List.class, responseContainer = "Json")
@RequestMapping(value = { "/menuFunctions" }, method = RequestMethod.GET, produces = "application/json")
- public List<String> getMenuFunctions(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public List<String> getMenuFunctions(HttpServletRequest request, HttpServletResponse response) throws Exception {
List<String> functionsList = null;
try {
functionsList = externalAccessRolesService.getMenuFunctionsList(request.getHeader(UEBKEY));
}
return functionsList;
}
-
-
+
@ApiOperation(value = "Gets all active Users of application", response = String.class, responseContainer = "Json")
@RequestMapping(value = { "/users" }, method = RequestMethod.GET, produces = "application/json")
- public List<EcompUser> getUsersOfApplication(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ public List<EcompUser> getUsersOfApplication(HttpServletRequest request, HttpServletResponse response)
+ throws Exception {
List<EcompUser> users = null;
try {
users = externalAccessRolesService.getAllAppUsers(request.getHeader(UEBKEY));
- } catch (Exception e) {
+ } catch (Exception e) {
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
logger.error(EELFLoggerDelegate.errorLogger, "getUsersOfApplication failed", e);
throw new Exception(e.getMessage());
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
functionalMenuService.assignHelpURLs(menuItems);
EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/functionalMenu", "result =", menuItems);
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger,
- "Exception occurred while calling functionalMenu. Details: " + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "getMenuItems failed", e);
}
return menuItems;
}
}
/**
- * RESTful service method to fetch all the FunctionalMenuItems, both active
- * and inactive, for the EditFunctionalMenu feature. Can only be accessed by
- * the portal admin.
+ * RESTful service method to fetch all the FunctionalMenuItems, both active and
+ * inactive, for the EditFunctionalMenu feature. Can only be accessed by the
+ * portal admin.
*
* @param request
* HttpServletRequest
EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/functionalMenuForEditing", "result =",
menuItems);
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger,
- "Exception occurred while calling functionalMenuForEditing. Details: "
- + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "getMenuItemsForEditing failed", e);
}
return menuItems;
}
/**
- * RESTful service method to fetch all the FunctionalMenuItems, active , for
- * the Functional menu in notification Tree feature.
+ * RESTful service method to fetch all the FunctionalMenuItems, active , for the
+ * Functional menu in notification Tree feature.
*
* @param request
* HttpServletRequest
EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/functionalMenuForNotificationTree", "result =",
menuItems);
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger,
- "Exception occurred while calling functionalMenuForNotifications. Details: "
- + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "getMenuItemsForNotifications failed", e);
}
return menuItems;
}
/**
- * RESTful service method to fetch all FunctionalMenuItems associated with
- * an application.
+ * RESTful service method to fetch all FunctionalMenuItems associated with an
+ * application.
*
* @param request
* HttpServletRequest
- * @param response
- * HttpServletResponse
* @param appId
* application ID
* @return List of FunctionalMenuItem objects
EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/functionalMenuForApp/" + appId, "result =",
menuItems);
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger,
- "Exception occurred while calling functionalMenuForApp. Details: "
- + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "getMenuItemsForApp failed", e);
}
return menuItems;
}
/**
- * RESTful service method to fetch all FunctionalMenuItems associated with
- * the applications and roles that a user has access to.
+ * RESTful service method to fetch all FunctionalMenuItems associated with the
+ * applications and roles that a user has access to.
*
* @param request
* HttpServletRequest
EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/functionalMenuForUser/" + orgUserId, "result =",
menuItems);
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger,
- "Exception occurred while calling functionalMenuForUser. Details: "
- + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "getMenuItemsForUser failed", e);
}
return menuItems;
}
/**
- * RESTful service method to fetch all FunctionalMenuItems associated with
- * the applications and roles that the authenticated user has access to.
+ * RESTful service method to fetch all FunctionalMenuItems associated with the
+ * applications and roles that the authenticated user has access to.
*
* @param request
* HttpServletRequest
}
functionalMenuService.assignHelpURLs(menuItems);
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger,
- "Exception occurred while calling getMenuItemsForAuthUser. Details: "
- + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "getMenuItemsForAuthUser failed", e);
}
return menuItems;
}
"result =", menuItem);
}
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger,
- "Exception occurred while calling functionalMenuItemDetails. Details: "
- + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "getFunctionalMenuItemDetails failed", e);
}
return menuItem;
}
/**
- * RESTful service to get favorites for the current user as identified in
- * the session
+ * RESTful service to get favorites for the current user as identified in the
+ * session
*
* @param request
* HttpServletRequest
* user ID, email and last-login. (Actually has nothing to do with the real
* functional menu.) First attempts to get the information from the Tomcat
* session (i.e., the CSP cookie); if that fails, calls the shared context
- * service to read the information from the database. Gives back what it
- * found, any of which may be null, as a JSON collection.
+ * service to read the information from the database. Gives back what it found,
+ * any of which may be null, as a JSON collection.
*
* @param request
* HttpServletRequest
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
@EPAuditLog
public class GetAccessController extends EPUnRestrictedBaseController {
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(GetAccessController.class);
+ private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(GetAccessController.class);
@Autowired
- GetAccessService getAccessService;
+ private GetAccessService getAccessService;
/**
* Sorts the list by ECOMP function name.
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
@EPAuditLog
public class HealthCheckController extends EPUnRestrictedBaseController {
+ private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HealthCheckController.class);
+
private class HealthStatus {
public int statusCode;
@SuppressWarnings("unused")
private final String statusDown = "DOWN";
private final String statusOk = "OK";
- private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HealthCheckController.class);
-
@RequestMapping(value = { "/portalApi/healthCheck" }, method = RequestMethod.GET, produces = "application/json")
public HealthStatus healthCheck(HttpServletRequest request, HttpServletResponse response) {
HealthStatus healthStatus = new HealthStatus(500, "");
}
MDC.put(EPCommonSystemProperties.RESPONSE_CODE, Integer.toString(healthStatus.statusCode));
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger,
- "Exception occurred while performing the healthcheck. Details: "
- + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "healthCheck failed", e);
}
EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/healthCheck", "GET result =", response.getStatus());
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ManifestController.class);
@Autowired
- ManifestService manifestService;
+ private ManifestService manifestService;
/**
* Gets the webapp manifest contents as a JSON object.
*
* @param request
+ * HttpServletRequest
* @return A map of key-value pairs. On success:
*
* <pre>
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.HttpClientErrorException;
-import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
-@SuppressWarnings("unchecked")
@RestController
@org.springframework.context.annotation.Configuration
@EnableAspectJAutoProxy
@EPAuditLog
public class MicroserviceProxyController extends EPUnRestrictedBaseController {
+ private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MicroserviceProxyController.class);
+
@Autowired
private MicroserviceProxyService microserviceProxyService;
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MicroserviceProxyController.class);
-
@RequestMapping(value = { "/portalApi/microservice/proxy/{serviceId}" }, method = {
RequestMethod.GET }, produces = "application/json")
public String getMicroserviceProxy(HttpServletRequest request, HttpServletResponse response,
mapper.readTree(response);
return true;
} catch (IOException e) {
+ logger.debug(EELFLoggerDelegate.debugLogger, "isValidJSON failed", e);
return false;
}
}
/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ============LICENSE_END=========================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
-package org.openecomp.portalapp.portal.controller;
+package org.openecomp.portalapp.portal.controller;
import java.util.UUID;
import org.openecomp.portalsdk.core.util.SystemProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
-/*import org.openecomp.vid.policy.PolicyProperties;
-import org.openecomp.vid.policy.PolicyResponseWrapper;
-import org.openecomp.vid.policy.PolicyRestInterfaceFactory;
-import org.openecomp.vid.policy.PolicyRestInterfaceIfc;
-import org.openecomp.vid.policy.PolicyUtil;*/
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
-
-
/**
* Controller to handle Policy requests.
*/
@Configuration
@EnableAspectJAutoProxy
@EPAuditLog
-public class PolicyController implements BasicAuthenticationController{
-
+public class PolicyController implements BasicAuthenticationController {
+
/** The logger. */
- static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PolicyController.class);
-
- @RequestMapping(value="/get_policy",method = RequestMethod.POST)
- public ResponseEntity<String> getPolicyInfo( HttpServletRequest request, @RequestBody JSONObject policy_request) throws Exception {
-
- logger.debug(EELFLoggerDelegate.debugLogger, "#####################POLICY API CALL STARTED ###############"+ PolicyProperties.POLICY_GET_CONFIG_VAL);
- logger.debug(EELFLoggerDelegate.debugLogger, "#####################Policy Request ###############"+policy_request.toString());
+ private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PolicyController.class);
+
+ @RequestMapping(value = "/get_policy", method = RequestMethod.POST)
+ public ResponseEntity<String> getPolicyInfo(HttpServletRequest request, @RequestBody JSONObject policy_request)
+ throws Exception {
+
+ logger.debug(EELFLoggerDelegate.debugLogger, "#####################POLICY API CALL STARTED ###############"
+ + PolicyProperties.POLICY_GET_CONFIG_VAL);
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ "#####################Policy Request ###############" + policy_request.toString());
String path = SystemProperties.getProperty(PolicyProperties.POLICY_GET_CONFIG_VAL);
- PolicyResponseWrapper policyResWrapper = getPolicyConfig(policy_request,path);
-
- logger.debug(EELFLoggerDelegate.debugLogger, "$$$$$$$$$$$$$$$$$$$$$$ " + new ResponseEntity<String>(policyResWrapper.getResponse(), HttpStatus.OK).toString());
+ PolicyResponseWrapper policyResWrapper = getPolicyConfig(policy_request, path);
+
+ logger.debug(EELFLoggerDelegate.debugLogger, "$$$$$$$$$$$$$$$$$$$$$$ "
+ + new ResponseEntity<String>(policyResWrapper.getResponse(), HttpStatus.OK).toString());
- return ( new ResponseEntity<String>(policyResWrapper.getResponse(), HttpStatus.valueOf(policyResWrapper.getStatus())) );
+ return (new ResponseEntity<String>(policyResWrapper.getResponse(),
+ HttpStatus.valueOf(policyResWrapper.getStatus())));
}
-
+
protected static PolicyResponseWrapper getPolicyConfig(JSONObject request, String path) throws Exception {
String methodName = "getPolicyConfig";
String uuid = UUID.randomUUID().toString();
- logger.debug(EELFLoggerDelegate.debugLogger, "starting getPolicyConfig ");
+ logger.debug(EELFLoggerDelegate.debugLogger, "starting getPolicyConfig ");
try {
- //STARTING REST API CALL AS AN FACTORY INSTACE
- PolicyRestInterfaceIfc policyRestController = PolicyRestInterfaceFactory.getInstance();
-
+ // STARTING REST API CALL AS AN FACTORY INSTACE
+ PolicyRestInterfaceIfc policyRestController = PolicyRestInterfaceFactory.getInstance();
+
RestObject<String> restObjStr = new RestObject<String>();
String str = new String();
restObjStr.set(str);
- policyRestController.<String>Post(str, request, uuid, path, restObjStr );
- PolicyResponseWrapper policyRespWrapper = PolicyUtil.wrapResponse (restObjStr);
+ policyRestController.<String>Post(str, request, uuid, path, restObjStr);
+ PolicyResponseWrapper policyRespWrapper = PolicyUtil.wrapResponse(restObjStr);
logger.debug(EELFLoggerDelegate.debugLogger, "<== " + methodName + " w=" + policyRespWrapper.getResponse());
return policyRespWrapper;
- } catch (Exception e) {
- logger.debug(EELFLoggerDelegate.debugLogger, "EXCEPTION in getPolicyConfig <== " + "." + methodName + e.toString());
+ } catch (Exception e) {
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ "EXCEPTION in getPolicyConfig <== " + "." + methodName + e.toString());
throw e;
}
}
}
-
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.slf4j.MDC;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-import org.openecomp.portalsdk.core.domain.AuditLog;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.service.AuditService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
import org.openecomp.portalapp.controller.EPRestrictedBaseController;
import org.openecomp.portalapp.portal.domain.EPRole;
import org.openecomp.portalapp.portal.domain.EPUser;
import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
import org.openecomp.portalapp.util.EPUserUtils;
+import org.openecomp.portalsdk.core.domain.AuditLog;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.service.AuditService;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.slf4j.MDC;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
@RestController
@org.springframework.context.annotation.Configuration
/**
* RESTful service method to create a new portal admin. Requirement: you
* must be the Ecomp portal super admin user.
+ * @param request
+ * @param userId
+ * @param response
+ * @return FieldsValidator
*/
-
@RequestMapping(value = { "/portalApi/portalAdmin" }, method = RequestMethod.POST)
public FieldsValidator createPortalAdmin(HttpServletRequest request, @RequestBody String userId,
HttpServletResponse response) {
rolesByApp = adminRolesService.getRolesByApp(user, appId);
}
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger,
- "Exception occurred while performing getRolesByApp operation, Details: "
- + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "getRolesByApp failed", e);
}
return rolesByApp;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.controller;
import javax.servlet.http.HttpServletRequest;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
/*-
- * ================================================================================
- * ECOMP Portal SDK
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal SDK
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
List<UserApplicationRoles> appUsers = userRolesService.getUsersFromAppEndpoint(appId);
return appUsers;
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger,
- "Exception occurred while performing UserRolesController.getUsersFromAppEndpoint. Details: "
- + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "getUsersFromAppEndpoint failed", e);
return new ArrayList<UserApplicationRoles>();
}
}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
import org.openecomp.portalapp.portal.service.ConsulHealthService;
import org.openecomp.portalapp.portal.service.MicroserviceService;
import org.openecomp.portalapp.portal.service.WidgetParameterService;
-import org.openecomp.portalapp.portal.utils.CustomLoggingFilter;
import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
import org.openecomp.portalapp.util.EPUserUtils;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
@EPAuditLog
public class WidgetsCatalogController extends EPRestrictedBaseController {
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WidgetsCatalogController.class);
- RestTemplate template = new RestTemplate();
- String whatService = "widgets-service";
+ private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WidgetsCatalogController.class);
+
+ private static final String MS_WIDGET_LOCAL_PORT = "microservices.widget.local.port";
+
+ private RestTemplate template = new RestTemplate();
+
+ private String whatService = "widgets-service";
@Autowired
private ConsulHealthService consulHealthService;
static {
// for localhost testing only
javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier(new javax.net.ssl.HostnameVerifier() {
-
public boolean verify(String hostname, javax.net.ssl.SSLSession sslSession) {
- if (hostname.equals("localhost")) {
+ if ("localhost".equals(hostname))
return true;
- }
return false;
}
- });
+ });
}
@RequestMapping(value = { "/portalApi/microservices/widgetCatalog/{loginName}" }, method = RequestMethod.GET)
- public List<WidgetCatalog> getUserWidgetCatalog(HttpServletRequest request, HttpServletResponse response,
- @PathVariable("loginName") String loginName) throws RestClientException, Exception {
+ public List<WidgetCatalog> getUserWidgetCatalog(@PathVariable("loginName") String loginName) {
List<WidgetCatalog> widgets = new ArrayList<>();
- try {CustomLoggingFilter d;
- ResponseEntity<ArrayList> ans = template.exchange(
- EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService,
- SystemProperties.getProperty("microservices.widget.local.port"))
+ try {
+ ResponseEntity<List> ans = template.exchange(
+ EcompPortalUtils.widgetMsProtocol() + "://"
+ + consulHealthService.getServiceLocation(whatService,
+ SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
+ "/widget/microservices/widgetCatalog/" + loginName,
- HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), ArrayList.class);
+ HttpMethod.GET, new HttpEntity<>(WidgetServiceHeaders.getInstance()), List.class);
widgets = ans.getBody();
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "getUserWidgetCatalog failed", e);
}
@RequestMapping(value = { "/portalApi/microservices/widgetCatalog" }, method = RequestMethod.GET)
- public List<WidgetCatalog> getWidgetCatalog(HttpServletRequest request, HttpServletResponse response)
- throws RestClientException, Exception {
+ public List<WidgetCatalog> getWidgetCatalog() {
List<WidgetCatalog> widgets = new ArrayList<>();
-
- String p = EcompPortalUtils.widgetMsProtocol();
try {
- ResponseEntity<ArrayList> ans = template.exchange(
- EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService,
- SystemProperties.getProperty("microservices.widget.local.port"))
+ ResponseEntity<List> ans = template.exchange(
+ EcompPortalUtils.widgetMsProtocol() + "://"
+ + consulHealthService.getServiceLocation(whatService,
+ SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
+ "/widget/microservices/widgetCatalog",
- HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), ArrayList.class);
+ HttpMethod.GET, new HttpEntity<>(WidgetServiceHeaders.getInstance()), List.class);
widgets = ans.getBody();
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "getWidgetCatalog failed", e);
@RequestMapping(value = {
"/portalApi/microservices/widgetCatalog/{widgetId}" }, method = RequestMethod.PUT, produces = "application/json")
- public void updateWidgetCatalog(HttpServletRequest request, HttpServletResponse response,
- @RequestBody WidgetCatalog newWidgetCatalog, @PathVariable("widgetId") long widgetId)
- throws RestClientException, Exception {
+ public void updateWidgetCatalog(@RequestBody WidgetCatalog newWidgetCatalog, @PathVariable("widgetId") long widgetId) throws Exception {
template.exchange(
- EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService,
- SystemProperties.getProperty("microservices.widget.local.port"))
+ EcompPortalUtils.widgetMsProtocol() + "://"
+ + consulHealthService.getServiceLocation(whatService,
+ SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
+ "/widget/microservices/widgetCatalog/" + widgetId,
- HttpMethod.PUT, new HttpEntity(newWidgetCatalog, WidgetServiceHeaders.getInstance()), String.class);
+ HttpMethod.PUT, new HttpEntity<>(newWidgetCatalog, WidgetServiceHeaders.getInstance()), String.class);
}
@RequestMapping(value = { "/portalApi/microservices/widgetCatalog/{widgetId}" }, method = RequestMethod.DELETE)
- public void deleteOnboardingWidget(HttpServletRequest request, HttpServletResponse response,
- @PathVariable("widgetId") long widgetId) throws RestClientException, Exception {
+ public void deleteOnboardingWidget(@PathVariable("widgetId") long widgetId) throws Exception {
template.exchange(
- EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService,
- SystemProperties.getProperty("microservices.widget.local.port"))
+ EcompPortalUtils.widgetMsProtocol() + "://"
+ + consulHealthService.getServiceLocation(whatService,
+ SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
+ "/widget/microservices/widgetCatalog/" + widgetId,
- HttpMethod.DELETE, new HttpEntity(WidgetServiceHeaders.getInstance()), String.class);
+ HttpMethod.DELETE, new HttpEntity<>(WidgetServiceHeaders.getInstance()), String.class);
}
@RequestMapping(value = { "/portalApi/microservices/widgetCatalog/{widgetId}" }, method = RequestMethod.POST)
- public String updateWidgetCatalogWithFiles(HttpServletRequest request, HttpServletResponse response,
+ public String updateWidgetCatalogWithFiles(HttpServletRequest request,
@PathVariable("widgetId") long widgetId) throws RestClientException, Exception {
MultipartHttpServletRequest mRequest;
MultiValueMap<String, Object> multipartRequest = new LinkedMultiValueMap<>();
String fileName;
- String tmp_folder = "/tmp/";
+ String tmpFolderName = "/tmp/";
String respond = null;
FileOutputStream fo = null;
try {
mRequest = (MultipartHttpServletRequest) request;
MultipartFile mFile = mRequest.getFile("file");
fileName = mFile.getOriginalFilename();
- fo = new FileOutputStream(tmp_folder + fileName);
+ fo = new FileOutputStream(tmpFolderName + fileName);
fo.write(mFile.getBytes());
+ // silence sonar scan by calling close here
+ fo.close();
+ fo = null;
HttpHeaders header = new HttpHeaders();
header.setContentType(MediaType.MULTIPART_FORM_DATA);
- multipartRequest.add("file", new FileSystemResource(tmp_folder + fileName));
+ multipartRequest.add("file", new FileSystemResource(tmpFolderName + fileName));
multipartRequest.add("widget", request.getParameter("newWidget"));
respond = template.postForObject(
- EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService,
- SystemProperties.getProperty("microservices.widget.local.port"))
+ EcompPortalUtils.widgetMsProtocol() + "://"
+ + consulHealthService.getServiceLocation(whatService,
+ SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
+ "/widget/microservices/widgetCatalog/" + widgetId,
new HttpEntity<>(multipartRequest, WidgetServiceHeaders.getInstance()), String.class);
- File f = new File(tmp_folder + fileName);
+ File f = new File(tmpFolderName + fileName);
f.delete();
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "updateWidgetCatalogWithFiles failed", e);
}
@RequestMapping(value = { "/portalApi/microservices/widgetCatalog" }, method = RequestMethod.POST)
- public String createWidgetCatalog(HttpServletRequest request, HttpServletResponse response)
- throws RestClientException, Exception {
+ public String createWidgetCatalog(HttpServletRequest request)
+ throws Exception {
MultipartHttpServletRequest mRequest;
MultiValueMap<String, Object> multipartRequest = new LinkedMultiValueMap<>();
String fileName;
- String tmp_folder = "/tmp/";
+ String tmpFolderName = "/tmp/";
String respond = null;
FileOutputStream fo = null;
try {
mRequest = (MultipartHttpServletRequest) request;
MultipartFile mFile = mRequest.getFile("file");
fileName = mFile.getOriginalFilename();
- fo = new FileOutputStream(tmp_folder + fileName);
+ fo = new FileOutputStream(tmpFolderName + fileName);
fo.write(mFile.getBytes());
+ // silence sonar scan by calling close here
+ fo.close();
+ fo = null;
HttpHeaders header = new HttpHeaders();
header.setContentType(MediaType.MULTIPART_FORM_DATA);
- multipartRequest.add("file", new FileSystemResource(tmp_folder + fileName));
+ multipartRequest.add("file", new FileSystemResource(tmpFolderName + fileName));
multipartRequest.add("widget", request.getParameter("newWidget"));
respond = template.postForObject(
- EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService,
- SystemProperties.getProperty("microservices.widget.local.port"))
+ EcompPortalUtils.widgetMsProtocol() + "://"
+ + consulHealthService.getServiceLocation(whatService,
+ SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
+ "/widget/microservices/widgetCatalog",
new HttpEntity<>(multipartRequest, WidgetServiceHeaders.getInstance()), String.class);
- File f = new File(tmp_folder + fileName);
+ File f = new File(tmpFolderName + fileName);
f.delete();
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "createWidgetCatalog failed", e);
}
@RequestMapping(value = "/portalApi/microservices/{widgetId}/framework.js", method = RequestMethod.GET)
- public String getWidgetFramework(HttpServletRequest request, HttpServletResponse response,
- @PathVariable("widgetId") long widgetId) throws RestClientException, Exception {
+ public String getWidgetFramework(@PathVariable("widgetId") long widgetId) throws Exception {
return template.getForObject(EcompPortalUtils.widgetMsProtocol() + "://"
+ consulHealthService.getServiceLocation(whatService,
- SystemProperties.getProperty("microservices.widget.local.port"))
+ SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
+ "/widget/microservices/" + widgetId + "/framework.js", String.class,
WidgetServiceHeaders.getInstance());
}
@RequestMapping(value = "/portalApi/microservices/{widgetId}/controller.js", method = RequestMethod.GET)
- public String getWidgetController(HttpServletRequest request, HttpServletResponse response,
- @PathVariable("widgetId") long widgetId) throws RestClientException, Exception {
+ public String getWidgetController(@PathVariable("widgetId") long widgetId) throws Exception {
return template.getForObject(EcompPortalUtils.widgetMsProtocol() + "://"
+ consulHealthService.getServiceLocation(whatService,
- SystemProperties.getProperty("microservices.widget.local.port"))
+ SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
+ "/widget/microservices/" + widgetId + "/controller.js", String.class,
WidgetServiceHeaders.getInstance());
}
@RequestMapping(value = "/portalApi/microservices/{widgetId}/style.css", method = RequestMethod.GET)
- public String getWidgetCSS(HttpServletRequest request, HttpServletResponse response,
- @PathVariable("widgetId") long widgetId) throws RestClientException, Exception {
+ public String getWidgetCSS(@PathVariable("widgetId") long widgetId) throws Exception {
return template.getForObject(EcompPortalUtils.widgetMsProtocol() + "://"
+ consulHealthService.getServiceLocation(whatService,
- SystemProperties.getProperty("microservices.widget.local.port"))
+ SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
+ "/widget/microservices/" + widgetId + "/styles.css", String.class,
WidgetServiceHeaders.getInstance());
}
@RequestMapping(value = { "/portalApi/microservices/parameters/{widgetId}" }, method = RequestMethod.GET)
public PortalRestResponse<List<WidgetParameterResult>> getWidgetParameterResult(HttpServletRequest request,
- HttpServletResponse response, @PathVariable("widgetId") long widgetId) throws Exception {
+ @PathVariable("widgetId") long widgetId) throws Exception {
EPUser user = EPUserUtils.getUserSession(request);
List<WidgetParameterResult> list = new ArrayList<>();
Long serviceId = template.exchange(
- EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService,
- SystemProperties.getProperty("microservices.widget.local.port"))
+ EcompPortalUtils.widgetMsProtocol() + "://"
+ + consulHealthService.getServiceLocation(whatService,
+ SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
+ "/widget/microservices/widgetCatalog/parameters/" + widgetId,
- HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), Long.class).getBody();
+ HttpMethod.GET, new HttpEntity<>(WidgetServiceHeaders.getInstance()), Long.class).getBody();
if (serviceId == null) {
// return ok/sucess and no service parameter for this widget
return new PortalRestResponse<List<WidgetParameterResult>>(PortalRestStatusEnum.WARN,
} else {
List<MicroserviceParameter> defaultParam = microserviceService.getParametersById(serviceId);
for (MicroserviceParameter param : defaultParam) {
- WidgetParameterResult user_result = new WidgetParameterResult();
- user_result.setParam_id(param.getId());
- user_result.setDefault_value(param.getPara_value());
- user_result.setParam_key(param.getPara_key());
+ WidgetParameterResult userResult = new WidgetParameterResult();
+ userResult.setParam_id(param.getId());
+ userResult.setDefault_value(param.getPara_value());
+ userResult.setParam_key(param.getPara_key());
WidgetCatalogParameter userValue = widgetParameterService.getUserParamById(widgetId, user.getId(),
param.getId());
if (userValue == null)
- user_result.setUser_value(param.getPara_value());
+ userResult.setUser_value(param.getPara_value());
else {
- user_result.setUser_value(userValue.getUser_value());
+ userResult.setUser_value(userValue.getUser_value());
}
- list.add(user_result);
+ list.add(userResult);
}
}
return new PortalRestResponse<List<WidgetParameterResult>>(PortalRestStatusEnum.OK, "SUCCESS", list);
}
@RequestMapping(value = { "/portalApi/microservices/services/{paramId}" }, method = RequestMethod.GET)
- public List<WidgetCatalogParameter> getUserParameterById(HttpServletRequest request, HttpServletResponse response,
- @PathVariable("paramId") long paramId) throws Exception {
+ public List<WidgetCatalogParameter> getUserParameterById( @PathVariable("paramId") long paramId) {
List<WidgetCatalogParameter> list = widgetParameterService.getUserParameterById(paramId);
return list;
}
@RequestMapping(value = { "/portalApi/microservices/services/{paramId}" }, method = RequestMethod.DELETE)
- public void deleteUserParameterById(HttpServletRequest request, HttpServletResponse response,
- @PathVariable("paramId") long paramId) throws Exception {
+ public void deleteUserParameterById(@PathVariable("paramId") long paramId) {
widgetParameterService.deleteUserParameterById(paramId);
}
@RequestMapping(value = { "/portalApi/microservices/download/{widgetId}" }, method = RequestMethod.GET)
public void doDownload(HttpServletRequest request, HttpServletResponse response,
- @PathVariable("widgetId") long widgetId) throws RestClientException, Exception {
+ @PathVariable("widgetId") long widgetId) throws Exception {
ServletContext context = request.getServletContext();
- byte[] byteFile = template.exchange(
- EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService,
- SystemProperties.getProperty("microservices.widget.local.port"))
- + "/widget/microservices/download/" + widgetId,
- HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), byte[].class).getBody();
+ byte[] byteFile = template
+ .exchange(
+ EcompPortalUtils.widgetMsProtocol() + "://"
+ + consulHealthService.getServiceLocation(whatService,
+ SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
+ + "/widget/microservices/download/" + widgetId,
+ HttpMethod.GET, new HttpEntity<>(WidgetServiceHeaders.getInstance()), byte[].class)
+ .getBody();
File downloadFile = File.createTempFile("temp", ".zip");
FileOutputStream stream = new FileOutputStream(downloadFile.getPath());
OutputStream outStream = response.getOutputStream();
byte[] buffer = new byte[32 * 1024];
- int bytesRead = -1;
+ int bytesRead;
while ((bytesRead = inputStream.read(buffer)) != -1) {
outStream.write(buffer, 0, bytesRead);
}
}
@RequestMapping(value = { "/portalApi/microservices/parameters" }, method = RequestMethod.POST)
- public PortalRestResponse<String> saveWidgetParameter(HttpServletRequest request, HttpServletResponse response,
- @RequestBody WidgetCatalogParameter widgetParameters) throws Exception {
+ public PortalRestResponse<String> saveWidgetParameter(HttpServletRequest request,
+ @RequestBody WidgetCatalogParameter widgetParameters) {
EPUser user = EPUserUtils.getUserSession(request);
widgetParameters.setUserId(user.getId());
try {
widgetParameterService.saveUserParameter(widgetParameters);
} catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "saveWidgetParameter failed", e);
return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE", e.getMessage());
}
return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "SUCCESS", "");
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import org.openecomp.portalsdk.core.domain.support.DomainVo;
import com.fasterxml.jackson.annotation.JsonIgnore;
@SuppressWarnings("rawtypes")
-public class CentralRoleFunction extends DomainVo implements java.io.Serializable, Comparable{
-
- /**
- *
- */
+public class CentralRoleFunction extends DomainVo implements java.io.Serializable, Comparable {
+
+ /**
+ *
+ */
private static final long serialVersionUID = -4018975640065252688L;
- private String code;
- private String name;
- @JsonIgnore
- private Long appId;
- @JsonIgnore
- private Long roleId;
- private String editUrl;
-
-
+ private String code;
+ private String name;
+ @JsonIgnore
+ private Long appId;
+ @JsonIgnore
+ private Long roleId;
+ private String editUrl;
+
public CentralRoleFunction() {
-
+
}
-
-
+
public CentralRoleFunction(Long id, String code, String name, Long appId, String editUrl) {
super();
this.id = id;
public String getCode() {
return code;
}
+
/**
- * @param code the code to set
+ * @param code
+ * the code to set
*/
public void setCode(String code) {
this.code = code;
}
+
/**
* @return the name
*/
public String getName() {
return name;
}
+
/**
- * @param name the name to set
+ * @param name
+ * the name to set
*/
public void setName(String name) {
this.name = name;
}
+
/**
* @return the appId
*/
public Long getAppId() {
return appId;
}
+
/**
- * @param appId the appId to set
+ * @param appId
+ * the appId to set
*/
public void setAppId(Long appId) {
this.appId = appId;
}
+
/**
* @return the editUrl
*/
public String getEditUrl() {
return editUrl;
}
+
/**
- * @param editUrl the editUrl to set
+ * @param editUrl
+ * the editUrl to set
*/
public void setEditUrl(String editUrl) {
this.editUrl = editUrl;
}
- public int compareTo(Object obj){
- String c1 = getName();
- String c2 = ((CentralRoleFunction)obj).getName();
-
- return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2);
- }
-
-
-
+
+ public int compareTo(Object obj) {
+ String c1 = getName();
+ String c2 = ((CentralRoleFunction) obj).getName();
+
+ return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2);
+ }
+
}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import org.openecomp.portalsdk.core.domain.support.DomainVo;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import org.openecomp.portalsdk.core.domain.support.DomainVo;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import org.openecomp.portalsdk.core.domain.support.DomainVo;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import java.util.List;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.domain;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.ecomp.model;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.ecomp.model;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.ecomp.model;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.ecomp.model;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.ecomp.model;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.ecomp.model;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.ecomp.model;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.exceptions;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================*/
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.interceptor;
import java.nio.charset.Charset;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.listener;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.listener;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.listener;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.ApplicationContext;
-import org.springframework.util.StringUtils;
-
+import org.openecomp.portalapp.portal.domain.EPUser;
+import org.openecomp.portalapp.portal.service.SharedContextService;
import org.openecomp.portalsdk.core.domain.support.CollaborateList;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.service.SharedContextService;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationContext;
+import org.springframework.util.StringUtils;
/**
* Listens for session-create and session-destroy events.
* invalidated.
*/
public void sessionDestroyed(HttpSessionEvent event) {
-
try {
HttpSession session = event.getSession();
ServletContext context = session.getServletContext();
EPUser user = (EPUser) session
.getAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME));
- if (user!=null && !StringUtils.isEmpty(user.getOrgUserId())) {
+ if (user != null && !StringUtils.isEmpty(user.getOrgUserId())) {
CollaborateList.delUserName(user.getOrgUserId());
}
// Remove any shared context entries for this session.
- if (getSharedContextService()!=null) {
+ if (getSharedContextService() != null) {
getSharedContextService().deleteSharedContexts(session.getId());
-
+
// Clean the shared context each time a session is destroyed.
// TODO: move the threshold to configuration file.
getSharedContextService().expireSharedContexts(60 * 60 * 8);
logger.info(EELFLoggerDelegate.debugLogger, "Session Destroyed : " + session.getId());
} catch (Exception e) {
- logger.warn(EELFLoggerDelegate.errorLogger, "Exception occurred while executing sessionDestroyed. Details: " + EcompPortalUtils.getStackTrace(e));
+ logger.warn(EELFLoggerDelegate.errorLogger, "sessionDestroyed failed", e);
}
}
-
+
private static ApplicationContext applicationContext;
public static void setApplicationContext(ApplicationContext _applicationContext) {
}
public SharedContextService getSharedContextService() {
- if(sharedContextService == null){
- if (applicationContext != null)
- sharedContextService = (SharedContextService)applicationContext.getBean("sharedContextService");
+ if (sharedContextService == null) {
+ if (applicationContext != null)
+ sharedContextService = (SharedContextService) applicationContext.getBean("sharedContextService");
}
-
+
return sharedContextService;
}
this.sharedContextService = sharedContextService;
}
}
-
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.logging.aop;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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,
+ * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.logging.aop;
* @param securityEventType
* @param args
* @param passOnArgs
- * @return
+ * @return Object array
*/
public Object[] before(SecurityEventTypeEnum securityEventType, Object[] args, Object[] passOnArgs) {
String className = "";
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.logging.aop;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.logging.format;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.logging.format;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.logging.logic;
import org.openecomp.portalsdk.core.logging.format.AlarmSeverityEnum;
import org.openecomp.portalsdk.core.logging.format.ErrorSeverityEnum;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.web.support.UserUtils;
import org.slf4j.MDC;
import org.springframework.http.HttpStatus;
* specified parameters, using log level info, warn or error appropriate for
* the specified severity
*
- * @param classLogger
- * Logger for the class where the error occurred; the logger
- * carries the class name.
* @param epMessageEnum
* Enum carrying alarm and error severity
* @param param
errorLogger.error(resolution);
}
} catch (Exception e) {
- errorLogger.error("Failed to log the error code. Details: " + UserUtils.getStackTrace(e));
+ errorLogger.error("logEcompError failed", e);
} finally {
MDC.remove("ErrorCode");
MDC.remove("ErrorDescription");
/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ============LICENSE_END=========================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.scheduler;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.scheduler;
import org.openecomp.portalsdk.core.util.SystemProperties;
+public class SchedulerProperties extends SystemProperties {
+
+ public static final String SCHEDULER_USER_NAME_VAL = "scheduler.user.name";;
-public class SchedulerProperties extends SystemProperties {
-
- public static final String SCHEDULER_USER_NAME_VAL = "scheduler.user.name";;
-
public static final String SCHEDULER_PASSWORD_VAL = "scheduler.password";
-
+
public static final String SCHEDULER_SERVER_URL_VAL = "scheduler.server.url";
-
+
public static final String SCHEDULER_CREATE_NEW_VNF_CHANGE_INSTANCE_VAL = "scheduler.create.new.vnf.change.instance";
-
+
public static final String SCHEDULER_GET_TIME_SLOTS = "scheduler.get.time.slots";
-
+
public static final String SCHEDULER_SUBMIT_NEW_VNF_CHANGE = "scheduler.submit.new.vnf.change";
}
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.scheduler;
import com.fasterxml.jackson.annotation.JsonInclude;
/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ============LICENSE_END=========================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.scheduler;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.scheduler;
import java.util.Collections;
-
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.scheduler;
public class SchedulerRestInterfaceFactory {
-
- public static SchedulerRestInterfaceIfc getInstance () {
+ public static SchedulerRestInterfaceIfc getInstance() {
SchedulerRestInterfaceIfc obj = null;
obj = new SchedulerRestInterface();
-
- return ( obj );
+
+ return (obj);
}
}
-
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.scheduler;
import org.json.simple.JSONObject;
import org.springframework.stereotype.Service;
import org.openecomp.portalapp.portal.scheduler.restobjects.RestObject;
-
@Service
public interface SchedulerRestInterfaceIfc {
public void initRestClient();
- public <T> void Get(T t, String sourceId, String path, org.openecomp.portalapp.portal.scheduler.restobjects.RestObject<T> restObject ) throws Exception;
+ public <T> void Get(T t, String sourceId, String path,
+ org.openecomp.portalapp.portal.scheduler.restobjects.RestObject<T> restObject) throws Exception;
public <T> void Delete(T t, JSONObject requestDetails, String sourceID, String path, RestObject<T> restObject)
throws Exception;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.scheduler;
import java.text.DateFormat;
import com.fasterxml.jackson.databind.ObjectMapper;
public class SchedulerUtil {
-
+
private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SchedulerUtil.class);
-
+
final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
- public static GetTimeSlotsWrapper getTimeSlotsWrapResponse (GetTimeSlotsRestObject<String> rs) {
-
+ public static GetTimeSlotsWrapper getTimeSlotsWrapResponse(GetTimeSlotsRestObject<String> rs) {
+
String resp_str = "";
int status = 0;
-
- if ( rs != null ) {
+
+ if (rs != null) {
resp_str = rs.get();
status = rs.getStatusCode();
}
-
+
GetTimeSlotsWrapper w = new GetTimeSlotsWrapper();
-
+
w.setEntity(resp_str);
- w.setStatus (status);
-
+ w.setStatus(status);
+
return (w);
}
-
- public static PostSubmitVnfChangeTimeSlotsWrapper postSubmitNewVnfWrapResponse (PostSubmitVnfChangeRestObject<String> rs) {
-
+
+ public static PostSubmitVnfChangeTimeSlotsWrapper postSubmitNewVnfWrapResponse(
+ PostSubmitVnfChangeRestObject<String> rs) {
+
String resp_str = "";
int status = 0;
String uuid = "";
-
- if ( rs != null ) {
+
+ if (rs != null) {
resp_str = rs.get();
status = rs.getStatusCode();
uuid = rs.getUUID();
}
-
+
PostSubmitVnfChangeTimeSlotsWrapper w = new PostSubmitVnfChangeTimeSlotsWrapper();
-
+
w.setEntity(resp_str);
- w.setStatus (status);
+ w.setStatus(status);
w.setUuid(uuid);
-
+
return (w);
}
-
- public static PostCreateNewVnfWrapper postCreateNewVnfWrapResponse (PostCreateNewVnfRestObject<String> rs) {
-
+
+ public static PostCreateNewVnfWrapper postCreateNewVnfWrapResponse(PostCreateNewVnfRestObject<String> rs) {
+
String resp_str = "";
int status = 0;
String uuid = "";
-
- if ( rs != null ) {
+
+ if (rs != null) {
resp_str = rs.get();
status = rs.getStatusCode();
uuid = rs.getUUID();
}
-
+
PostCreateNewVnfWrapper w = new PostCreateNewVnfWrapper();
-
+
w.setEntity(resp_str);
- w.setStatus (status);
+ w.setStatus(status);
w.setUuid(uuid);
-
+
return (w);
}
-
- public static <T> String convertPojoToString ( T t ) throws com.fasterxml.jackson.core.JsonProcessingException {
-
+
+ public static <T> String convertPojoToString(T t) throws com.fasterxml.jackson.core.JsonProcessingException {
+
String methodName = "convertPojoToString";
ObjectMapper mapper = new ObjectMapper();
String r_json_str = "";
- if ( t != null ) {
- try {
- r_json_str = mapper.writeValueAsString(t);
- }
- catch ( com.fasterxml.jackson.core.JsonProcessingException j ) {
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " Unable to parse object as json");
- }
- }
- return (r_json_str);
+ if (t != null) {
+ try {
+ r_json_str = mapper.writeValueAsString(t);
+ } catch (com.fasterxml.jackson.core.JsonProcessingException j) {
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ dateFormat.format(new Date()) + "<== " + methodName + " Unable to parse object as json");
+ }
+ }
+ return (r_json_str);
}
-
+
}
/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ============LICENSE_END=========================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.scheduler.client;
/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ============LICENSE_END=========================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.scheduler.client;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.scheduler.policy;
import org.openecomp.portalsdk.core.util.SystemProperties;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.scheduler.policy;
import com.fasterxml.jackson.annotation.JsonInclude;
/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ============LICENSE_END=========================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.scheduler.policy;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.scheduler.policy;
import java.text.DateFormat;
-
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.scheduler.policy;
public class PolicyRestInterfaceFactory {
-
- public static PolicyRestInterfaceIfc getInstance () {
+ public static PolicyRestInterfaceIfc getInstance() {
PolicyRestInterfaceIfc obj = null;
obj = new PolicyRestInterface();
-
- return ( obj );
+
+ return (obj);
}
}
\ No newline at end of file
-
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.scheduler.policy;
import org.json.simple.JSONObject;
import org.openecomp.portalapp.portal.scheduler.policy.rest.RequestDetails;
-public interface PolicyRestInterfaceIfc {
+public interface PolicyRestInterfaceIfc {
/**
* Inits the rest client.
*/
public void initRestClient();
-
+
/**
* Gets the.
*
- * @param <T> the generic type
- * @param t the t
- * @param sourceId the source id
- * @param path the path
- * @param restObject the rest object
- * @throws Exception the exception
+ * @param <T>
+ * the generic type
+ * @param t
+ * the t
+ * @param sourceId
+ * the source id
+ * @param path
+ * the path
+ * @param restObject
+ * the rest object
+ * @throws Exception
+ * the exception
*/
- public <T> void Get (T t, String sourceId, String path, RestObject<T> restObject ) throws Exception;
-
+ public <T> void Get(T t, String sourceId, String path, RestObject<T> restObject) throws Exception;
+
/**
* Delete.
*
- * @param <T> the generic type
- * @param t the t
- * @param r the r
- * @param sourceID the source ID
- * @param path the path
- * @param restObject the rest object
- * @throws Exception the exception
+ * @param <T>
+ * the generic type
+ * @param t
+ * the t
+ * @param r
+ * the r
+ * @param sourceID
+ * the source ID
+ * @param path
+ * the path
+ * @param restObject
+ * the rest object
+ * @throws Exception
+ * the exception
*/
- public <T> void Delete(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) throws Exception;
-
+ public <T> void Delete(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject)
+ throws Exception;
+
/**
* Post.
*
- * @param <T> the generic type
- * @param t the t
- * @param r the r
- * @param sourceID the source ID
- * @param path the path
- * @param restObject the rest object
- * @throws Exception the exception
+ * @param <T>
+ * the generic type
+ * @param t
+ * the t
+ * @param r
+ * the r
+ * @param sourceID
+ * the source ID
+ * @param path
+ * the path
+ * @param restObject
+ * the rest object
+ * @throws Exception
+ * the exception
*/
public <T> void Post(T t, JSONObject r, String sourceID, String path, RestObject<T> restObject) throws Exception;
-
+
/***
* Log request.
*
- * @param r the r
+ * @param r
+ * the r
*/
- public void logRequest ( RequestDetails r );
-
+ public void logRequest(RequestDetails r);
+
}
\ No newline at end of file
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.scheduler.policy;
import java.text.DateFormat;
/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ============LICENSE_END=========================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.scheduler.policy;
/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ============LICENSE_END=========================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.scheduler.policy.rest;
/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ============LICENSE_END=========================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.scheduler.properties;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.scheduler.restobjects;
public class GetTimeSlotsRestObject<T> extends RestObject<T> {
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.scheduler.restobjects;
public class PostCreateNewVnfRestObject<T> extends RestObject<T> {
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.scheduler.restobjects;
public class PostSubmitVnfChangeRestObject<T> extends RestObject<T> {
/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ============LICENSE_END=========================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.scheduler.restobjects;
/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ============LICENSE_END=========================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.scheduler.util;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.scheduler.wrapper;
public class GetTimeSlotsWrapper extends SchedulerResponseWrapper {
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.scheduler.wrapper;
import org.apache.commons.lang.builder.ToStringBuilder;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.scheduler.wrapper;
import org.apache.commons.lang.builder.ToStringBuilder;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.scheduler.wrapper;
import com.fasterxml.jackson.annotation.JsonInclude;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
private Long ACCOUNT_ADMIN_ROLE_ID = 999L;
private Long ECOMP_APP_ID = 1L;
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AdminRolesServiceImpl.class);
+ private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AdminRolesServiceImpl.class);
@Autowired
private SessionFactory sessionFactory;
@Autowired
private DataAccessService dataAccessService;
@Autowired
- SearchService searchService;
+ private SearchService searchService;
@Autowired
- EPAppService appsService;
-
- RestTemplate template = new RestTemplate();
-
+ private EPAppService appsService;
+
+ private RestTemplate template = new RestTemplate();
+
@PostConstruct
private void init() {
try {
SYS_ADMIN_ROLE_ID = Long.valueOf(SystemProperties.getProperty(EPCommonSystemProperties.SYS_ADMIN_ROLE_ID));
- ACCOUNT_ADMIN_ROLE_ID = Long.valueOf(SystemProperties.getProperty(EPCommonSystemProperties.ACCOUNT_ADMIN_ROLE_ID));
+ ACCOUNT_ADMIN_ROLE_ID = Long
+ .valueOf(SystemProperties.getProperty(EPCommonSystemProperties.ACCOUNT_ADMIN_ROLE_ID));
ECOMP_APP_ID = Long.valueOf(SystemProperties.getProperty(EPCommonSystemProperties.ECOMP_APP_ID));
- } catch(Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
+ } catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "init failed", e);
}
}
-
+
@Override
@EPMetricsLog
@SuppressWarnings("unchecked")
AppsListWithAdminRole appsListWithAdminRole = null;
try {
- List<EPUser> userList = dataAccessService.getList(EPUser.class, " where orgUserId = '" + orgUserId + "'", null,
- null);
+ List<EPUser> userList = dataAccessService.getList(EPUser.class, " where orgUserId = '" + orgUserId + "'",
+ null, null);
HashMap<Long, Long> appsUserAdmin = new HashMap<Long, Long>();
if (userList.size() > 0) {
EPUser user = userList.get(0);
userAppList = dataAccessService.getList(EPUserApp.class,
" where userId = " + user.getId() + " and role.id = " + ACCOUNT_ADMIN_ROLE_ID, null, null);
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "getAppsWithAdminRoleStateForUser 1 failed", e);
EPLogUtil.logEcompError(EPAppMessagesEnum.BeDaoSystemError);
}
for (EPUserApp userApp : userAppList) {
appsListWithAdminRole.orgUserId = orgUserId;
List<EPApp> appsList = null;
try {
- appsList = dataAccessService.getList(EPApp.class, " where ( enabled = 'Y' or id = " + ECOMP_APP_ID + ")", null, null);
+ appsList = dataAccessService.getList(EPApp.class,
+ " where ( enabled = 'Y' or id = " + ECOMP_APP_ID + ")", null, null);
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "getAppsWithAdminRoleStateForUser 2 failed", e);
EPLogUtil.logEcompError(EPAppMessagesEnum.BeDaoSystemError);
}
for (EPApp app : appsList) {
AppNameIdIsAdmin appNameIdIsAdmin = new AppNameIdIsAdmin();
appNameIdIsAdmin.id = app.getId();
- appNameIdIsAdmin.appName = app.getName();
+ appNameIdIsAdmin.appName = app.getName();
appNameIdIsAdmin.isAdmin = new Boolean(appsUserAdmin.containsKey(app.getId()));
appNameIdIsAdmin.restrictedApp = app.isRestrictedApp();
appsListWithAdminRole.appsRoles.add(appNameIdIsAdmin);
}
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while performing AdminRolesServiceImpl.getAppsWithAdminRoleStateForUser operation, Details:"
- + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "getAppsWithAdminRoleStateForUser 3 failed", e);
}
return appsListWithAdminRole;
EPUser user = null;
boolean createNewUser = false;
String orgUserId = newAppsListWithAdminRoles.orgUserId.trim();
- List<EPUser> localUserList = dataAccessService.getList(EPUser.class, " where org_user_id='" + orgUserId + "'",
- null, null);
+ List<EPUser> localUserList = dataAccessService.getList(EPUser.class,
+ " where org_user_id='" + orgUserId + "'", null, null);
List<EPUserApp> oldAppsWhereUserIsAdmin = new ArrayList<EPUserApp>();
if (localUserList.size() > 0) {
EPUser tmpUser = localUserList.get(0);
localSession.save(EPUserApp.class.getName(), newUserApp);
}
transaction.commit();
-
- // Add user admin role for list of centralized applications in external system
+
+ // Add user admin role for list of centralized applications in external system
result = addAdminRoleInExternalSystem(user, localSession, newAppsWhereUserIsAdmin);
} catch (Exception e) {
EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
- logger.error(EELFLoggerDelegate.errorLogger, "setAppsWithAdminRoleStateForUser: exception in point 2", e);
+ logger.error(EELFLoggerDelegate.errorLogger,
+ "setAppsWithAdminRoleStateForUser: exception in point 2", e);
try {
if(transaction!=null)
transaction.rollback();
logger.error(EELFLoggerDelegate.errorLogger, "setAppsWithAdminRoleStateForUser: transaction is null cannot rollback");
} catch (Exception ex) {
EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeExecuteRollbackError, e);
- logger.error(EELFLoggerDelegate.errorLogger, "setAppsWithAdminRoleStateForUser: exception in point 3", ex);
+ logger.error(EELFLoggerDelegate.errorLogger,
+ "setAppsWithAdminRoleStateForUser: exception in point 3", ex);
}
} finally {
try {
localSession.close();
} catch (Exception e) {
EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoCloseSessionError, e);
- logger.error(EELFLoggerDelegate.errorLogger, "setAppsWithAdminRoleStateForUser: exception in point 4", e);
+ logger.error(EELFLoggerDelegate.errorLogger,
+ "setAppsWithAdminRoleStateForUser: exception in point 4", e);
}
}
}
}
@SuppressWarnings("unchecked")
- private boolean addAdminRoleInExternalSystem(EPUser user, Session localSession, List<AppNameIdIsAdmin> newAppsWhereUserIsAdmin) {
+ private boolean addAdminRoleInExternalSystem(EPUser user, Session localSession,
+ List<AppNameIdIsAdmin> newAppsWhereUserIsAdmin) {
boolean result = false;
try {
// Reset All admin role for centralized applications
if (e.getMessage().equalsIgnoreCase("404 Not Found")) {
logger.debug(EELFLoggerDelegate.debugLogger, "Application Not found for app {}",
app.getNameSpace(), e.getMessage());
- } else{
+ } else {
logger.error(EELFLoggerDelegate.errorLogger, "Application Not found for app {}",
app.getNameSpace(), e);
}
} catch (Exception e) {
if (e.getMessage().equalsIgnoreCase("404 Not Found")) {
logger.debug(EELFLoggerDelegate.errorLogger,
- "Application name space not found in External system for app {} due to bad rquest name space ", app.getNameSpace(),
- e.getMessage());
+ "Application name space not found in External system for app {} due to bad rquest name space ",
+ app.getNameSpace(), e.getMessage());
} else {
logger.error(EELFLoggerDelegate.errorLogger, "Failed to assign admin role for application {}",
app.getNameSpace(), e);
}
} catch (Exception e) {
EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
- logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while executing isSuperAdmin operation", e);
+ logger.error(EELFLoggerDelegate.errorLogger,
+ "Exception occurred while executing isSuperAdmin operation", e);
}
}
// else
public boolean isAccountAdmin(EPUser user) {
try {
EPUser currentUser = user != null
- ? (EPUser) dataAccessService.getDomainObject(EPUser.class, user.getId(), null) : null;
+ ? (EPUser) dataAccessService.getDomainObject(EPUser.class, user.getId(), null)
+ : null;
if (currentUser != null && currentUser.getId() != null) {
for (EPUserApp userApp : currentUser.getEPUserApps()) {
- if (//!userApp.getApp().getId().equals(ECOMP_APP_ID)
- // &&
- userApp.getRole().getId().equals(ACCOUNT_ADMIN_ROLE_ID)) {
+ if (// !userApp.getApp().getId().equals(ECOMP_APP_ID)
+ // &&
+ userApp.getRole().getId().equals(ACCOUNT_ADMIN_ROLE_ID)) {
// Account Administrator sees only the applications
// he/she is Administrator
return true;
}
} catch (Exception e) {
EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
- logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while executing isAccountAdmin operation", e);
+ logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while executing isAccountAdmin operation",
+ e);
}
return false;
}
public boolean isUser(EPUser user) {
try {
EPUser currentUser = user != null
- ? (EPUser) dataAccessService.getDomainObject(EPUser.class, user.getId(), null) : null;
+ ? (EPUser) dataAccessService.getDomainObject(EPUser.class, user.getId(), null)
+ : null;
if (currentUser != null && currentUser.getId() != null) {
for (EPUserApp userApp : currentUser.getEPUserApps()) {
if (!userApp.getApp().getId().equals(ECOMP_APP_ID)) {
String sql = "SELECT * FROM FN_ROLE WHERE UPPER(ACTIVE_YN) = 'Y' AND APP_ID = " + appId;
@SuppressWarnings("unchecked")
List<EPRole> roles = dataAccessService.executeSQLQuery(sql, EPRole.class, null);
- for (EPRole role: roles) {
+ for (EPRole role : roles) {
list.add(role);
}
return list;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal SDK
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal SDK
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal SDK
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal SDK
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
decreptedAppPwd = CipherUtil.decrypt(encriptedPwd,
SystemProperties.getProperty(SystemProperties.Decryption_Key));
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, "Unable to decrypt App name = " + externalApp,
- EcompPortalUtils.getStackTrace(e));
- logger.error(EELFLoggerDelegate.errorLogger, "Unable to decrypt App name = " + externalApp,
- EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "createClientFor failed to decrypt", e);
}
WebClient client = createClientForPath(appBaseUri, restPath);
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.service;
import java.util.List;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.service;
import java.util.ArrayList;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
transaction.commit();
result = true;
} catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "updateApp failed", e);
EcompPortalUtils.rollbackTransaction(transaction,
- "updateApp rollback, exception = " + EcompPortalUtils.getStackTrace(e));
+ "updateApp rollback, exception = " + e.toString());
} finally {
EcompPortalUtils.closeLocalSession(localSession, "updateApp");
}
EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeUebRegisterOnboardingAppError, e);
EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
EcompPortalUtils.rollbackTransaction(transaction,
- "updateApp rollback, exception = " + EcompPortalUtils.getStackTrace(e));
+ "updateApp rollback, exception = " + e.toString());
} finally {
EcompPortalUtils.closeLocalSession(localSession, "updateApp");
}
}
- public CambriaTopicManager getTopicManager(LinkedList<String> urlList, String key, String secret)
+ public CambriaTopicManager getTopicManager(List<String> urlList, String key, String secret)
throws GeneralSecurityException, Exception {
throw new Exception("This method can only be invoked from child class");
}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
import javax.naming.directory.DirContext;
import javax.naming.directory.SearchControls;
-import org.slf4j.MDC;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
+import org.openecomp.portalapp.portal.domain.EPUser;
+import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
+import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
+import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
import org.openecomp.portalsdk.core.command.support.SearchResult;
import org.openecomp.portalsdk.core.domain.support.DomainVo;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.openecomp.portalsdk.core.service.support.FusionService;
import org.openecomp.portalsdk.core.service.support.ServiceLocator;
import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
+import org.slf4j.MDC;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
@Service("epLdapService")
@Transactional
public class EPLdapServiceImpl extends FusionService implements EPLdapService {
@Autowired
private ServiceLocator serviceLocator;
-
+
EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPLdapServiceImpl.class);
@EPAuditLog
- @SuppressWarnings({ "rawtypes", "unchecked" })
- public SearchResult searchPost(DomainVo searchCriteria, String sortBy1, String sortBy2, String sortBy3,
- int pageNo, int dataSize, int userId) throws Exception {
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ public SearchResult searchPost(DomainVo searchCriteria, String sortBy1, String sortBy2, String sortBy3, int pageNo,
+ int dataSize, int userId) throws Exception {
+
+ String remoteHost = "";
- String remoteHost = "";
-
// initialize the directory context to access POST
- DirContext dirContext = serviceLocator.getDirContext(SystemProperties.getProperty(SystemProperties.POST_INITIAL_CONTEXT_FACTORY),
- SystemProperties.getProperty(SystemProperties.POST_PROVIDER_URL),
- SystemProperties.getProperty(SystemProperties.POST_SECURITY_PRINCIPAL));
-
- SearchResult searchResult = new SearchResult();
+ DirContext dirContext = serviceLocator.getDirContext(
+ SystemProperties.getProperty(SystemProperties.POST_INITIAL_CONTEXT_FACTORY),
+ SystemProperties.getProperty(SystemProperties.POST_PROVIDER_URL),
+ SystemProperties.getProperty(SystemProperties.POST_SECURITY_PRINCIPAL));
- try {
-
- remoteHost = String.format("%s/%s", SystemProperties.getProperty(SystemProperties.POST_PROVIDER_URL),
- SystemProperties.getProperty(SystemProperties.POST_SECURITY_PRINCIPAL));
- MDC.put(EPCommonSystemProperties.FULL_URL, remoteHost);
-
- String[] postAttributes = {"nickname","givenName","initials","sn","employeeNumber","mail","telephoneNumber",
- "departmentNumber","a1","street","roomNumber","l","st","postalCode","zip4","physicalDeliveryOfficeName","bc",
- "friendlyCountryName","bd","bdname","bu","buname","jtname","mgrid","a2","compcode","compdesc",
- "costcenter","silo","b2"};
+ SearchResult searchResult = new SearchResult();
- SearchControls searchControls = new SearchControls();
- searchControls.setTimeLimit(5000);
- searchControls.setReturningAttributes(postAttributes);
+ try {
- StringBuffer filterClause = new StringBuffer("(&(objectClass=*)");
+ remoteHost = String.format("%s/%s", SystemProperties.getProperty(SystemProperties.POST_PROVIDER_URL),
+ SystemProperties.getProperty(SystemProperties.POST_SECURITY_PRINCIPAL));
+ MDC.put(EPCommonSystemProperties.FULL_URL, remoteHost);
- EPUser user = (EPUser)searchCriteria;
+ String[] postAttributes = { "nickname", "givenName", "initials", "sn", "employeeNumber", "mail",
+ "telephoneNumber", "departmentNumber", "a1", "street", "roomNumber", "l", "st", "postalCode",
+ "zip4", "physicalDeliveryOfficeName", "bc", "friendlyCountryName", "bd", "bdname", "bu", "buname",
+ "jtname", "mgrid", "a2", "compcode", "compdesc", "costcenter", "silo", "b2" };
- if(Utilities.nvl(user.getFirstName()).length() > 0) {
- filterClause.append("(givenName=").append(user.getFirstName()).append("*)");
- }
- if(Utilities.nvl(user.getLastName()).length() > 0) {
- filterClause.append("(sn=").append(user.getLastName()).append("*)");
- }
- if(Utilities.nvl(user.getHrid()).length() > 0) {
- filterClause.append("(employeeNumber=").append(user.getHrid()).append("*)");
- }
- if(Utilities.nvl(user.getOrgManagerUserId()).length() > 0) {
- filterClause.append("(mgrid=").append(user.getOrgManagerUserId()).append("*)");
- }
- if(Utilities.nvl(user.getOrgCode()).length() > 0) {
- filterClause.append("(departmentNumber=").append(user.getOrgCode()).append("*)");
- }
- if(Utilities.nvl(user.getEmail()).length() > 0) {
- filterClause.append("(mail=").append(user.getEmail()).append("*)");
- }
- if(Utilities.nvl(user.getOrgUserId()).length() > 0) {
- filterClause.append("(a1=").append(user.getOrgUserId()).append("*)");
- }
- filterClause.append("(c3=N)"); // this has been added to filter CP09 entries on the LDAP server that are duplicates of existing individuals
- filterClause.append(")");
+ SearchControls searchControls = new SearchControls();
+ searchControls.setTimeLimit(5000);
+ searchControls.setReturningAttributes(postAttributes);
- List list = new ArrayList();
- if (!filterClause.toString().equals("(&(objectClass=*))")) {
- NamingEnumeration e = dirContext.search(SystemProperties.getProperty(SystemProperties.POST_PROVIDER_URL) + "/" +
- SystemProperties.getProperty(SystemProperties.POST_SECURITY_PRINCIPAL),
- filterClause.toString(),
- searchControls);
- list = processResults(e);
- }
-
- Collections.sort(list);
+ StringBuffer filterClause = new StringBuffer("(&(objectClass=*)");
- searchResult = new SearchResult(list);
- searchResult.setPageNo(pageNo);
- if(dataSize >= 0) {
- searchResult.setDataSize(dataSize);
- }
- else {
- searchResult.setDataSize(list.size());
- }
- } catch(NamingException ne) {
- String stackTrace = EcompPortalUtils.getStackTrace(ne);
- logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while performing the LDAP search. Details: " + stackTrace);
- } catch(Exception e) {
- String stackTrace = EcompPortalUtils.getStackTrace(e);
- logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while performing the LDAP search. Details: " + stackTrace);
- }
- finally {
- dirContext.close();
- }
+ EPUser user = (EPUser) searchCriteria;
- return searchResult;
- }
+ if (Utilities.nvl(user.getFirstName()).length() > 0) {
+ filterClause.append("(givenName=").append(user.getFirstName()).append("*)");
+ }
+ if (Utilities.nvl(user.getLastName()).length() > 0) {
+ filterClause.append("(sn=").append(user.getLastName()).append("*)");
+ }
+ if (Utilities.nvl(user.getHrid()).length() > 0) {
+ filterClause.append("(employeeNumber=").append(user.getHrid()).append("*)");
+ }
+ if (Utilities.nvl(user.getOrgManagerUserId()).length() > 0) {
+ filterClause.append("(mgrid=").append(user.getOrgManagerUserId()).append("*)");
+ }
+ if (Utilities.nvl(user.getOrgCode()).length() > 0) {
+ filterClause.append("(departmentNumber=").append(user.getOrgCode()).append("*)");
+ }
+ if (Utilities.nvl(user.getEmail()).length() > 0) {
+ filterClause.append("(mail=").append(user.getEmail()).append("*)");
+ }
+ if (Utilities.nvl(user.getOrgUserId()).length() > 0) {
+ filterClause.append("(a1=").append(user.getOrgUserId()).append("*)");
+ }
+ filterClause.append("(c3=N)"); // this has been added to filter CP09 entries on the LDAP server that are
+ // duplicates of existing individuals
+ filterClause.append(")");
+ List list = new ArrayList();
+ if (!filterClause.toString().equals("(&(objectClass=*))")) {
+ NamingEnumeration e = dirContext.search(
+ SystemProperties.getProperty(SystemProperties.POST_PROVIDER_URL) + "/"
+ + SystemProperties.getProperty(SystemProperties.POST_SECURITY_PRINCIPAL),
+ filterClause.toString(), searchControls);
+ list = processResults(e);
+ }
- @SuppressWarnings({ "rawtypes", "unchecked" })
- @EPMetricsLog
- private ArrayList processResults(NamingEnumeration e) throws NamingException {
- ArrayList results = new ArrayList();
- int count = 0;
+ Collections.sort(list);
- while (e.hasMore()) {
- javax.naming.directory.SearchResult searchResult = (javax.naming.directory.SearchResult)e.next();
- results.add(processAttributes(searchResult.getAttributes()));
- count++;
+ searchResult = new SearchResult(list);
+ searchResult.setPageNo(pageNo);
+ if (dataSize >= 0) {
+ searchResult.setDataSize(dataSize);
+ } else {
+ searchResult.setDataSize(list.size());
+ }
+ } catch (NamingException ne) {
+ logger.error(EELFLoggerDelegate.errorLogger, "searchPost failed with naming exception", ne);
+ } catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "searchPost failed", e);
+ } finally {
+ dirContext.close();
+ }
- if(count > Integer.parseInt(SystemProperties.getProperty(SystemProperties.POST_MAX_RESULT_SIZE))) {
- break;
- }
- }
- return results;
- }
+ return searchResult;
+ }
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ @EPMetricsLog
+ private ArrayList processResults(NamingEnumeration e) throws NamingException {
+ ArrayList results = new ArrayList();
+ int count = 0;
- @SuppressWarnings("rawtypes")
- @EPMetricsLog
+ while (e.hasMore()) {
+ javax.naming.directory.SearchResult searchResult = (javax.naming.directory.SearchResult) e.next();
+ results.add(processAttributes(searchResult.getAttributes()));
+ count++;
+
+ if (count > Integer.parseInt(SystemProperties.getProperty(SystemProperties.POST_MAX_RESULT_SIZE))) {
+ break;
+ }
+ }
+ return results;
+ }
+
+ @SuppressWarnings("rawtypes")
+ @EPMetricsLog
private DomainVo processAttributes(Attributes resultAttributes) throws NamingException {
- EPUser user = new EPUser();
+ EPUser user = new EPUser();
+
+ try {
+ if (resultAttributes == null) {
+ logger.debug(EELFLoggerDelegate.debugLogger, "This result has no attributes");
+ } else {
+ for (NamingEnumeration e = resultAttributes.getAll(); e.hasMore();) { // why the nested loop?
+ Attribute attribute = (Attribute) e.next();
+ for (NamingEnumeration ie = attribute.getAll(); ie.hasMore();) {
+ if (attribute.getID().equalsIgnoreCase("nickname")) {
+ user.setFirstName((String) ie.next());
+ } else if (attribute.getID().equalsIgnoreCase("initials")) {
+ user.setMiddleInitial((String) ie.next());
+ } else if (attribute.getID().equalsIgnoreCase("sn")) {
+ user.setLastName((String) ie.next());
+ } else if (attribute.getID().equalsIgnoreCase("employeeNumber")) {
+ user.setHrid((String) ie.next());
+ } else if (attribute.getID().equalsIgnoreCase("mail")) {
+ user.setEmail((String) ie.next());
+ } else if (attribute.getID().equalsIgnoreCase("telephoneNumber")) {
+ user.setPhone((String) ie.next());
+ } else if (attribute.getID().equalsIgnoreCase("departmentNumber")) {
+ user.setOrgCode((String) ie.next());
+ } else if (attribute.getID().equalsIgnoreCase("a1")) {
+ user.setOrgUserId((String) ie.next());
+ } else if (attribute.getID().equalsIgnoreCase("street")) {
+ user.setAddress1((String) ie.next());
+ } else if (attribute.getID().equalsIgnoreCase("roomNumber")) {
+ user.setAddress2((String) ie.next());
+ } else if (attribute.getID().equalsIgnoreCase("l")) {
+ user.setCity((String) ie.next());
+ } else if (attribute.getID().equalsIgnoreCase("st")) {
+ user.setState((String) ie.next());
+ } else if (attribute.getID().equalsIgnoreCase("postalCode")) {
+ user.setZipCode((String) ie.next());
+ } else if (attribute.getID().equalsIgnoreCase("zip4")) {
+ user.setZipCodeSuffix((String) ie.next());
+ } else if (attribute.getID().equalsIgnoreCase("physicalDeliveryOfficeName")) {
+ user.setLocationClli((String) ie.next());
+ } else if (attribute.getID().equalsIgnoreCase("bc")) {
+ user.setBusinessCountryCode((String) ie.next());
+ } else if (attribute.getID().equalsIgnoreCase("friendlyCountryName")) {
+ user.setBusinessCountryName((String) ie.next());
+ } else if (attribute.getID().equalsIgnoreCase("bd")) {
+ user.setDepartment((String) ie.next());
+ } else if (attribute.getID().equalsIgnoreCase("bdname")) {
+ user.setDepartmentName((String) ie.next());
+ } else if (attribute.getID().equalsIgnoreCase("jtname")) {
+ user.setJobTitle((String) ie.next());
+ } else if (attribute.getID().equalsIgnoreCase("mgrid")) {
+ user.setOrgManagerUserId((String) ie.next());
+ } else if (attribute.getID().equalsIgnoreCase("a2")) {
+ user.setCommandChain((String) ie.next());
+ } else if (attribute.getID().equalsIgnoreCase("compcode")) {
+ user.setCompanyCode((String) ie.next());
+ } else if (attribute.getID().equalsIgnoreCase("compdesc")) {
+ user.setCompany((String) ie.next());
+ } else if (attribute.getID().equalsIgnoreCase("bu")) {
+ user.setBusinessUnit((String) ie.next());
+ } else if (attribute.getID().equalsIgnoreCase("buname")) {
+ user.setBusinessUnitName((String) ie.next());
+ } else if (attribute.getID().equalsIgnoreCase("silo")) {
+ user.setSiloStatus((String) ie.next());
+ } else if (attribute.getID().equalsIgnoreCase("costcenter")) {
+ user.setCostCenter((String) ie.next());
+ } else if (attribute.getID().equalsIgnoreCase("b2")) {
+ user.setFinancialLocCode((String) ie.next());
+ } else { // we don't care about returned attribute, let's move on
+ ie.next();
+ }
- try {
- if (resultAttributes == null) {
- logger.debug(EELFLoggerDelegate.debugLogger, "This result has no attributes");
- } else {
- for (NamingEnumeration e = resultAttributes.getAll(); e.hasMore();) { //why the nested loop?
- Attribute attribute = (Attribute)e.next();
- for (NamingEnumeration ie = attribute.getAll(); ie.hasMore();) {
- if (attribute.getID().equalsIgnoreCase("nickname")) {
- user.setFirstName((String) ie.next());
- }
- else if (attribute.getID().equalsIgnoreCase("initials")) {
- user.setMiddleInitial((String) ie.next());
- }
- else if (attribute.getID().equalsIgnoreCase("sn")) {
- user.setLastName((String) ie.next());
- }
- else if (attribute.getID().equalsIgnoreCase("employeeNumber")) {
- user.setHrid((String) ie.next());
- }
- else if (attribute.getID().equalsIgnoreCase("mail")) {
- user.setEmail((String) ie.next());
- }
- else if (attribute.getID().equalsIgnoreCase("telephoneNumber")) {
- user.setPhone((String) ie.next());
- }
- else if (attribute.getID().equalsIgnoreCase("departmentNumber")) {
- user.setOrgCode((String) ie.next());
- }
- else if (attribute.getID().equalsIgnoreCase("a1")) {
- user.setOrgUserId((String) ie.next());
- }
- else if (attribute.getID().equalsIgnoreCase("street")) {
- user.setAddress1((String) ie.next());
- }
- else if (attribute.getID().equalsIgnoreCase("roomNumber")) {
- user.setAddress2((String) ie.next());
- }
- else if (attribute.getID().equalsIgnoreCase("l")) {
- user.setCity((String) ie.next());
- }
- else if (attribute.getID().equalsIgnoreCase("st")) {
- user.setState((String) ie.next());
- }
- else if (attribute.getID().equalsIgnoreCase("postalCode")) {
- user.setZipCode((String) ie.next());
- }
- else if (attribute.getID().equalsIgnoreCase("zip4")) {
- user.setZipCodeSuffix((String) ie.next());
- }
- else if (attribute.getID().equalsIgnoreCase("physicalDeliveryOfficeName")) {
- user.setLocationClli((String) ie.next());
- }
- else if (attribute.getID().equalsIgnoreCase("bc")) {
- user.setBusinessCountryCode((String) ie.next());
- }
- else if (attribute.getID().equalsIgnoreCase("friendlyCountryName")) {
- user.setBusinessCountryName((String) ie.next());
- }
- else if (attribute.getID().equalsIgnoreCase("bd")) {
- user.setDepartment((String) ie.next());
- }
- else if (attribute.getID().equalsIgnoreCase("bdname")) {
- user.setDepartmentName((String) ie.next());
- }
- else if (attribute.getID().equalsIgnoreCase("jtname")) {
- user.setJobTitle((String) ie.next());
- }
- else if (attribute.getID().equalsIgnoreCase("mgrid")) {
- user.setOrgManagerUserId((String) ie.next());
- }
- else if (attribute.getID().equalsIgnoreCase("a2")) {
- user.setCommandChain((String) ie.next());
- }
- else if (attribute.getID().equalsIgnoreCase("compcode")) {
- user.setCompanyCode((String) ie.next());
- }
- else if (attribute.getID().equalsIgnoreCase("compdesc")) {
- user.setCompany((String) ie.next());
- }
- else if (attribute.getID().equalsIgnoreCase("bu")) {
- user.setBusinessUnit((String)ie.next());
- }
- else if (attribute.getID().equalsIgnoreCase("buname")) {
- user.setBusinessUnitName((String)ie.next());
- }
- else if (attribute.getID().equalsIgnoreCase("silo")) {
- user.setSiloStatus((String)ie.next());
- }
- else if (attribute.getID().equalsIgnoreCase("costcenter")) {
- user.setCostCenter((String)ie.next());
- }
- else if (attribute.getID().equalsIgnoreCase("b2")) {
- user.setFinancialLocCode((String)ie.next());
- }
- else { //we don't care about returned attribute, let's move on
- ie.next();
- }
+ }
+ }
+ }
+ } catch (NamingException e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "processAttributes failed with naming exception", e);
+ } catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "processAttributes failed", e);
+ }
- }
- }
- }
- } catch (NamingException e) {
- String stackTrace = EcompPortalUtils.getStackTrace(e);
- logger.error(EELFLoggerDelegate.errorLogger, "An error occurred while processing the following user from POST with an Organization User ID of " + user.getOrgUserId());
- logger.error(EELFLoggerDelegate.errorLogger, "Exception occcurred while processing LDAP search results, Details: " + stackTrace);
- } catch(Exception e) {
- String stackTrace = EcompPortalUtils.getStackTrace(e);
- logger.error(EELFLoggerDelegate.errorLogger, "Exception occcurred while processing LDAP search results, Details: " + stackTrace);
- }
-
- return user;
- }
+ return user;
+ }
}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.service;
import java.util.List;
import org.openecomp.portalsdk.core.domain.RoleFunction;
public interface EPRoleFunctionService {
+
/**
* Builds a set of role functions and sets a session attribute with it.
*
- * @param request
- * HttpServletRequest
* @return Set of role functions that was built.
*/
public List<RoleFunction> getRoleFunctions();
-
-
+
/**
- * Builds a set of role functions of user
+ * Builds a set of role functions of user
*
* @param request
* HttpServletRequest
+ * @param user
+ * EPUser
* @return Set of role functions that was built.
*/
public Set getRoleFunctions(HttpServletRequest request, EPUser user);
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.service;
import java.util.ArrayList;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.service;
import java.util.HashMap;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.service;
import java.util.List;
* Adds role in the external access system if fails throws exception
*
* @param addRoles
- * @param UE
+ * @param uebkey
* @return boolean
* @throws Exception
*/
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.service;
import java.util.ArrayList;
logger.debug(EELFLoggerDelegate.debugLogger, "deleteDependencyRoleRecord: committed the transaction");
result = true;
} catch(HttpClientErrorException e){
- logger.error(EELFLoggerDelegate.errorLogger, "HttpClientErrorException - Failed to deleteRoleDependeciesRecord", e);
+ logger.error(EELFLoggerDelegate.errorLogger, "deleteDependencyRoleRecord: HttpClientErrorException", e);
EPLogUtil.logExternalAuthAccessAlarm(logger, e.getStatusCode());
} catch (Exception e) {
- EcompPortalUtils.rollbackTransaction(transaction, "deleteDependencyRoleRecord: rollback, exception = " + e);
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
- result = false;
+ logger.error(EELFLoggerDelegate.errorLogger, "deleteDependencyRoleRecord failed", e);
+ EcompPortalUtils.rollbackTransaction(transaction,
+ "deleteDependencyRoleRecord rollback, exception = " + e.toString());
} finally {
localSession.close();
}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
import org.hibernate.Transaction;
import org.hibernate.criterion.Projections;
import org.hibernate.criterion.Restrictions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
import org.openecomp.portalapp.portal.domain.EPApp;
import org.openecomp.portalapp.portal.domain.EPUser;
import org.openecomp.portalapp.portal.domain.FunctionalMenuItemWithAppID;
import org.openecomp.portalapp.portal.transport.FunctionalMenuRole;
import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.service.DataAccessService;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
@Service("functionalMenuService")
@org.springframework.context.annotation.Configuration
@PostConstruct
private void init() {
try {
- ACCOUNT_ADMIN_ROLE_ID = Long.valueOf(SystemProperties.getProperty(EPCommonSystemProperties.ACCOUNT_ADMIN_ROLE_ID));
+ ACCOUNT_ADMIN_ROLE_ID = Long
+ .valueOf(SystemProperties.getProperty(EPCommonSystemProperties.ACCOUNT_ADMIN_ROLE_ID));
RESTRICTED_APP_ROLE_ID = SystemProperties.getProperty(EPCommonSystemProperties.RESTRICTED_APP_ROLE_ID);
- } catch(Exception e) {
+ } catch (Exception e) {
}
}
-
+
public List<FunctionalMenuItem> getFunctionalMenuItems(EPUser user) {
List<FunctionalMenuItem> menuItems = new ArrayList<FunctionalMenuItem>();
return menuItems;
public List<FunctionalMenuItem> getFunctionalMenuItems() {
return getFunctionalMenuItems(false);
}
-
+
public List<FunctionalMenuItem> getFunctionalMenuItems(Boolean all) {
- // Divide this into 2 queries: one which returns the bottom-level menu items associated with Restricted apps,
- // and one that returns all the other menu items. Then we can easily add the boolean flag
+ // Divide this into 2 queries: one which returns the bottom-level menu items
+ // associated with Restricted apps,
+ // and one that returns all the other menu items. Then we can easily add the
+ // boolean flag
// restrictedApp to each FunctionalMenuItem, to be used by the front end.
String activeWhereClause = "";
- if (! all) {
+ if (!all) {
activeWhereClause = " AND UPPER(m.active_yn) = 'Y' ";
}
String sql = "SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn, r.app_id "
- + "FROM fn_menu_functional m, fn_menu_functional_roles r "
- + "WHERE m.menu_id = r.menu_id "
- + activeWhereClause //" AND UPPER(m.active_yn) = 'Y' "
- + " AND r.role_id != '" + RESTRICTED_APP_ROLE_ID + "' "
- + " UNION "
- + " SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn,-1 app_id "
- + " FROM fn_menu_functional m "
- + " WHERE m.url='' "
- + activeWhereClause; //" AND UPPER(m.active_yn) = 'Y' ";
+ + "FROM fn_menu_functional m, fn_menu_functional_roles r " + "WHERE m.menu_id = r.menu_id "
+ + activeWhereClause // " AND UPPER(m.active_yn) = 'Y' "
+ + " AND r.role_id != '" + RESTRICTED_APP_ROLE_ID + "' " + " UNION "
+ + " SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn,-1 app_id "
+ + " FROM fn_menu_functional m " + " WHERE m.url='' " + activeWhereClause; // " AND UPPER(m.active_yn) =
+ // 'Y' ";
logQuery(sql);
@SuppressWarnings("unchecked")
- List<FunctionalMenuItemWithAppID> menuItemsWithAppIdList = dataAccessService.executeSQLQuery(sql,FunctionalMenuItemWithAppID.class, null);
- List<FunctionalMenuItem> menuItems = new ArrayList<>();
+ List<FunctionalMenuItemWithAppID> menuItemsWithAppIdList = dataAccessService.executeSQLQuery(sql,
+ FunctionalMenuItemWithAppID.class, null);
+ List<FunctionalMenuItem> menuItems = new ArrayList<>();
menuItems = transformFunctionalMenuItemWithAppIDToFunctionalMenuItem(menuItemsWithAppIdList);
for (FunctionalMenuItem menuItem : menuItems) {
menuItem.restrictedApp = false;
}
-
+
sql = "SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn, r.app_id "
- + "FROM fn_menu_functional m, fn_menu_functional_roles r "
- + "WHERE m.menu_id = r.menu_id "
- + activeWhereClause //" AND UPPER(m.active_yn) = 'Y' "
+ + "FROM fn_menu_functional m, fn_menu_functional_roles r " + "WHERE m.menu_id = r.menu_id "
+ + activeWhereClause // " AND UPPER(m.active_yn) = 'Y' "
+ " AND r.role_id = '" + RESTRICTED_APP_ROLE_ID + "' ";
logQuery(sql);
@SuppressWarnings("unchecked")
menuItem.restrictedApp = true;
menuItems.add(menuItem);
}
-
+
return menuItems;
}
-
public List<FunctionalMenuItem> getFunctionalMenuItemsForNotificationTree(Boolean all) {
- // Divide this into 2 queries: one which returns the bottom-level menu items associated with Restricted apps,
- // and one that returns all the other menu items which are active. Then we can easily add the boolean flag
+ // Divide this into 2 queries: one which returns the bottom-level menu items
+ // associated with Restricted apps,
+ // and one that returns all the other menu items which are active. Then we can
+ // easily add the boolean flag
// restrictedApp to each FunctionalMenuItem, to be used by the front end.
String activeWhereClause = "";
- if (! all) {
+ if (!all) {
activeWhereClause = " AND UPPER(m.active_yn) = 'Y' ";
}
String sql = "SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn, r.app_id "
- + "FROM fn_menu_functional m, fn_menu_functional_roles r "
- + "WHERE m.menu_id = r.menu_id "
- + activeWhereClause + " AND UPPER(m.active_yn) = 'Y' "
- + " AND r.role_id != '" + RESTRICTED_APP_ROLE_ID + "' "
- + " UNION "
- + " SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn,-1 app_id "
- + " FROM fn_menu_functional m "
- + " WHERE m.url='' "
- + activeWhereClause + " AND UPPER(m.active_yn) = 'Y' ";
+ + "FROM fn_menu_functional m, fn_menu_functional_roles r " + "WHERE m.menu_id = r.menu_id "
+ + activeWhereClause + " AND UPPER(m.active_yn) = 'Y' " + " AND r.role_id != '" + RESTRICTED_APP_ROLE_ID
+ + "' " + " UNION "
+ + " SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn,-1 app_id "
+ + " FROM fn_menu_functional m " + " WHERE m.url='' " + activeWhereClause
+ + " AND UPPER(m.active_yn) = 'Y' ";
logQuery(sql);
@SuppressWarnings("unchecked")
- List<FunctionalMenuItemWithAppID> menuItemsWithAppIdList = dataAccessService.executeSQLQuery(sql,FunctionalMenuItemWithAppID.class, null);
- List<FunctionalMenuItem> menuItems = new ArrayList<>();
+ List<FunctionalMenuItemWithAppID> menuItemsWithAppIdList = dataAccessService.executeSQLQuery(sql,
+ FunctionalMenuItemWithAppID.class, null);
+ List<FunctionalMenuItem> menuItems = new ArrayList<>();
menuItems = transformFunctionalMenuItemWithAppIDToFunctionalMenuItem(menuItemsWithAppIdList);
for (FunctionalMenuItem menuItem : menuItems) {
menuItem.restrictedApp = false;
}
-
+
sql = "SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn, r.app_id "
- + "FROM fn_menu_functional m, fn_menu_functional_roles r "
- + "WHERE m.menu_id = r.menu_id "
- + activeWhereClause + " AND UPPER(m.active_yn) = 'Y' "
- + " AND r.role_id = '" + RESTRICTED_APP_ROLE_ID + "' ";
+ + "FROM fn_menu_functional m, fn_menu_functional_roles r " + "WHERE m.menu_id = r.menu_id "
+ + activeWhereClause + " AND UPPER(m.active_yn) = 'Y' " + " AND r.role_id = '" + RESTRICTED_APP_ROLE_ID
+ + "' ";
logQuery(sql);
@SuppressWarnings("unchecked")
List<FunctionalMenuItem> menuItems2 = dataAccessService.executeSQLQuery(sql, FunctionalMenuItem.class, null);
menuItem.restrictedApp = true;
menuItems.add(menuItem);
}
-
+
return menuItems;
}
public List<FunctionalMenuItem> getFunctionalMenuItemsForApp(Integer appId) {
String sql = "SELECT DISTINCT m1.menu_id, m1.column_num, m1.text, m1.parent_menu_id, m1.url, m.active_yn "
+ " FROM fn_menu_functional m, fn_menu_functional m1, fn_menu_functional_ancestors a, fn_menu_functional_roles mr "
- + " WHERE " + " mr.app_id='" + appId + "' " + " AND mr.menu_id = m.menu_id " + " AND UPPER(m.active_yn) = 'Y'"
- + " AND UPPER(m1.active_yn) ='Y'" + " AND a.menu_id = m.menu_id " + " AND a.ancestor_menu_id = m1.menu_id";
+ + " WHERE " + " mr.app_id='" + appId + "' " + " AND mr.menu_id = m.menu_id "
+ + " AND UPPER(m.active_yn) = 'Y'" + " AND UPPER(m1.active_yn) ='Y'" + " AND a.menu_id = m.menu_id "
+ + " AND a.ancestor_menu_id = m1.menu_id";
logQuery(sql);
logger.debug(EELFLoggerDelegate.debugLogger, "getFunctionalMenuItemsForApp: logged the query");
@SuppressWarnings("unchecked")
List<FunctionalMenuItem> menuItems = dataAccessService.executeSQLQuery(sql, FunctionalMenuItem.class, null);
-
+
return menuItems;
}
+
/**
* convert List of FunctionalMenuItemWithAppID into List of FunctionalMenuItem
*
*/
- public List<FunctionalMenuItem> transformFunctionalMenuItemWithAppIDToFunctionalMenuItem(List<FunctionalMenuItemWithAppID> functionalMenuItemWithAppIDList) {
+ public List<FunctionalMenuItem> transformFunctionalMenuItemWithAppIDToFunctionalMenuItem(
+ List<FunctionalMenuItemWithAppID> functionalMenuItemWithAppIDList) {
List<FunctionalMenuItem> functionalMenuItemList = new ArrayList<FunctionalMenuItem>();
for (FunctionalMenuItemWithAppID functionalMenuItemWithAppID : functionalMenuItemWithAppIDList) {
FunctionalMenuItem menuItem = new FunctionalMenuItem();
- menuItem.menuId=functionalMenuItemWithAppID.menuId;
- menuItem.column=functionalMenuItemWithAppID.column;
- menuItem.text=functionalMenuItemWithAppID.text;
- menuItem.parentMenuId=functionalMenuItemWithAppID.parentMenuId;
- menuItem.url=functionalMenuItemWithAppID.url;
- menuItem.active_yn=functionalMenuItemWithAppID.active_yn;
- menuItem.appid=functionalMenuItemWithAppID.appid;
+ menuItem.menuId = functionalMenuItemWithAppID.menuId;
+ menuItem.column = functionalMenuItemWithAppID.column;
+ menuItem.text = functionalMenuItemWithAppID.text;
+ menuItem.parentMenuId = functionalMenuItemWithAppID.parentMenuId;
+ menuItem.url = functionalMenuItemWithAppID.url;
+ menuItem.active_yn = functionalMenuItemWithAppID.active_yn;
+ menuItem.appid = functionalMenuItemWithAppID.appid;
menuItem.setRoles(functionalMenuItemWithAppID.roles);
- menuItem.restrictedApp=functionalMenuItemWithAppID.restrictedApp;
+ menuItem.restrictedApp = functionalMenuItemWithAppID.restrictedApp;
functionalMenuItemList.add(menuItem);
}
return functionalMenuItemList;
}
-
+
public List<FunctionalMenuItem> getFunctionalMenuItemsForUser(String orgUserId) {
// m represents the functional menu items that are the leaf nodes
// m1 represents the functional menu items for all the nodes
- // Divide this into 2 queries: one which returns the bottom-level menu items associated with Restricted apps,
- // and one that returns all the other menu items. Then we can easily add the boolean flag
+ // Divide this into 2 queries: one which returns the bottom-level menu items
+ // associated with Restricted apps,
+ // and one that returns all the other menu items. Then we can easily add the
+ // boolean flag
// restrictedApp to each FunctionalMenuItem, to be used by the front end.
String sql = "SELECT DISTINCT m1.menu_id, m1.column_num, m1.text, m1.parent_menu_id, m1.url, m.active_yn "
+ " FROM fn_menu_functional m, fn_menu_functional m1, fn_menu_functional_ancestors a, "
- + " fn_menu_functional_roles mr, fn_user u , fn_user_role ur " + " WHERE " + " u.org_user_id='" + orgUserId
- + "' " + " AND u.user_id = ur.user_id " + " AND ur.app_id = mr.app_id " +
+ + " fn_menu_functional_roles mr, fn_user u , fn_user_role ur " + " WHERE " + " u.org_user_id='"
+ + orgUserId + "' " + " AND u.user_id = ur.user_id " + " AND ur.app_id = mr.app_id " +
// " AND ur.role_id = mr.role_id " +
" AND (ur.role_id = mr.role_id " + " OR ur.role_id = '" + ACCOUNT_ADMIN_ROLE_ID + "') "
+ " AND m.menu_id = mr.menu_id " + " AND UPPER(m.active_yn) = 'Y'" + " AND UPPER(m1.active_yn) ='Y' "
- + " AND a.menu_id = m.menu_id " + " AND a.ancestor_menu_id = m1.menu_id "
- + " UNION "
+ + " AND a.menu_id = m.menu_id " + " AND a.ancestor_menu_id = m1.menu_id " + " UNION "
// the ancestors of the restricted app menu items
+ " select m1.menu_id, m1.column_num, m1.text, m1.parent_menu_id, m1.url, m1.active_yn "
+ " FROM fn_menu_functional m, fn_menu_functional_roles mr, fn_menu_functional m1, "
- + " fn_menu_functional_ancestors a "
- + " where a.menu_id = m.menu_id "
- + " AND a.ancestor_menu_id = m1.menu_id "
- + " AND m.menu_id != m1.menu_id "
- + " AND m.menu_id = mr.menu_id "
- + " AND mr.role_id = '" + RESTRICTED_APP_ROLE_ID + "' "
+ + " fn_menu_functional_ancestors a " + " where a.menu_id = m.menu_id "
+ + " AND a.ancestor_menu_id = m1.menu_id " + " AND m.menu_id != m1.menu_id "
+ + " AND m.menu_id = mr.menu_id " + " AND mr.role_id = '" + RESTRICTED_APP_ROLE_ID + "' "
+ " AND UPPER(m.active_yn) = 'Y'" + " AND UPPER(m1.active_yn) ='Y' "
// Add the Favorites menu item
- + " UNION "
- + " SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn "
+ + " UNION " + " SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn "
+ " FROM fn_menu_functional m "
+ " WHERE m.text in ('Favorites','Get Access','Contact Us','Support','User Guide','Help')";
-
+
logQuery(sql);
logger.debug(EELFLoggerDelegate.debugLogger, "getFunctionalMenuItemsForUser: logged the query");
for (FunctionalMenuItem menuItem : menuItems) {
menuItem.restrictedApp = false;
}
-
+
sql = " SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn "
- + " FROM fn_menu_functional m, fn_menu_functional_roles r "
- + " WHERE m.menu_id = r.menu_id "
- + " AND UPPER(m.active_yn) = 'Y' "
- + " AND r.role_id = '" + RESTRICTED_APP_ROLE_ID + "' ";
+ + " FROM fn_menu_functional m, fn_menu_functional_roles r " + " WHERE m.menu_id = r.menu_id "
+ + " AND UPPER(m.active_yn) = 'Y' " + " AND r.role_id = '" + RESTRICTED_APP_ROLE_ID + "' ";
logQuery(sql);
@SuppressWarnings("unchecked")
List<FunctionalMenuItem> menuItems2 = dataAccessService.executeSQLQuery(sql, FunctionalMenuItem.class, null);
menuItem.restrictedApp = true;
menuItems.add(menuItem);
}
-
+
return menuItems;
}
menuItem.appid = appid;
List<Integer> roles = new ArrayList<Integer>();
for (FunctionalMenuRole roleItem : roleItems) {
- logger.debug(EELFLoggerDelegate.debugLogger, "LR: app_id: " + roleItem.appId + "; role_id: " + roleItem.roleId + "\n");
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ "LR: app_id: " + roleItem.appId + "; role_id: " + roleItem.roleId + "\n");
roles.add(roleItem.roleId);
}
menuItem.setRoles(roles);
}
-
+
return menuItem;
}
@SuppressWarnings("unchecked")
List<FunctionalMenuItem> functionalMenuItems = dataAccessService.getList(FunctionalMenuItem.class,
" where text = '" + menuItemJson.text + "'", null, null);
-
+
boolean dublicatedName = false;
for (FunctionalMenuItem fnMenuItem : functionalMenuItems) {
if (menuItemJson.menuId != null && menuItemJson.menuId.equals(fnMenuItem.menuId)) {
fieldsValidator.addProblematicFieldName("text");
fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_CONFLICT);
fieldsValidator.errorCode = new Long(EPCommonSystemProperties.DUBLICATED_FIELD_VALUE_ECOMP_ERROR);
- logger.debug(EELFLoggerDelegate.debugLogger, "In menuItemFieldsChecker, Error: we have an duplicate text field");
- } else if (StringUtils.isEmpty(menuItemJson.text) && menuItemJson.menuId == null) {
- // text must be non empty for a create. For an edit, can be empty, which means it is a move request.
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ "In menuItemFieldsChecker, Error: we have an duplicate text field");
+ } else if (StringUtils.isEmpty(menuItemJson.text) && menuItemJson.menuId == null) {
+ // text must be non empty for a create. For an edit, can be empty, which means
+ // it is a move request.
// a null menuId indicates a create.
fieldsValidator.addProblematicFieldName("text");
fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST);
- logger.debug(EELFLoggerDelegate.debugLogger, "In menuItemFieldsChecker, Error: we have an empty text field");
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ "In menuItemFieldsChecker, Error: we have an empty text field");
} else {
// The url, appid, and roles must either be all filled or all empty.
Boolean urlIsEmpty = StringUtils.isEmpty(menuItemJson.url);
Boolean rolesIsEmpty = menuItemJson.getRoles() == null || menuItemJson.getRoles().isEmpty();
Boolean appidIsEmpty = menuItemJson.appid == null || menuItemJson.appid == 0;
- logger.debug(EELFLoggerDelegate.debugLogger, "LR: menuItemfieldsChecker: urlIsEmpty: " + urlIsEmpty + "; rolesIsEmpty: " + rolesIsEmpty + "; appidIsEmpty: " + appidIsEmpty +"\n");
- if (!((urlIsEmpty && rolesIsEmpty && appidIsEmpty) || (!urlIsEmpty && !rolesIsEmpty && !appidIsEmpty)))
- {
+ logger.debug(EELFLoggerDelegate.debugLogger, "LR: menuItemfieldsChecker: urlIsEmpty: " + urlIsEmpty
+ + "; rolesIsEmpty: " + rolesIsEmpty + "; appidIsEmpty: " + appidIsEmpty + "\n");
+ if (!((urlIsEmpty && rolesIsEmpty && appidIsEmpty)
+ || (!urlIsEmpty && !rolesIsEmpty && !appidIsEmpty))) {
fieldsValidator.addProblematicFieldName("url,roles,appid");
fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST);
- logger.debug(EELFLoggerDelegate.debugLogger, "In menuItemFieldsChecker, Error: we don't have: either all 3 fields empty or all 3 fields nonempty");
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ "In menuItemFieldsChecker, Error: we don't have: either all 3 fields empty or all 3 fields nonempty");
} else {
- logger.debug(EELFLoggerDelegate.debugLogger, "In menuItemFieldsChecker, Success: either all 3 fields empty or all 3 fields nonempty");
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ "In menuItemFieldsChecker, Success: either all 3 fields empty or all 3 fields nonempty");
}
}
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while validating the FunctionalMenuItems. Details: " + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "menuItemFieldsChecker failed", e);
fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}
-
+
return fieldsValidator;
}
-
+
// Turn foreign key checks on or off
protected void setForeignKeys(Session localSession, Boolean on) {
String keyCheck = "0";
if (on) {
keyCheck = "1";
}
- String sql = "set FOREIGN_KEY_CHECKS="+keyCheck;
+ String sql = "set FOREIGN_KEY_CHECKS=" + keyCheck;
logQuery(sql);
Query query = localSession.createSQLQuery(sql);
query.executeUpdate();
menuItem.parentMenuId = menuItemJson.parentMenuId;
menuItem.active_yn = "Y";
localSession = sessionFactory.openSession();
-
+
// If the app is disabled, deactivate the menu item.
if (menuItemJson.appid != null) {
Long appidLong = Long.valueOf(menuItemJson.appid);
EPApp app = (EPApp) localSession.get(EPApp.class, appidLong);
- if (app != null && ! app.getEnabled()) {
+ if (app != null && !app.getEnabled()) {
menuItem.active_yn = "N";
}
}
transaction.commit();
result = true;
} catch (Exception e) {
- EcompPortalUtils.rollbackTransaction(transaction,
- "createFunctionalMenuItem rollback, exception = " + e);
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "createFunctionalMenuItem failed", e);
+ EcompPortalUtils.rollbackTransaction(transaction,
+ "createFunctionalMenuItem rollback, exception = " + e.toString());
} finally {
EcompPortalUtils.closeLocalSession(localSession, "createFunctionalMenuItem");
}
if (result) {
} else {
- logger.debug(EELFLoggerDelegate.debugLogger, "LR: createFunctionalMenuItem: no result. setting httpStatusCode to "
- + HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ "LR: createFunctionalMenuItem: no result. setting httpStatusCode to "
+ + HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}
} else {
- logger.error(EELFLoggerDelegate.errorLogger, "FunctionalMenuServiceImpl.createFunctionalMenuItem: bad request");
+ logger.error(EELFLoggerDelegate.errorLogger,
+ "FunctionalMenuServiceImpl.createFunctionalMenuItem: bad request");
}
return fieldsValidator;
}
public void deleteFavorites(Long menuId) {
dataAccessService.deleteDomainObjects(FavoritesFunctionalMenuItem.class, "menu_id='" + menuId + "'", null);
}
-
+
private Boolean parentMenuIdEqual(Integer menuId1, Integer menuId2) {
return ((menuId1 == null && menuId2 == null) || (menuId1 != null && menuId1.equals(menuId2)));
}
}
// Adjust the children under the new parent.
logger.debug(EELFLoggerDelegate.debugLogger, "about to adjust the children under the new parent");
- logger.debug(EELFLoggerDelegate.debugLogger, "get all menu items where menuId!=" + menuId + "; parentMenuId==" + newParentMenuId
- + "; column>=" + newColumn);
+ logger.debug(EELFLoggerDelegate.debugLogger, "get all menu items where menuId!=" + menuId
+ + "; parentMenuId==" + newParentMenuId + "; column>=" + newColumn);
criteria = localSession.createCriteria(FunctionalMenuItem.class);
criteria.add(Restrictions.ne("menuId", menuId));
if (newParentMenuId == null) {
}
public FieldsValidator editFunctionalMenuItem(FunctionalMenuItemWithRoles menuItemJson) {
- boolean result = false;
- Session localSession = null;
+ boolean result = false;
+ Session localSession = null;
Transaction transaction = null;
- Long menuId = menuItemJson.menuId;
+ Long menuId = menuItemJson.menuId;
logger.debug(EELFLoggerDelegate.debugLogger, "LR: editFunctionalMenuItem: test 1");
FieldsValidator fieldsValidator = menuItemFieldsChecker(menuItemJson);
// in db table.
if (menuId == null) {
fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST);
- logger.error(EELFLoggerDelegate.errorLogger, "FunctionalMenuServiceImpl.editFunctionalMenuItem: bad request");
+ logger.error(EELFLoggerDelegate.errorLogger,
+ "FunctionalMenuServiceImpl.editFunctionalMenuItem: bad request");
} else {
// To simplify the code, assume we will have a transaction
try {
transaction = localSession.beginTransaction();
// Get the existing info associated with menuItem from the DB
- FunctionalMenuItem menuItem = (FunctionalMenuItem) localSession.get(FunctionalMenuItem.class, menuId);
+ FunctionalMenuItem menuItem = (FunctionalMenuItem) localSession.get(FunctionalMenuItem.class,
+ menuId);
Integer oldColumn = menuItem.column;
Integer oldParentMenuId = menuItem.parentMenuId;
Integer newColumn = menuItemJson.column;
Integer newParentMenuId = menuItemJson.parentMenuId;
- logger.debug(EELFLoggerDelegate.debugLogger, "prev info: column: " + oldColumn + "; parentMenuId: " + oldParentMenuId);
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ "prev info: column: " + oldColumn + "; parentMenuId: " + oldParentMenuId);
- if (menuItemJson.appid != null && menuItemJson.getRoles() != null && !menuItemJson.getRoles().isEmpty()
- && menuItemJson.url != null && !menuItemJson.url.isEmpty() && menuItemJson.text != null
+ if (menuItemJson.appid != null && menuItemJson.getRoles() != null
+ && !menuItemJson.getRoles().isEmpty() && menuItemJson.url != null
+ && !menuItemJson.url.isEmpty() && menuItemJson.text != null
&& !menuItemJson.text.isEmpty()) {
// Scenario: appid, roles, url and text are all non-null.
// This menu item is associated with an app.
menuItem.setRoles(menuItemJson.getRoles());
menuItem.url = menuItemJson.url;
menuItem.text = menuItemJson.text;
-
+
// If the app is disabled, deactivate the menu item.
Long appidLong = Long.valueOf(menuItemJson.appid);
EPApp app = (EPApp) localSession.get(EPApp.class, appidLong);
- if (app != null && ! app.getEnabled()) {
+ if (app != null && !app.getEnabled()) {
menuItem.active_yn = "N";
} else {
menuItem.active_yn = "Y";
}
-
localSession.update(menuItem);
addRoles(menuItemJson, localSession);
- } else if (menuItemJson.appid == null && (menuItemJson.getRoles() == null || menuItemJson.getRoles().isEmpty())
+ } else if (menuItemJson.appid == null
+ && (menuItemJson.getRoles() == null || menuItemJson.getRoles().isEmpty())
&& (menuItemJson.url == null || menuItemJson.url.isEmpty()) && menuItemJson.text != null
&& !menuItemJson.text.isEmpty()) {
// Scenario: appid, roles and url are all null; text is
}
transaction.commit();
- logger.debug(EELFLoggerDelegate.debugLogger, "LR: editFunctionalMenuItem: finished committing transaction");
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ "LR: editFunctionalMenuItem: finished committing transaction");
result = true;
} catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "editFunctionalMenuItem failed", e);
EcompPortalUtils.rollbackTransaction(transaction,
- "createFunctionalMenuItem rollback, exception = " + e);
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
+ "createFunctionalMenuItem rollback, exception = " + e.toString());
} finally {
EcompPortalUtils.closeLocalSession(localSession, "editFunctionalMenuItem");
}
-
+
if (result) {
} else {
- logger.debug(EELFLoggerDelegate.debugLogger, "LR: createFunctionalMenuItem: no result. setting httpStatusCode to "
- + HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ "LR: createFunctionalMenuItem: no result. setting httpStatusCode to "
+ + HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}
}
- }
-
+ }
+
return fieldsValidator;
}
try {
localSession = sessionFactory.openSession();
transaction = localSession.beginTransaction();
- // We must turn off foreign keys before deleting a menu item. Otherwise there will be a
+ // We must turn off foreign keys before deleting a menu item. Otherwise there
+ // will be a
// constraint violation from the ancestors table.
setForeignKeys(localSession, false);
deleteRoles(menuId);
transaction.commit();
result = true;
} catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "deleteFunctionalMenuItem failed", e);
EcompPortalUtils.rollbackTransaction(transaction,
- "deleteFunctionalMenuItem rollback, exception = " + e);
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
+ "deleteFunctionalMenuItem rollback, exception = " + e.toString());
} finally {
EcompPortalUtils.closeLocalSession(localSession, "deleteFunctionalMenuItem");
}
if (result) {
} else {
- logger.debug(EELFLoggerDelegate.debugLogger, "LR: deleteFunctionalMenuItem: no result. setting httpStatusCode to "
- + HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ "LR: deleteFunctionalMenuItem: no result. setting httpStatusCode to "
+ + HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}
return fieldsValidator;
}
-
+
// Regenerate the fn_menu_functional_ancestors table, which is used
// by the queries that return the functional menu items.
public FieldsValidator regenerateAncestorTable() {
Query query = localSession.createSQLQuery(sql);
query.executeUpdate();
logger.debug(EELFLoggerDelegate.debugLogger, "regenerateAncestorTable: finished query 1");
-
+
sql = "ALTER TABLE fn_menu_functional_ancestors AUTO_INCREMENT=1";
logQuery(sql);
query = localSession.createSQLQuery(sql);
logger.debug(EELFLoggerDelegate.debugLogger, "regenerateAncestorTable: finished query 3");
transaction.commit();
} catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "regenerateAncestorTable failed", e);
EcompPortalUtils.rollbackTransaction(transaction,
- "regenerateAncestorTable rollback, exception = " + e);
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
+ "regenerateAncestorTable rollback, exception = " + e.toString());
fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
} finally {
EcompPortalUtils.closeLocalSession(localSession, "regenerateAncestorTable");
public FieldsValidator setFavoriteItem(FavoritesFunctionalMenuItem menuItemJson) {
boolean result = false;
FieldsValidator fieldsValidator = new FieldsValidator();
-
+
Session localSession = null;
Transaction transaction = null;
-
+
try {
- logger.debug(EELFLoggerDelegate.debugLogger, String.format("Before adding favorite for user id:{0} and menu id:{1} ",menuItemJson.userId,menuItemJson.menuId));
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ String.format("Before adding favorite for user id:{0} and menu id:{1} ", menuItemJson.userId,
+ menuItemJson.menuId));
localSession = sessionFactory.openSession();
transaction = localSession.beginTransaction();
localSession.save(menuItemJson);
- transaction.commit();
+ transaction.commit();
result = true;
- logger.debug(EELFLoggerDelegate.debugLogger, String.format("After adding favorite for user id:{0} and menu id:{1} ",menuItemJson.userId,menuItemJson.menuId));
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ String.format("After adding favorite for user id:{0} and menu id:{1} ", menuItemJson.userId,
+ menuItemJson.menuId));
} catch (Exception e) {
- EcompPortalUtils.rollbackTransaction(transaction,"setFavoriteItem rollback, exception = " + e);
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "setFavoriteItem failed", e);
+ EcompPortalUtils.rollbackTransaction(transaction, "setFavoriteItem rollback, exception = " + e.toString());
} finally {
EcompPortalUtils.closeLocalSession(localSession, "setFavoriteItem");
- }
-
- if(result) {
}
- else {
+
+ if (result) {
+ } else {
fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}
-
+
return fieldsValidator;
}
-
- public List<FavoritesFunctionalMenuItemJson> getFavoriteItems(Long userId) {
+
+ public List<FavoritesFunctionalMenuItemJson> getFavoriteItems(Long userId) {
try {
logger.debug(EELFLoggerDelegate.debugLogger, "Before getting favorites for user id: " + userId);
-
- // Divide this into 2 queries: one which returns the favorites items associated with Restricted apps,
- // and one that returns all the other favorites items. Then we can easily add the boolean flag
- // restrictedApp to each FavoritesFunctionalMenuItemJson, to be used by the front end.
+
+ // Divide this into 2 queries: one which returns the favorites items associated
+ // with Restricted apps,
+ // and one that returns all the other favorites items. Then we can easily add
+ // the boolean flag
+ // restrictedApp to each FavoritesFunctionalMenuItemJson, to be used by the
+ // front end.
String sql = "SELECT f.user_id,f.menu_id,m.text,m.url "
+ " FROM fn_menu_favorites f, fn_menu_functional m, fn_menu_functional_roles mr "
- + " WHERE f.user_id='" + userId + "' AND f.menu_id = m.menu_id "
- + " AND f.menu_id = mr.menu_id "
+ + " WHERE f.user_id='" + userId + "' AND f.menu_id = m.menu_id " + " AND f.menu_id = mr.menu_id "
+ " AND mr.role_id = '" + RESTRICTED_APP_ROLE_ID + "' ";
@SuppressWarnings("unchecked")
- List<FavoritesFunctionalMenuItemJson> menuItems = dataAccessService.executeSQLQuery(sql, FavoritesFunctionalMenuItemJson.class, null);
+ List<FavoritesFunctionalMenuItemJson> menuItems = dataAccessService.executeSQLQuery(sql,
+ FavoritesFunctionalMenuItemJson.class, null);
for (FavoritesFunctionalMenuItemJson menuItem : menuItems) {
menuItem.restrictedApp = true;
}
-
+
sql = "SELECT DISTINCT f.user_id,f.menu_id,m.text,m.url "
+ " FROM fn_menu_favorites f, fn_menu_functional m, fn_menu_functional_roles mr "
- + " WHERE f.user_id='" + userId + "' AND f.menu_id = m.menu_id "
- + " AND f.menu_id = mr.menu_id "
+ + " WHERE f.user_id='" + userId + "' AND f.menu_id = m.menu_id " + " AND f.menu_id = mr.menu_id "
+ " AND mr.role_id != '" + RESTRICTED_APP_ROLE_ID + "' ";
@SuppressWarnings("unchecked")
- List<FavoritesFunctionalMenuItemJson> menuItems2 = dataAccessService.executeSQLQuery(sql, FavoritesFunctionalMenuItemJson.class, null);
+ List<FavoritesFunctionalMenuItemJson> menuItems2 = dataAccessService.executeSQLQuery(sql,
+ FavoritesFunctionalMenuItemJson.class, null);
for (FavoritesFunctionalMenuItemJson menuItem : menuItems2) {
menuItem.restrictedApp = false;
menuItems.add(menuItem);
}
-
+
return menuItems;
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred in FunctionalMenuServiceImpl.getFavoriteItems. Details: " + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "getFavoriteItems failed", e);
List<FavoritesFunctionalMenuItemJson> menuItems = new ArrayList<FavoritesFunctionalMenuItemJson>();
return menuItems;
- }
+ }
}
-
+
public FieldsValidator removeFavoriteItem(Long userId, Long menuId) {
boolean result = false;
FieldsValidator fieldsValidator = new FieldsValidator();
-
+
Session localSession = null;
Transaction transaction = null;
-
- try {
-
+
+ try {
+
FavoritesFunctionalMenuItem menuItemJson = new FavoritesFunctionalMenuItem();
menuItemJson.userId = userId;
menuItemJson.menuId = menuId;
-
+
localSession = sessionFactory.openSession();
transaction = localSession.beginTransaction();
localSession.delete(menuItemJson);
localSession.flush();
- transaction.commit();
+ transaction.commit();
result = true;
- logger.debug(EELFLoggerDelegate.debugLogger, String.format("After removing favorite for user id: " + userId + "; menu id: " + menuId));
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ String.format("After removing favorite for user id: " + userId + "; menu id: " + menuId));
} catch (Exception e) {
- EcompPortalUtils.rollbackTransaction(transaction,"removeFavoriteItem rollback, exception = " + e);
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
- } finally {
+ logger.error(EELFLoggerDelegate.errorLogger, "removeFavoriteItem failed", e);
+ EcompPortalUtils.rollbackTransaction(transaction,
+ "removeFavoriteItem rollback, exception = " + e.toString());
+ } finally {
EcompPortalUtils.closeLocalSession(localSession, "removeFavoriteItem");
- }
-
- if(result) {
}
- else {
+
+ if (result) {
+ } else {
fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}
-
+
return fieldsValidator;
}
-
+
@Override
public void assignHelpURLs(List<FunctionalMenuItem> menuItems) {
try {
String user_guide_link = SystemProperties.getProperty(EPCommonSystemProperties.USER_GUIDE_URL);
-
- for(FunctionalMenuItem menuItem: menuItems){
- if(menuItem.text.equalsIgnoreCase("Contact Us")){
+
+ for (FunctionalMenuItem menuItem : menuItems) {
+ if (menuItem.text.equalsIgnoreCase("Contact Us")) {
menuItem.setUrl("contactUs");
- //menuItem.setRestrictedApp(true);
+ // menuItem.setRestrictedApp(true);
}
- if(menuItem.text.equalsIgnoreCase("Get Access")) {
+ if (menuItem.text.equalsIgnoreCase("Get Access")) {
menuItem.setUrl("getAccess");
}
- if(menuItem.text.equalsIgnoreCase("User Guide")) {
+ if (menuItem.text.equalsIgnoreCase("User Guide")) {
menuItem.setUrl(user_guide_link);
menuItem.setRestrictedApp(true);
}
}
- } catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, "assignHelpURLs process failed. Details: " + EcompPortalUtils.getStackTrace(e));
+ } catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "assignHelpURLs process failed", e);
}
-
+
}
public List<FunctionalMenuRole> getFunctionalMenuRole() {
logger.debug(EELFLoggerDelegate.debugLogger, "getFunctionalMenuRole: logged the query");
@SuppressWarnings("unchecked")
- List<FunctionalMenuRole> functionalMenuRole = dataAccessService.executeSQLQuery(sql, FunctionalMenuRole.class, null);
-
+ List<FunctionalMenuRole> functionalMenuRole = dataAccessService.executeSQLQuery(sql, FunctionalMenuRole.class,
+ null);
+
return functionalMenuRole;
}
List<BusinessCardApplicationRole> userAppRoles = null;
try {
- userAppRoles = dataAccessService
- .executeNamedQuery("getUserApproles", params, null);
+ userAppRoles = dataAccessService.executeNamedQuery("getUserApproles", params, null);
} catch (Exception e) {
// TODO Auto-generated catch block
logger.error(EELFLoggerDelegate.errorLogger, "getUserAppRolesList failed", e);
- }
+ }
return userAppRoles;
}
-
+
}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
@EPMetricsLog
public class MicroserviceProxyServiceImpl implements MicroserviceProxyService {
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MicroserviceProxyServiceImpl.class);
+ private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MicroserviceProxyServiceImpl.class);
+
private static final String BASIC_AUTH = "Basic Authentication";
private static final String NO_AUTH = "No Authentication";
private static final String COOKIE_AUTH = "Cookie based Authentication";
private static final String QUESTION_MARK = "?";
private static final String ADD_MARK = "&";
- String whatService = "widgets-service";
-
@Autowired
private ConsulHealthService consulHealthService;
-
@Autowired
MicroserviceService microserviceService;
-
@Autowired
WidgetParameterService widgetParameterService;
- RestTemplate template = new RestTemplate();
+ private String whatService = "widgets-service";
+
+ private RestTemplate template = new RestTemplate();
@Override
public String proxyToDestination(long serviceId, EPUser user, HttpServletRequest request) throws Exception {
-
- //get the microservice object by the id
+ // get the microservice object by the id
MicroserviceData data = microserviceService.getMicroserviceDataById(serviceId);
-
// No such microservice available
if (data == null) {
- //can we return a better response than null?
+ // can we return a better response than null?
return null;
}
-
return authenticateAndRespond(data, request, composeParams(data, user));
}
-
+
@Override
public String proxyToDestinationByWidgetId(long widgetId, EPUser user, HttpServletRequest request)
throws Exception {
-
- String response = null;
-
@SuppressWarnings({ "rawtypes", "unchecked" })
ResponseEntity<Long> ans = (ResponseEntity<Long>) template.exchange(
EcompPortalUtils.widgetMsProtocol() + "://"
+ "/widget/microservices/widgetCatalog/parameters/" + widgetId,
HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), Long.class);
Long serviceId = ans.getBody();
-
// get the microservice object by the id
MicroserviceData data = microserviceService.getMicroserviceDataById(serviceId);
-
// No such microservice available
- if (data == null) {
- return response;
- }
+ if (data == null)
+ return null;
List<MicroserviceParameter> params = composeParams(data, user);
for (MicroserviceParameter p : params) {
if (userValue != null)
p.setPara_value(userValue.getUser_value());
}
-
return authenticateAndRespond(data, request, params);
-
}
- private String authenticateAndRespond(MicroserviceData data, HttpServletRequest request, List<MicroserviceParameter> params){
-
+ private String authenticateAndRespond(MicroserviceData data, HttpServletRequest request,
+ List<MicroserviceParameter> params) throws HttpClientErrorException, IllegalArgumentException {
String response = null;
-
if (data.getSecurityType().equals(NO_AUTH)) {
HttpEntity<String> entity = new HttpEntity<String>(headersForNoAuth());
-
String url = microserviceUrlConverter(data, params);
- try {
- logger.debug(EELFLoggerDelegate.debugLogger, "Before making no authentication call: {}", url);
- response = template.exchange(url, HttpMethod.GET, entity, String.class).getBody();
- logger.debug(EELFLoggerDelegate.debugLogger, "No authentication call response: {}", response);
-
- } catch (HttpClientErrorException e) {
- throw e;
- }
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ "authenticateAndRespond: Before making no authentication call: {}", url);
+ response = template.exchange(url, HttpMethod.GET, entity, String.class).getBody();
+ logger.debug(EELFLoggerDelegate.debugLogger, "authenticateAndRespond: No authentication call response: {}",
+ response);
} else if (data.getSecurityType().equals(BASIC_AUTH)) {
// encoding the username and password
String plainCreds = null;
- try{
+ try {
plainCreds = data.getUsername() + ":" + decryptedPassword(data.getPassword());
- }
- catch(Exception e){
- logger.error("problem decrypting password ... check if decryption key is correct in system.properties: ", e);
+ } catch (Exception e) {
+ logger.error("authenticateAndRespond failed to decrypt password", e);
+ throw new IllegalArgumentException("Failed to decrypt password", e);
}
byte[] plainCredsBytes = plainCreds.getBytes();
byte[] base64CredsBytes = Base64.encodeBase64(plainCredsBytes);
try {
response = template.exchange(url, HttpMethod.GET, entity, String.class).getBody();
} catch (HttpClientErrorException e) {
- logger.error("Problem while talking to {1} - message: {2} ", url, e.getMessage());
+ logger.error("authenticateAndRespond failed for basic security url " + url, e);
throw e;
}
} else if (data.getSecurityType().equals(COOKIE_AUTH)) {
try {
response = template.exchange(url, HttpMethod.GET, entity, String.class).getBody();
} catch (HttpClientErrorException e) {
+ logger.error("authenticateAndRespond failed for cookie auth url " + url, e);
throw e;
}
}
-
+
return response;
}
-
+
private String decryptedPassword(String encryptedPwd) throws Exception {
String result = "";
- if (encryptedPwd != null & encryptedPwd.length() > 0) {
+ if (encryptedPwd != null && encryptedPwd.length() > 0) {
try {
result = CipherUtil.decrypt(encryptedPwd,
SystemProperties.getProperty(SystemProperties.Decryption_Key));
throw e;
}
}
-
+
return result;
}
return url;
}
-
- private HttpHeaders headersForNoAuth(){
+
+ private HttpHeaders headersForNoAuth() {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
return headers;
}
+
+ // TODO: why is this generically named cookie used?
+ private final static String Cookie = "Cookie";
- private HttpHeaders headersForBasicAuth(HttpServletRequest request, String base64Creds){
+ private HttpHeaders headersForBasicAuth(HttpServletRequest request, String base64Creds) {
HttpHeaders headers = new HttpHeaders();
headers.add("Authorization", "Basic " + base64Creds);
headers.setContentType(MediaType.APPLICATION_JSON);
- String rawCookie = request.getHeader("Cookie");
- headers.add("Cookie", rawCookie);
-
+ String rawCookie = request.getHeader(Cookie);
+ if (rawCookie != null)
+ headers.add(Cookie, rawCookie);
return headers;
}
- private HttpHeaders headersForCookieAuth(HttpServletRequest request){
+ private HttpHeaders headersForCookieAuth(HttpServletRequest request) {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
- String rawCookie = request.getHeader("Cookie");
- headers.add("Cookie", rawCookie);
-
+ String rawCookie = request.getHeader(Cookie);
+ if (rawCookie != null)
+ headers.add(Cookie, rawCookie);
return headers;
}
-
- private List<MicroserviceParameter> composeParams(MicroserviceData data, EPUser user){
+
+ private List<MicroserviceParameter> composeParams(MicroserviceData data, EPUser user) {
List<MicroserviceParameter> params = data.getParameterList();
- MicroserviceParameter userId_param = new MicroserviceParameter();
- userId_param.setPara_key("userId");
- userId_param.setPara_value(user.getOrgUserId());
- params.add(userId_param);
-
+ MicroserviceParameter userIdParam = new MicroserviceParameter();
+ userIdParam.setPara_key("userId");
+ userIdParam.setPara_value(user.getOrgUserId());
+ params.add(userIdParam);
return params;
}
}
\ No newline at end of file
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
logger.debug(EELFLoggerDelegate.debugLogger, "getPortalAdmins was successful");
return portalAdmins;
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger,
- "Exception occurred while performing getPortalAdmins operation, Details: "
- + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "getPortalAdmins failed", e);
return null;
}
}
else
logger.error(EELFLoggerDelegate.errorLogger, "PortalAdminServiceImpl createPortalAdmin: failed to Add role in the external central auth system since User obj is null" );
} catch (Exception e) {
- EcompPortalUtils.rollbackTransaction(transaction, "createPortalAdmin rollback, exception = " + e);
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "createPortalAdmin failed", e);
+ EcompPortalUtils.rollbackTransaction(transaction, "createPortalAdmin rollback, exception = " + e.toString());
} finally {
EcompPortalUtils.closeLocalSession(localSession, "createPortalAdmin");
}
transaction.commit();
result = deletePortalAdminInExternalCentralAuth(userId, PortalConstants.PORTAL_ADMIN_ROLE);
} catch (Exception e) {
- EcompPortalUtils.rollbackTransaction(transaction, "deletePortalAdmin rollback, exception = " + e);
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "deletePortalAdmin failed", e);
+ EcompPortalUtils.rollbackTransaction(transaction, "deletePortalAdmin rollback, exception = " + e.toString());
} finally {
EcompPortalUtils.closeLocalSession(localSession, "deletePortalAdmin");
}
return true;
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger,
- "Exception occurred while performing isLoggedInUserPortalAdmin operation, Details: "
- + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "isLoggedInUserPortalAdmin failed", e);
return false;
}
}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
import java.util.ArrayList;
import java.util.List;
+import org.openecomp.portalapp.portal.domain.EPUser;
+import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
+import org.openecomp.portalapp.portal.transport.UserWithNameSurnameTitle;
+import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalapp.portal.transport.UserWithNameSurnameTitle;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
try {
result = mapper.writeValueAsString(resultOfSearch);
} catch (JsonProcessingException e) {
- logger.error(EELFLoggerDelegate.errorLogger, "searchUsersInPhoneBook Exception = " + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "searchUsersInPhoneBook failed", e);
}
return result;
}
foundUsers.add(foundUser);
}
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, "searchInPhoneBookWithToken Exception = " + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "searchUsersByAttrs failed", e);
}
return foundUsers;
}
}
}
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, "searchUserBy orgUserId exception = " + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "searchUserByUserId failed", e);
}
return user;
}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.service;
import com.fasterxml.jackson.databind.JsonNode;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
transaction.commit();
result = true;
} catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "syncUserRoles failed", e);
EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
EcompPortalUtils.rollbackTransaction(transaction,
- "Exception occurred in syncUserRoles, Details: " + EcompPortalUtils.getStackTrace(e));
+ "Exception occurred in syncUserRoles, Details: " + e.toString());
if("DELETE".equals(reqType)){
throw new Exception(e.getMessage());
}
transaction.commit();
logger.debug(EELFLoggerDelegate.debugLogger, "syncAppRoles: committed the transaction");
} catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "syncAppRoles failed", e);
EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
EcompPortalUtils.rollbackTransaction(transaction,
- "syncAppRoles: Exception occurred in syncAppRoles, Details: " + EcompPortalUtils.getStackTrace(e));
+ "Exception occurred in syncAppRoles, Details: " + e.toString());
throw new Exception(e);
} finally {
localSession.close();
try {
logger.error(EELFLoggerDelegate.errorLogger,"Should not be reached here, still the endpoint is yet to be defined");
boolean result = postUserRolesToMylogins(userAppRolesData, applicationsRestClientService, userAppRolesData.appId, user.getId());
-
+ logger.debug(EELFLoggerDelegate.debugLogger,"putUserAppRolesRequest: result {}", result);
+
params.put("appId", userAppRolesData.appId);
EPUserAppRolesRequest epAppRolesRequestData = new EPUserAppRolesRequest();
epAppRolesRequestData.setCreatedDate(new Date());
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
@EPMetricsLog
public class WidgetServiceImpl implements WidgetService {
+ private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WidgetServiceImpl.class);
+
private static final String baseSqlToken = " widget.WIDGET_ID, widget.WDG_NAME, widget.APP_ID, app.APP_NAME, widget.WDG_WIDTH, widget.WDG_HEIGHT, widget.WDG_URL"
+ " from FN_WIDGET widget join FN_APP app ON widget.APP_ID = app.APP_ID";
private static final String urlField = "url";
private static final String nameField = "name";
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WidgetServiceImpl.class);
-
@Autowired
AdminRolesService adminRolesService;
@Autowired
ACCOUNT_ADMIN_ROLE_ID = Long.valueOf(SystemProperties.getProperty(EPCommonSystemProperties.ACCOUNT_ADMIN_ROLE_ID));
LONG_ECOMP_APP_ID = Long.valueOf(SystemProperties.getProperty(EPCommonSystemProperties.ECOMP_APP_ID));
} catch(Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "init failed", e);
}
}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import java.io.Serializable;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import java.io.Serializable;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import java.util.Arrays;
public String uebKey; // ueb_key
public String uebSecret; // ueb_secret
public String uebTopicName; // ueb_topic_name
-
-
+
public CentralApp(Long id, Date created, Date modified, Long createdId, Long modifiedId, Long rowNum, String name,
String imageUrl, String description, String notes, String url, String alternateUrl, String restEndpoint,
String mlAppName, String mlAppAdminId, String motsId, String appPassword, String open, String enabled,
this.uebSecret = uebSecret;
this.uebTopicName = uebTopicName;
}
-
+
public Long getId() {
return id;
}
+
public void setId(Long id) {
this.id = id;
}
-
+
public Date getCreated() {
return created;
}
+
public void setCreated(Date created) {
this.created = created;
}
+
public Date getModified() {
return modified;
}
+
public void setModified(Date modified) {
this.modified = modified;
}
+
public Long getCreatedId() {
return createdId;
}
+
public void setCreatedId(Long createdId) {
this.createdId = createdId;
}
+
public Long getModifiedId() {
return modifiedId;
}
+
public void setModifiedId(Long modifiedId) {
this.modifiedId = modifiedId;
}
+
public Long getRowNum() {
return rowNum;
}
+
public void setRowNum(Long rowNum) {
this.rowNum = rowNum;
}
+
public String getName() {
return name;
}
+
public void setName(String name) {
this.name = name;
}
+
public String getImageUrl() {
return imageUrl;
}
+
public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
}
+
public String getDescription() {
return description;
}
+
public void setDescription(String description) {
this.description = description;
}
+
public String getNotes() {
return notes;
}
+
public void setNotes(String notes) {
this.notes = notes;
}
+
public String getUrl() {
return url;
}
+
public void setUrl(String url) {
this.url = url;
}
+
public String getAlternateUrl() {
return alternateUrl;
}
+
public void setAlternateUrl(String alternateUrl) {
this.alternateUrl = alternateUrl;
}
+
public String getRestEndpoint() {
return restEndpoint;
}
+
public void setRestEndpoint(String restEndpoint) {
this.restEndpoint = restEndpoint;
}
+
public String getMlAppName() {
return mlAppName;
}
+
public void setMlAppName(String mlAppName) {
this.mlAppName = mlAppName;
}
+
public String getMlAppAdminId() {
return mlAppAdminId;
}
+
public void setMlAppAdminId(String mlAppAdminId) {
this.mlAppAdminId = mlAppAdminId;
}
+
public String getMotsId() {
return motsId;
}
+
public void setMotsId(String motsId) {
this.motsId = motsId;
}
+
public String getAppPassword() {
return appPassword;
}
+
public void setAppPassword(String appPassword) {
this.appPassword = appPassword;
}
+
public String getOpen() {
return open;
}
+
public void setOpen(String open) {
this.open = open;
}
+
public String getEnabled() {
return enabled;
}
+
public void setEnabled(String enabled) {
this.enabled = enabled;
}
+
public byte[] getThumbnail() {
return thumbnail;
}
+
public void setThumbnail(byte[] thumbnail) {
this.thumbnail = thumbnail;
}
+
public String getUsername() {
return username;
}
+
public void setUsername(String username) {
this.username = username;
}
+
public String getUebKey() {
return uebKey;
}
+
public void setUebKey(String uebKey) {
this.uebKey = uebKey;
}
+
public String getUebSecret() {
return uebSecret;
}
+
public void setUebSecret(String uebSecret) {
this.uebSecret = uebSecret;
}
+
public String getUebTopicName() {
return uebTopicName;
}
+
public void setUebTopicName(String uebTopicName) {
this.uebTopicName = uebTopicName;
}
return false;
return true;
}
-
-
+
}
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import java.util.Date;
import org.openecomp.portalapp.portal.domain.CentralRoleFunction;
import org.openecomp.portalapp.portal.domain.EPRole;
-public class CentralRole implements Comparable{
- public Long id;
- public Date created;
- public Date modified;
- public Long createdId;
- public Long modifiedId;
- public Long rowNum;
-
- public String name;
- public boolean active;
- public Integer priority;
-
- public SortedSet<CentralRoleFunction> roleFunctions = null;
-
- public SortedSet<CentralRole> childRoles = null;
-
- public SortedSet<CentralRole> parentRoles = null;
-
- public CentralRole(Long id, Date created, Date modified, Long createdId, Long modifiedId, Long rowNum,
- String name, boolean active, Integer priority, SortedSet<CentralRoleFunction> roleFunctions,
- SortedSet<CentralRole> childRoles, SortedSet<CentralRole> parentRoles) {
- super();
- this.id = id;
- this.created = created;
- this.modified = modified;
- this.createdId = createdId;
- this.modifiedId = modifiedId;
- this.rowNum = rowNum;
- this.name = name;
- this.active = active;
- this.priority = priority;
- this.roleFunctions = roleFunctions;
- this.childRoles = childRoles;
- this.parentRoles = parentRoles;
- }
-
- public CentralRole(){
-
- }
-
- public CentralRole(Long id, String name){
- this.id = id;
- this.name = name;
- }
-
- public Long getId() {
- return id;
- }
-
- public void setId(Long id) {
- this.id = id;
- }
-
- public Date getCreated() {
- return created;
- }
-
- public void setCreated(Date created) {
- this.created = created;
- }
-
- public Date getModified() {
- return modified;
- }
-
- public void setModified(Date modified) {
- this.modified = modified;
- }
-
- public Long getCreatedId() {
- return createdId;
- }
-
- public void setCreatedId(Long createdId) {
- this.createdId = createdId;
- }
-
- public Long getModifiedId() {
- return modifiedId;
- }
-
- public void setModifiedId(Long modifiedId) {
- this.modifiedId = modifiedId;
- }
-
- public Long getRowNum() {
- return rowNum;
- }
-
- public void setRowNum(Long rowNum) {
- this.rowNum = rowNum;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public boolean isActive() {
- return active;
- }
-
- public void setActive(boolean active) {
- this.active = active;
- }
-
- public Integer getPriority() {
- return priority;
- }
-
- public void setPriority(Integer priority) {
- this.priority = priority;
- }
-
- public SortedSet<CentralRoleFunction> getRoleFunctions() {
- return roleFunctions;
- }
-
- public void setRoleFunctions(SortedSet<CentralRoleFunction> roleFunctions) {
- this.roleFunctions = roleFunctions;
- }
-
- public SortedSet<CentralRole> getChildRoles() {
- return childRoles;
- }
-
- public void setChildRoles(SortedSet<CentralRole> childRoles) {
- this.childRoles = childRoles;
- }
-
- public SortedSet<CentralRole> getParentRoles() {
- return parentRoles;
- }
-
- public void setParentRoles(SortedSet<CentralRole> parentRoles) {
- this.parentRoles = parentRoles;
- }
-
- public int compareTo(Object obj){
- EPRole other = (EPRole)obj;
-
- String c1 = getName();
- String c2 = other.getName();
-
- return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2);
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + (active ? 1231 : 1237);
- result = prime * result + ((childRoles == null) ? 0 : childRoles.hashCode());
- result = prime * result + ((created == null) ? 0 : created.hashCode());
- result = prime * result + ((createdId == null) ? 0 : createdId.hashCode());
- result = prime * result + ((id == null) ? 0 : id.hashCode());
- result = prime * result + ((modified == null) ? 0 : modified.hashCode());
- result = prime * result + ((modifiedId == null) ? 0 : modifiedId.hashCode());
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- result = prime * result + ((parentRoles == null) ? 0 : parentRoles.hashCode());
- result = prime * result + ((priority == null) ? 0 : priority.hashCode());
- result = prime * result + ((roleFunctions == null) ? 0 : roleFunctions.hashCode());
- result = prime * result + ((rowNum == null) ? 0 : rowNum.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- CentralRole other = (CentralRole) obj;
- if (active != other.active)
- return false;
- if (childRoles == null) {
- if (other.childRoles != null)
- return false;
- } else if (!childRoles.equals(other.childRoles))
+public class CentralRole implements Comparable {
+ public Long id;
+ public Date created;
+ public Date modified;
+ public Long createdId;
+ public Long modifiedId;
+ public Long rowNum;
+
+ public String name;
+ public boolean active;
+ public Integer priority;
+
+ public SortedSet<CentralRoleFunction> roleFunctions = null;
+
+ public SortedSet<CentralRole> childRoles = null;
+
+ public SortedSet<CentralRole> parentRoles = null;
+
+ public CentralRole(Long id, Date created, Date modified, Long createdId, Long modifiedId, Long rowNum, String name,
+ boolean active, Integer priority, SortedSet<CentralRoleFunction> roleFunctions,
+ SortedSet<CentralRole> childRoles, SortedSet<CentralRole> parentRoles) {
+ super();
+ this.id = id;
+ this.created = created;
+ this.modified = modified;
+ this.createdId = createdId;
+ this.modifiedId = modifiedId;
+ this.rowNum = rowNum;
+ this.name = name;
+ this.active = active;
+ this.priority = priority;
+ this.roleFunctions = roleFunctions;
+ this.childRoles = childRoles;
+ this.parentRoles = parentRoles;
+ }
+
+ public CentralRole() {
+
+ }
+
+ public CentralRole(Long id, String name) {
+ this.id = id;
+ this.name = name;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public Date getCreated() {
+ return created;
+ }
+
+ public void setCreated(Date created) {
+ this.created = created;
+ }
+
+ public Date getModified() {
+ return modified;
+ }
+
+ public void setModified(Date modified) {
+ this.modified = modified;
+ }
+
+ public Long getCreatedId() {
+ return createdId;
+ }
+
+ public void setCreatedId(Long createdId) {
+ this.createdId = createdId;
+ }
+
+ public Long getModifiedId() {
+ return modifiedId;
+ }
+
+ public void setModifiedId(Long modifiedId) {
+ this.modifiedId = modifiedId;
+ }
+
+ public Long getRowNum() {
+ return rowNum;
+ }
+
+ public void setRowNum(Long rowNum) {
+ this.rowNum = rowNum;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public boolean isActive() {
+ return active;
+ }
+
+ public void setActive(boolean active) {
+ this.active = active;
+ }
+
+ public Integer getPriority() {
+ return priority;
+ }
+
+ public void setPriority(Integer priority) {
+ this.priority = priority;
+ }
+
+ public SortedSet<CentralRoleFunction> getRoleFunctions() {
+ return roleFunctions;
+ }
+
+ public void setRoleFunctions(SortedSet<CentralRoleFunction> roleFunctions) {
+ this.roleFunctions = roleFunctions;
+ }
+
+ public SortedSet<CentralRole> getChildRoles() {
+ return childRoles;
+ }
+
+ public void setChildRoles(SortedSet<CentralRole> childRoles) {
+ this.childRoles = childRoles;
+ }
+
+ public SortedSet<CentralRole> getParentRoles() {
+ return parentRoles;
+ }
+
+ public void setParentRoles(SortedSet<CentralRole> parentRoles) {
+ this.parentRoles = parentRoles;
+ }
+
+ public int compareTo(Object obj) {
+ EPRole other = (EPRole) obj;
+
+ String c1 = getName();
+ String c2 = other.getName();
+
+ return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2);
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (active ? 1231 : 1237);
+ result = prime * result + ((childRoles == null) ? 0 : childRoles.hashCode());
+ result = prime * result + ((created == null) ? 0 : created.hashCode());
+ result = prime * result + ((createdId == null) ? 0 : createdId.hashCode());
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ result = prime * result + ((modified == null) ? 0 : modified.hashCode());
+ result = prime * result + ((modifiedId == null) ? 0 : modifiedId.hashCode());
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + ((parentRoles == null) ? 0 : parentRoles.hashCode());
+ result = prime * result + ((priority == null) ? 0 : priority.hashCode());
+ result = prime * result + ((roleFunctions == null) ? 0 : roleFunctions.hashCode());
+ result = prime * result + ((rowNum == null) ? 0 : rowNum.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ CentralRole other = (CentralRole) obj;
+ if (active != other.active)
+ return false;
+ if (childRoles == null) {
+ if (other.childRoles != null)
return false;
- if (created == null) {
- if (other.created != null)
- return false;
- } else if (!created.equals(other.created))
+ } else if (!childRoles.equals(other.childRoles))
+ return false;
+ if (created == null) {
+ if (other.created != null)
return false;
- if (createdId == null) {
- if (other.createdId != null)
- return false;
- } else if (!createdId.equals(other.createdId))
+ } else if (!created.equals(other.created))
+ return false;
+ if (createdId == null) {
+ if (other.createdId != null)
return false;
- if (id == null) {
- if (other.id != null)
- return false;
- } else if (!id.equals(other.id))
+ } else if (!createdId.equals(other.createdId))
+ return false;
+ if (id == null) {
+ if (other.id != null)
return false;
- if (modified == null) {
- if (other.modified != null)
- return false;
- } else if (!modified.equals(other.modified))
+ } else if (!id.equals(other.id))
+ return false;
+ if (modified == null) {
+ if (other.modified != null)
return false;
- if (modifiedId == null) {
- if (other.modifiedId != null)
- return false;
- } else if (!modifiedId.equals(other.modifiedId))
+ } else if (!modified.equals(other.modified))
+ return false;
+ if (modifiedId == null) {
+ if (other.modifiedId != null)
return false;
- if (name == null) {
- if (other.name != null)
- return false;
- } else if (!name.equals(other.name))
+ } else if (!modifiedId.equals(other.modifiedId))
+ return false;
+ if (name == null) {
+ if (other.name != null)
return false;
- if (parentRoles == null) {
- if (other.parentRoles != null)
- return false;
- } else if (!parentRoles.equals(other.parentRoles))
+ } else if (!name.equals(other.name))
+ return false;
+ if (parentRoles == null) {
+ if (other.parentRoles != null)
return false;
- if (priority == null) {
- if (other.priority != null)
- return false;
- } else if (!priority.equals(other.priority))
+ } else if (!parentRoles.equals(other.parentRoles))
+ return false;
+ if (priority == null) {
+ if (other.priority != null)
return false;
- if (roleFunctions == null) {
- if (other.roleFunctions != null)
- return false;
- } else if (!roleFunctions.equals(other.roleFunctions))
+ } else if (!priority.equals(other.priority))
+ return false;
+ if (roleFunctions == null) {
+ if (other.roleFunctions != null)
return false;
- if (rowNum == null) {
- if (other.rowNum != null)
- return false;
- } else if (!rowNum.equals(other.rowNum))
+ } else if (!roleFunctions.equals(other.roleFunctions))
+ return false;
+ if (rowNum == null) {
+ if (other.rowNum != null)
return false;
- return true;
- }
+ } else if (!rowNum.equals(other.rowNum))
+ return false;
+ return true;
+ }
}
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import java.util.Date;
public class CentralUser {
-
public Long id;
public Date created;
public Date modified;
public Long createdId;
public Long modifiedId;
public Long rowNum;
-
- public Long orgId;
- public Long managerId;
- public String firstName;
- public String middleInitial;
- public String lastName;
- public String phone;
- public String fax;
- public String cellular;
- public String email;
- public Long addressId;
- public String alertMethodCd;
- public String hrid;
- public String orgUserId;
- public String orgCode;
- public String address1;
- public String address2;
- public String city;
- public String state;
- public String zipCode;
- public String country;
- public String orgManagerUserId;
- public String locationClli;
- public String businessCountryCode;
- public String businessCountryName;
- public String businessUnit;
- public String businessUnitName;
- public String department;
- public String departmentName;
- public String companyCode;
- public String company;
- public String zipCodeSuffix;
- public String jobTitle;
- public String commandChain;
- public String siloStatus;
- public String costCenter;
- public String financialLocCode;
- public String loginId;
- public String loginPwd;
- public Date lastLoginDate;
- public boolean active;
- public boolean internal;
- public Long selectedProfileId;
- public Long timeZoneId;
- public boolean online;
- public String chatId;
-
- public Set<CentralUserApp> userApps = null;
+ public Long orgId;
+ public Long managerId;
+ public String firstName;
+ public String middleInitial;
+ public String lastName;
+ public String phone;
+ public String fax;
+ public String cellular;
+ public String email;
+ public Long addressId;
+ public String alertMethodCd;
+ public String hrid;
+ public String orgUserId;
+ public String orgCode;
+ public String address1;
+ public String address2;
+ public String city;
+ public String state;
+ public String zipCode;
+ public String country;
+ public String orgManagerUserId;
+ public String locationClli;
+ public String businessCountryCode;
+ public String businessCountryName;
+ public String businessUnit;
+ public String businessUnitName;
+ public String department;
+ public String departmentName;
+ public String companyCode;
+ public String company;
+ public String zipCodeSuffix;
+ public String jobTitle;
+ public String commandChain;
+ public String siloStatus;
+ public String costCenter;
+ public String financialLocCode;
+
+ public String loginId;
+ public String loginPwd;
+ public Date lastLoginDate;
+ public boolean active;
+ public boolean internal;
+ public Long selectedProfileId;
+ public Long timeZoneId;
+ public boolean online;
+ public String chatId;
+
+ public Set<CentralUserApp> userApps = null;
public Set<CentralRole> pseudoRoles = null;
-
- public CentralUser(){
-
+
+ public CentralUser() {
+
}
-
+
public CentralUser(Long id, Date created, Date modified, Long createdId, Long modifiedId, Long rowNum, Long orgId,
Long managerId, String firstName, String middleInitial, String lastName, String phone, String fax,
String cellular, String email, Long addressId, String alertMethodCd, String hrid, String orgUserId,
return false;
return true;
}
-
-
-
}
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
@SuppressWarnings("rawtypes")
-public class CentralUserApp implements Comparable{
-
+public class CentralUserApp implements Comparable {
+
private Long userId;
private CentralApp app;
private CentralRole role;
private Short priority;
-
-
-
+
public Long getUserId() {
return userId;
}
-
-
public void setUserId(Long userId) {
this.userId = userId;
}
-
-
public CentralApp getApp() {
return app;
}
-
-
public void setApp(CentralApp app) {
this.app = app;
}
-
-
public CentralRole getRole() {
return role;
}
-
-
public void setRole(CentralRole role) {
this.role = role;
}
-
-
public Short getPriority() {
return priority;
}
-
-
public void setPriority(Short priority) {
this.priority = priority;
}
+ public int compareTo(Object other) {
+ CentralUserApp castOther = (CentralUserApp) other;
+ Long c1 = (this.getUserId() == null ? 0 : this.getUserId()) + (this.priority == null ? 0 : this.priority);
+ Long c2 = (castOther.getUserId() == null ? 0 : castOther.getUserId())
+ + (castOther.getApp() == null || castOther.getApp().getId() == null ? 0 : castOther.getApp().getId())
+ + (castOther.priority == null ? 0 : castOther.priority);
- public int compareTo(Object other){
- CentralUserApp castOther = (CentralUserApp) other;
-
- Long c1 = (this.getUserId()==null ? 0 : this.getUserId()) + (this.priority==null ? 0 : this.priority);
- Long c2 = (castOther.getUserId()==null ? 0 : castOther.getUserId()) + (castOther.getApp()==null||castOther.getApp().getId()==null ? 0 : castOther.getApp().getId()) + (castOther.priority==null ? 0 : castOther.priority);
-
- return c1.compareTo(c2);
+ return c1.compareTo(c2);
}
-
+
}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import java.io.Serializable;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import java.io.Serializable;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import java.io.Serializable;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
/*package org.openecomp.portalapp.portal.transport;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
/*package org.openecomp.portalapp.portal.transport;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import java.io.Serializable;
-public class ExternalAccessPerms implements Serializable, Comparable{
+public class ExternalAccessPerms implements Serializable, Comparable {
/**
*
public String instance;
public String action;
public String description;
-
-
+
public ExternalAccessPerms() {
super();
}
-
-
-
+
public ExternalAccessPerms(String type, String instance, String action, String description) {
super();
this.type = type;
this.action = action;
}
-
/**
* @return the type
*/
public String getType() {
return type;
}
+
/**
- * @param type the type to set
+ * @param type
+ * the type to set
*/
public void setType(String type) {
this.type = type;
}
+
/**
* @return the instance
*/
public String getInstance() {
return instance;
}
+
/**
- * @param instance the instance to set
+ * @param instance
+ * the instance to set
*/
public void setInstance(String instance) {
this.instance = instance;
}
+
/**
* @return the action
*/
public String getAction() {
return action;
}
+
/**
- * @param action the action to set
+ * @param action
+ * the action to set
*/
public void setAction(String action) {
this.action = action;
this.description = description;
}
-
@Override
- public int compareTo(Object obj){
- ExternalAccessPerms other = (ExternalAccessPerms)obj;
+ public int compareTo(Object obj) {
+ ExternalAccessPerms other = (ExternalAccessPerms) obj;
- String c1 = getInstance();
- String c2 = other.getInstance();
+ String c1 = getInstance();
+ String c2 = other.getInstance();
- return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2);
+ return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2);
}
-
-
@Override
public int hashCode() {
final int prime = 31;
return result;
}
-
-
@Override
public boolean equals(Object obj) {
if (this == obj)
return false;
return true;
}
-
-
+
}
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonRootName;
@JsonIgnoreProperties(ignoreUnknown = true)
-@JsonRootName(value="perm")
+@JsonRootName(value = "perm")
public class ExternalAccessPermsDetail {
private String type;
private String action;
private List<String> roles;
private String description;
-
-
-
+
public ExternalAccessPermsDetail() {
super();
}
this.roles = roles;
this.description = description;
}
-
+
/**
* @param type
* @param instance
* @param action
* @param description
*/
- public ExternalAccessPermsDetail(String type, String instance, String action,
- String description) {
+ public ExternalAccessPermsDetail(String type, String instance, String action, String description) {
super();
this.type = type;
this.instance = instance;
this.action = action;
this.description = description;
}
-
+
public String getType() {
return type;
}
+
public void setType(String type) {
this.type = type;
}
+
public String getInstance() {
return instance;
}
+
public void setInstance(String instance) {
this.instance = instance;
}
+
public String getAction() {
return action;
}
+
public void setAction(String action) {
this.action = action;
}
+
public List<String> getRoles() {
return roles;
}
public String getDescription() {
return description;
}
+
public void setDescription(String description) {
this.description = description;
}
-
-
+
}
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import java.io.Serializable;
private static final long serialVersionUID = 3439986826362436339L;
public String name;
public String description;
-
+
public ExternalAccessRole() {
-
+
}
-
+
public ExternalAccessRole(String name, String description) {
super();
this.name = name;
this.description = description;
}
-
+
public String getName() {
return name;
}
public String getDescription() {
return description;
}
+
public void setDescription(String description) {
this.description = description;
}
-
+
}
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
public class ExternalAccessRolePerms {
-
- private ExternalAccessPerms perm;
+
+ private ExternalAccessPerms perm;
private String role;
-
-
+
public ExternalAccessRolePerms(ExternalAccessPerms perm, String role) {
super();
this.perm = perm;
this.role = role;
}
-
+
public ExternalAccessPerms getPerm() {
return perm;
}
+
public void setPerm(ExternalAccessPerms perm) {
this.perm = perm;
}
+
public String getRole() {
return role;
}
+
public void setRole(String role) {
this.role = role;
}
-
-
+
}
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
public class ExternalAccessUser {
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
public class ExternalAccessUserRoleDetail {
-
+
private String name;
private ExternalRoleDescription description;
-
-
+
/**
*
*/
this.name = name;
this.description = description;
}
-
+
public String getName() {
return name;
}
+
public void setName(String name) {
this.name = name;
}
+
public ExternalRoleDescription getDescription() {
return description;
}
+
public void setDescription(ExternalRoleDescription description) {
this.description = description;
}
return false;
return true;
}
-
-
+
}
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
public class ExternalRequestFieldsValidator {
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
public class ExternalRoleDescription {
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
import java.io.Serializable;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
public class ProfileDetail {
-
+
private String firstName;
private String lastName;
private String middleName;
private String email;
private String loginId;
private String loginPassword;
-
- public ProfileDetail(){}
- public ProfileDetail(String firstName, String lastName, String middleName, String email, String loginId, String loginPassword) {
+
+ public ProfileDetail() {
+ }
+
+ public ProfileDetail(String firstName, String lastName, String middleName, String email, String loginId,
+ String loginPassword) {
this.firstName = firstName;
this.lastName = lastName;
this.middleName = middleName;
public String getFirstName() {
return firstName;
}
+
public void setFirstName(String firstName) {
this.firstName = firstName;
}
+
public String getLastName() {
return lastName;
}
+
public void setLastName(String lastName) {
this.lastName = lastName;
}
+
public String getMiddleName() {
return middleName;
}
+
public void setMiddleName(String middleName) {
this.middleName = middleName;
}
+
public String getEmail() {
return email;
}
+
public void setEmail(String email) {
this.email = email;
}
+
public String getLoginId() {
return loginId;
}
+
public void setLoginId(String loginId) {
this.loginId = loginId;
}
+
public String getLoginPassword() {
return loginPassword;
}
+
public void setLoginPassword(String loginPassword) {
this.loginPassword = loginPassword;
}
-
-
+
}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
import java.util.List;
/*-
- * ================================================================================
- * ECOMP Portal SDK
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
/**
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
/*-
- * ================================================================================
- * ECOMP Portal SDK
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.ueb;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Component;
-import org.springframework.transaction.annotation.Transactional;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.onboarding.util.PortalApiConstants;
-import org.openecomp.portalsdk.core.onboarding.util.PortalApiProperties;
-import org.openecomp.portalsdk.core.onboarding.ueb.Helper;
-import org.openecomp.portalsdk.core.onboarding.ueb.Publisher;
-import org.openecomp.portalsdk.core.onboarding.ueb.UebException;
-import org.openecomp.portalsdk.core.onboarding.ueb.UebManager;
-import org.openecomp.portalsdk.core.onboarding.ueb.UebMsg;
import org.openecomp.portalapp.portal.domain.EPApp;
import org.openecomp.portalapp.portal.domain.EcompApp;
import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
import org.openecomp.portalapp.portal.logging.format.EPAppMessagesEnum;
import org.openecomp.portalapp.portal.logging.logic.EPLogUtil;
import org.openecomp.portalapp.portal.service.EPAppService;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.onboarding.ueb.Helper;
+import org.openecomp.portalsdk.core.onboarding.ueb.Publisher;
+import org.openecomp.portalsdk.core.onboarding.ueb.UebException;
+import org.openecomp.portalsdk.core.onboarding.ueb.UebManager;
+import org.openecomp.portalsdk.core.onboarding.ueb.UebMsg;
+import org.openecomp.portalsdk.core.onboarding.util.PortalApiConstants;
+import org.openecomp.portalsdk.core.onboarding.util.PortalApiProperties;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
@Component
@Transactional
@org.springframework.context.annotation.Configuration
@EnableAspectJAutoProxy
public class EPUebHelper {
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPUebHelper.class);
+ private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPUebHelper.class);
@Autowired
- EPAppService appsService;
-
+ private EPAppService appsService;
@Autowired
private SessionFactory sessionFactory;
PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_SECRET),
PortalApiProperties.getProperty(PortalApiConstants.ECOMP_PORTAL_INBOX_NAME));
} catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "initUeb failed", e);
EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeUebConnectionError, e);
- String stackTrace = EcompPortalUtils.getStackTrace(e);
- logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while initializing the publisher. Details: " + stackTrace);
}
Thread thread = new Thread("EPUebManager: postConstructMethod - refreshPublisherList") {
try {
UebManager.getInstance().addPublisher(app.getUebTopicName());
} catch (UebException e) {
- String stackTrace = EcompPortalUtils.getStackTrace(e);
- logger.error(EELFLoggerDelegate.errorLogger, "Exception while adding a publisher. Details: " + stackTrace);
+ logger.error(EELFLoggerDelegate.errorLogger, "addPublisher failed", e);
}
}
public boolean checkAvailability() {
-
//
// Test existence of topic at UEB url
//
}
catch (Exception e) {
available = false;
- String stackTrace = EcompPortalUtils.getStackTrace(e);
- logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while performing the UEB Healthcheck. Details: " + stackTrace);
+ logger.error(EELFLoggerDelegate.errorLogger, "checkAvailability failed", e);
}
}
}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.ueb;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.utils;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.utils;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.utils;
-import java.io.PrintWriter;
-import java.io.StringWriter;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.text.SimpleDateFormat;
private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EcompPortalUtils.class);
+ // TODO: GLOBAL_LOGIN_URL is the same as in SessionTimeoutInterceptor.
+ // It should be defined in SystemProperties.
+ private static final String GLOBAL_LOGIN_URL = "global-login-url";
+
/**
* @param orgUserId
- * @return true if orgUserId is not empty and contains only alphanumeric,
- * false otherwise
+ * User ID to validate
+ * @return true if orgUserId is not empty and contains only alphanumeric, false
+ * otherwise
*/
public static boolean legitimateUserId(String orgUserId) {
return orgUserId.matches("^[a-zA-Z0-9]+$");
* expression
*
* @param source
+ * String to split
* @param regex
+ * tokens
* @return List of tokens split from the source
*/
public static List<String> parsingByRegularExpression(String source, String regex) {
* Builds a JSON object with error code and message information.
*
* @param errorCode
+ * error code
* @param errorMessage
+ * message
* @return JSON object as a String
*/
public static String jsonErrorMessageResponse(int errorCode, String errorMessage) {
* Builds a JSON object with the specified message
*
* @param message
+ * Message to embed
* @return JSON object as a String
*/
public static String jsonMessageResponse(String message) {
}
/**
- * Serializes the specified object as JSON and writes the result to the
- * debug log. If serialization fails, logs a message to the error logger.
+ * Serializes the specified object as JSON and writes the result to the debug
+ * log. If serialization fails, logs a message to the error logger.
*
* @param logger
* Logger for the class where the object was built; the logger
}
/**
- * Serializes the specified object as JSON and writes the result to the
- * debug log. If serialization fails, logs a message to the error logger.
+ * Serializes the specified object as JSON and writes the result to the debug
+ * log. If serialization fails, logs a message to the error logger.
*
* @param source
* First portion of the log message
}
}
- // TODO: GLOBAL_LOGIN_URL is the same as in SessionTimeoutInterceptor.
- // It should be defined in SystemProperties.
- private static final String GLOBAL_LOGIN_URL = "global-login-url";
-
/**
- * Set response status to Unauthorized if user == null and to Forbidden in
- * all (!) other cases. Logging is not performed if invocator == null
+ * Set response status to Unauthorized if user == null and to Forbidden in all
+ * (!) other cases. Logging is not performed if invocator == null
*
* @param user
+ * User object
* @param response
+ * HttpServletResponse
* @param invocator
- * - may be null
+ * may be null
*/
public static void setBadPermissions(EPUser user, HttpServletResponse response, String invocator) {
if (user == null) {
responseCodeInt = Integer.valueOf(responseCode);
}
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger,
- "Exception occurred in getResponseCode(). Details: " + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "getExternalAppResponseCode failed", e);
}
return responseCodeInt;
}
String responseCodeString = String.valueOf(responseCode);
MDC.put(EPCommonSystemProperties.EXTERNAL_API_RESPONSE_CODE, responseCodeString);
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger,
- "Exception occurred in setResponseCode(). Details: " + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "setExternalAppResponseCode failed", e);
}
}
httpStatusString = httpStatusString.toLowerCase();
}
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger,
- "Exception occurred in getHTTPStatusString(). Details: " + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "getHTTPStatusString failed", e);
}
return httpStatusString;
}
// "Internal Ecomp Error: 500 internal_server_error" or
// "External App Error: 404 not_found"
// TODO: create our own Ecomp error codes, starting with 1000 and up.
- String responseString = "";
String internalExternalString = internal ? "Ecomp Error: " : "App Error: ";
String httpStatusString = "unknown_error";
try {
httpStatusString = getHTTPStatusString(responseCode);
}
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger,
- "Exception occurred in getFEErrorString(). Details: " + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "getFEErrorString failed", e);
}
- responseString = internalExternalString + responseCode + " " + httpStatusString;
+ String responseString = internalExternalString + responseCode + " " + httpStatusString;
return responseString;
}
return productionBuild;
}
- private static final Object stackTraceLock = new Object();
-
- public static String getStackTrace(Throwable t) {
- synchronized (stackTraceLock) {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
- t.printStackTrace(pw);
- return sw.toString();
- }
- }
-
public static String getMyIpAdddress() {
InetAddress ip;
String localIp;
localIp = ip.getHostAddress();
} catch (UnknownHostException e) {
localIp = "unknown";
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "getMyIpAdddress failed ", e);
}
return localIp;
}
hostName = ip.getHostName();
} catch (UnknownHostException e) {
hostName = "unknown";
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "getMyHostName failed", e);
}
return hostName;
}
- /* return a default property if the expected one is not available */
+ /**
+ * Returns a default property if the expected one is not available
+ *
+ * @param property
+ * Key
+ * @param defaultValue
+ * default Value
+ * @return Default value if property is not defined or yields the empty string;
+ * else the property value.
+ */
public static String getPropertyOrDefault(String property, String defaultValue) {
- return ((null == SystemProperties.getProperty(property) || SystemProperties.getProperty(property).equals(""))
- ? defaultValue : SystemProperties.getProperty(property));
+ if (!SystemProperties.containsProperty(property))
+ return defaultValue;
+ String value = SystemProperties.getProperty(property);
+ if (value == null || "".equals(value))
+ return defaultValue;
+ return value;
}
/**
* Calculates the time duration of a function call for logging purpose. It
* stores the result by using "MDC.put(SystemProperties.MDC_TIMER,
* timeDifference);" It is important to call
- * "MDC.remove(SystemProperties.MDC_TIMER);" after this method call to clean
- * up the record in MDC
+ * "MDC.remove(SystemProperties.MDC_TIMER);" after this method call to clean up
+ * the record in MDC
*
* @param beginDateTime
* the given begin time for the call
String timeDifference = String.format("%d", endDate.getTime() - beginDate.getTime());
MDC.put(SystemProperties.MDC_TIMER, timeDifference);
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "calculateDateTimeDifferenceForLog failed", e);
}
}
}
-
- public static String widgetMsProtocol(){
- final String protocol;
- try{
- protocol = SystemProperties.getProperty(EPCommonSystemProperties.WIDGET_MS_PROTOCOL);
- return (protocol == null || protocol.trim().equals("")) ? "https" : protocol ;
- }
- catch(IllegalStateException ese){
- //looks like SystemProperties.getProperty throws IllegalStateException if it cannot find a property you are looking for
- //In order to not break the code if a non-required property is missing from system.properties, returning https as default
- //when this exception is caught.
- return "https";
- }
+
+ /**
+ * Answers the protocol to use.
+ *
+ * @return Protocol name from property file; defaults to https.
+ */
+ public static String widgetMsProtocol() {
+ return getPropertyOrDefault(EPCommonSystemProperties.WIDGET_MS_PROTOCOL, "https");
}
-
- public static String localOrDockerHost(){
- final String effectiveHost;
- try{
- effectiveHost = SystemProperties.getProperty(EPCommonSystemProperties.WIDGET_MS_HOSTNAME);
- return (effectiveHost == null || effectiveHost.trim().equals("")) ? "localhost" : effectiveHost ;
- }
- catch(IllegalStateException ese){
- //looks like SystemProperties.getProperty throws IllegalStateException if it cannot find a property you are looking for
- //In order to not break the code if a non-required property is missing from system.properties, returning https as default
- //when this exception is caught.
- return "localhost";
- }
+
+ /**
+ * Answers the host to use.
+ *
+ * @return Host name from property file; defaults to localhost.
+ */
+ public static String localOrDockerHost() {
+ return getPropertyOrDefault(EPCommonSystemProperties.WIDGET_MS_HOSTNAME, "localhost");
}
/**
- * It returns headers where username and password of external central auth
- * is encoded to base64
+ * It returns headers where username and password of external central auth is
+ * encoded to base64
*
* @return header which contains external central auth username and password
* base64 encoded
* if unable to decrypt the password
*/
public static HttpHeaders base64encodeKeyForAAFBasicAuth() throws Exception {
-
String userName = "";
String decryptedPass = "";
- if (EPCommonSystemProperties
- .containsProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_AUTH_USER_NAME) && EPCommonSystemProperties
- .containsProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_AUTH_PASSWORD)) {
+ if (EPCommonSystemProperties.containsProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_AUTH_USER_NAME)
+ && EPCommonSystemProperties.containsProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_AUTH_PASSWORD)) {
decryptedPass = SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_AUTH_PASSWORD);
userName = SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_AUTH_USER_NAME);
}
headers.setContentType(MediaType.APPLICATION_JSON);
return headers;
}
-
+
private static String decrypted(String encrypted) throws Exception {
String result = "";
if (encrypted != null && encrypted.length() > 0) {
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.utils;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.utils;
* hash map created from list.
*
* @param <T>
+ * Type
*/
public class HashMapFromList<T> {
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HashMapFromList.class);
+ private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HashMapFromList.class);
public HashMap<String, T> hashMap(List<T> list, String name) {
HashMap<String, T> result = new HashMap<String, T>();
if (o != null)
result.put(o.toString(), obj);
} catch (Exception e1) {
- String stackTrace = EcompPortalUtils.getStackTrace(e1);
- logger.error(EELFLoggerDelegate.errorLogger, "Object of class " + object.getClass().getName() + ", field " + parmName + ". Details: ", stackTrace);
+ logger.error(EELFLoggerDelegate.errorLogger, "hashMap failed 1: object of class " + object.getClass().getName() + ", field " + parmName, e1);
return new HashMap<String, T>();
}
}
if (o != null)
result.put(o.toString(), obj);
} catch (Exception e2) {
- String stackTrace = EcompPortalUtils.getStackTrace(e2);
- logger.error(EELFLoggerDelegate.errorLogger, "Object of class " + object.getClass().getName() + ", method " + getterName + ". Details: ", stackTrace);
+ logger.error(EELFLoggerDelegate.errorLogger, "hashMap failed 2: object of class " + object.getClass().getName() + ", method " + getterName, e2);
return new HashMap<String, T>();
}
}
} catch (Exception e3) {
- String stackTrace = EcompPortalUtils.getStackTrace(e3);
- logger.error(EELFLoggerDelegate.errorLogger, "Object of class " + object.getClass().getName() + ", bad field '" + name + "' or method '" + getterName + "()'. Details: " + stackTrace);
+ logger.error(EELFLoggerDelegate.errorLogger, "hashMap failed 3: object of class " + object.getClass().getName() + ", bad field '" + name + "' or method '" + getterName + "()", e3);
return new HashMap<String, T>();
}
}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.utils;
public abstract class ParallelExecutor<T> {
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ParallelExecutor.class);
+ private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ParallelExecutor.class);
protected static abstract class ThreadOperation<T> {
public abstract T execute(List<Object> parms);
result.add(future.get());
}
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "performAllOperations failed", e);
}
}
executor.shutdown();
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.utils;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.service;
import java.util.List;
+import org.openecomp.portalapp.portal.domain.EPUser;
+import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
+import org.openecomp.portalsdk.core.dao.ProfileDao;
+import org.openecomp.portalsdk.core.domain.Profile;
+import org.openecomp.portalsdk.core.service.DataAccessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
-import org.openecomp.portalsdk.core.dao.ProfileDao;
-import org.openecomp.portalsdk.core.domain.Profile;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-
@Service("epProfileService")
@Transactional
@org.springframework.context.annotation.Configuration
@EPMetricsLog
public class EPProfileServiceImpl implements EPProfileService {
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPProfileServiceImpl.class);
-
@Autowired
private ProfileDao profileDao;
@SuppressWarnings("unchecked")
public List<Profile> findAll() {
- // List msgDB = getDataAccessService().getList(Profile.class, null);
return getDataAccessService().getList(Profile.class, null);
}
}
public void saveUser(EPUser user) {
-
getDataAccessService().saveDomainObject(user, null);
}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.service.sessionmgt;
import javax.servlet.http.HttpSession;
import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
import org.openecomp.portalsdk.core.domain.sessionmgt.TimeoutVO;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.openecomp.portalsdk.core.onboarding.util.PortalApiConstants;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
-
@Service
@org.springframework.context.annotation.Configuration
@EnableAspectJAutoProxy
@EPMetricsLog
-public class CoreTimeoutHandler{
+public class CoreTimeoutHandler {
private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(CoreTimeoutHandler.class);
-
- public static final Map<String, HttpSession> sessionMap = new Hashtable<String,HttpSession>();
+
+ public static final Map<String, HttpSession> sessionMap = new Hashtable<String, HttpSession>();
public static final Integer repeatInterval = 15 * 60; // 15 minutes
- ObjectMapper mapper = new ObjectMapper();
-
-
+ ObjectMapper mapper = new ObjectMapper();
+
public static void sessionCreated(String portalJSessionId, String jSessionId, HttpSession session) {
-
+
storeMaxInactiveTime(session);
-
+
// this key is a combination of portal jsession id and app session id
- session.setAttribute(PortalApiConstants.PORTAL_JSESSION_ID,jSessionKey(jSessionId, portalJSessionId));
- sessionMap.put((String)session.getAttribute(PortalApiConstants.PORTAL_JSESSION_ID), session);
-
+ session.setAttribute(PortalApiConstants.PORTAL_JSESSION_ID, jSessionKey(jSessionId, portalJSessionId));
+ sessionMap.put((String) session.getAttribute(PortalApiConstants.PORTAL_JSESSION_ID), session);
+
}
-
+
protected static void storeMaxInactiveTime(HttpSession session) {
-
- if(session.getAttribute(PortalApiConstants.GLOBAL_SESSION_MAX_IDLE_TIME) == null)
- session.setAttribute(PortalApiConstants.GLOBAL_SESSION_MAX_IDLE_TIME,session.getMaxInactiveInterval());
+
+ if (session.getAttribute(PortalApiConstants.GLOBAL_SESSION_MAX_IDLE_TIME) == null)
+ session.setAttribute(PortalApiConstants.GLOBAL_SESSION_MAX_IDLE_TIME, session.getMaxInactiveInterval());
}
-
+
public static void sessionDestroyed(HttpSession session) {
-
- try{
- sessionMap.remove((String)session.getAttribute(PortalApiConstants.PORTAL_JSESSION_ID));
- }catch(Exception e){
- logger.error(EELFLoggerDelegate.errorLogger, "************************ Session Management: Error while destroying session for " + session.getId() + " Details: " + EcompPortalUtils.getStackTrace(e));
+
+ try {
+ sessionMap.remove((String) session.getAttribute(PortalApiConstants.PORTAL_JSESSION_ID));
+ } catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "sessionDestroyed failed on session " + session.getId(), e);
}
-
+
}
-
+
public String gatherSessionExtenstions() {
-
- Map<String,TimeoutVO> sessionTimeoutMap = new Hashtable<String,TimeoutVO>();
+
+ Map<String, TimeoutVO> sessionTimeoutMap = new Hashtable<String, TimeoutVO>();
String jsonMap = "";
-
-
- for(String jSessionKey: sessionMap.keySet()) {
-
- try{
+
+ for (String jSessionKey : sessionMap.keySet()) {
+
+ try {
// get the expirytime in seconds
HttpSession session = sessionMap.get(jSessionKey);
-
+
Long lastAccessedTimeMilliSec = session.getLastAccessedTime();
Long maxIntervalMilliSec = session.getMaxInactiveInterval() * 1000L;
- //Long currentTimeMilliSec = Calendar.getInstance().getTimeInMillis() ;
- //(maxIntervalMilliSec - (currentTimeMilliSec - lastAccessedTimeMilliSec) + ;
+ // Long currentTimeMilliSec = Calendar.getInstance().getTimeInMillis() ;
+ // (maxIntervalMilliSec - (currentTimeMilliSec - lastAccessedTimeMilliSec) + ;
Calendar instance = Calendar.getInstance();
instance.setTimeInMillis(session.getLastAccessedTime());
- logger.info(EELFLoggerDelegate.errorLogger, "************************ Session Management: Last Accessed time for "+ jSessionKey + ": " + instance.getTime());
-
+ logger.info(EELFLoggerDelegate.errorLogger,
+ "gatherSessionExtenstions: Session Management: Last Accessed time for " + jSessionKey + ": "
+ + instance.getTime());
+
Long sessionTimOutMilliSec = maxIntervalMilliSec + lastAccessedTimeMilliSec;
-
- sessionTimeoutMap.put( portalJSessionId(jSessionKey), new TimeoutVO(jSessionId(jSessionKey),sessionTimOutMilliSec));
-
-
+
+ sessionTimeoutMap.put(portalJSessionId(jSessionKey),
+ new TimeoutVO(jSessionId(jSessionKey), sessionTimOutMilliSec));
+
jsonMap = mapper.writeValueAsString(sessionTimeoutMap);
- } catch(Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, "************************ Session Management: Error during JsonSessionTimout conversion. Details: " + EcompPortalUtils.getStackTrace(e));
+ } catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "gatherSessionExtenstions failed", e);
}
}
-
+
return jsonMap;
-
+
}
-
-
+
public void updateSessionExtensions(String sessionTimeoutMapStr) throws Exception {
-
- //Map<String,Object> sessionTimeoutMap = mapper.readValue(sessionTimeoutMapStr, Map.class);
- Map<String,TimeoutVO> sessionTimeoutMap;
- try{
- TypeReference<Hashtable<String,TimeoutVO>> typeRef
- = new TypeReference<Hashtable<String,TimeoutVO>>() {};
-
- sessionTimeoutMap = mapper.readValue(sessionTimeoutMapStr, typeRef);
- }catch(Exception e){
- logger.error(EELFLoggerDelegate.errorLogger, "************************ Session Management: Error while to parse update session extension in portal", e);
+
+ Map<String, TimeoutVO> sessionTimeoutMap;
+ try {
+ TypeReference<Hashtable<String, TimeoutVO>> typeRef = new TypeReference<Hashtable<String, TimeoutVO>>() {
+ };
+
+ sessionTimeoutMap = mapper.readValue(sessionTimeoutMapStr, typeRef);
+ } catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "updateSessionExtensions failed 1", e);
return;
}
- for(String jPortalSessionId: sessionTimeoutMap.keySet()) {
+ for (String jPortalSessionId : sessionTimeoutMap.keySet()) {
try {
-
- TimeoutVO extendedTimeoutVO = mapper.readValue(mapper.writeValueAsString(sessionTimeoutMap.get(jPortalSessionId)),TimeoutVO.class);
+
+ TimeoutVO extendedTimeoutVO = mapper
+ .readValue(mapper.writeValueAsString(sessionTimeoutMap.get(jPortalSessionId)), TimeoutVO.class);
HttpSession session = sessionMap.get(jSessionKey(extendedTimeoutVO.getjSessionId(), jPortalSessionId));
-
- if(session == null) {
+
+ if (session == null) {
continue;
}
-
+
Long lastAccessedTimeMilliSec = session.getLastAccessedTime();
Long maxIntervalMilliSec = session.getMaxInactiveInterval() * 1000L;
Long sessionTimOutMilliSec = maxIntervalMilliSec + lastAccessedTimeMilliSec;
-
+
Long maxTimeoutTimeMilliSec = extendedTimeoutVO.getSessionTimOutMilliSec();
- if(maxTimeoutTimeMilliSec>sessionTimOutMilliSec) {
- logger.debug(EELFLoggerDelegate.debugLogger, "************************ Session Management: " + " updated session max idle time");
- session.setMaxInactiveInterval((int)(maxTimeoutTimeMilliSec-lastAccessedTimeMilliSec)/1000);
+ if (maxTimeoutTimeMilliSec > sessionTimOutMilliSec) {
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ "updateSessionExtensions: Session Management: updated session max idle time");
+ session.setMaxInactiveInterval((int) (maxTimeoutTimeMilliSec - lastAccessedTimeMilliSec) / 1000);
}
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, "************************ Session Management: " + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger,
+ "updateSessionExtensions failed", e);
}
-
+
}
-
+
}
- protected static String jSessionKey(String jSessionId, String portalJSessionId) {
+ protected static String jSessionKey(String jSessionId, String portalJSessionId) {
return portalJSessionId + "-" + jSessionId;
}
-
- protected String portalJSessionId(String jSessionKey) {
+
+ protected String portalJSessionId(String jSessionKey) {
return jSessionKey.split("-")[0];
}
-
- protected String jSessionId(String jSessionKey) {
+
+ protected String jSessionId(String jSessionKey) {
return jSessionKey.split("-")[1];
}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.service.sessionmgt;
import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
import org.openecomp.portalapp.portal.service.EPAppService;
import org.openecomp.portalapp.portal.transport.OnboardingApp;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.openecomp.portalsdk.core.onboarding.listener.PortalTimeoutHandler;
import org.openecomp.portalsdk.core.util.SystemProperties;
@EnableAspectJAutoProxy
@EPMetricsLog
public class ManageService implements PortalTimeoutHandler.SessionCommInf {
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ManageService.class);
+ private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ManageService.class);
@Autowired
- EPAppService appService;
+ private EPAppService appService;
@Autowired
- SessionCommunication sessionCommunication;
+ private SessionCommunication sessionCommunication;
public Integer fetchSessionSlotCheckInterval(String... params) throws Exception {
sessionCommunication.clear(false);
}
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred in extendSessionTimeOuts(). Details: " + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "extendSessionTimeOuts failed", e);
}
}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.service.sessionmgt;
import javax.servlet.http.HttpServletResponse;
-import org.slf4j.MDC;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-import org.springframework.util.StringUtils;
-
-import com.att.eelf.configuration.Configuration;
-import org.openecomp.portalsdk.core.exception.UrlAccessRestrictedException;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
import org.openecomp.portalapp.portal.logging.format.EPAppMessagesEnum;
import org.openecomp.portalapp.portal.transport.OnboardingApp;
import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
+import org.openecomp.portalsdk.core.exception.UrlAccessRestrictedException;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.slf4j.MDC;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import com.att.eelf.configuration.Configuration;
@Service("sessionCommunication")
@org.springframework.context.annotation.Configuration
@EnableAspectJAutoProxy
public class SessionCommunication {
EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SessionCommunication.class);
-
+
@EPAuditLog
public String sendGet(OnboardingApp app) throws Exception {
String appResponse = "";
- String appName = "Unknwon";
+ String appName = "";
int responseCode = 0;
if (app != null && app.name != null && app.name != "") {
- try {
- appName = app.name;
+ try {
+ appName = app.name;
String url = app.restUrl + "/sessionTimeOuts";
String encriptedPwdDB = app.appPassword;
String appUserName = app.username;
-
+
setLocalMDCContext(app, "/sessionTimeOuts", url);
-
+
URL obj = new URL(url);
-
+
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
-
+
// optional default is GET
con.setRequestMethod("GET");
con.setConnectTimeout(3000);
// add request header
con.setRequestProperty("username", appUserName);
con.setRequestProperty("password", encriptedPwdDB);
-
+
// con.set
responseCode = con.getResponseCode();
logger.debug(EELFLoggerDelegate.debugLogger, "Response Code : " + responseCode);
-
+
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
-
+
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
-
+
in.close();
appResponse = response.toString();
} catch (UrlAccessRestrictedException e) {
responseCode = HttpServletResponse.SC_UNAUTHORIZED;
- logger.error(EELFLoggerDelegate.errorLogger, String.format("SessionCommunication.sendGet received an un-authorized exception. AppName: %s", appName));
+ logger.error(EELFLoggerDelegate.errorLogger, String.format(
+ "SessionCommunication.sendGet received an un-authorized exception. AppName: %s", appName));
EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeRestApiAuthenticationError, e);
} catch (Exception e) {
responseCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
String message = String.format(
"SessionCommunication.sendGet encountered an Exception. AppName: %s, Details: %s", appName,
- EcompPortalUtils.getStackTrace(e));
+ e.toString());
EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeHttpConnectionError, e);
- logger.error(EELFLoggerDelegate.errorLogger, message);
+ logger.error(EELFLoggerDelegate.errorLogger, message, e);
} finally {
EcompPortalUtils.setExternalAppResponseCode(responseCode);
}
- }else{
+ } else {
logger.error(EELFLoggerDelegate.errorLogger, "SessionCommunication sendGet: app is null");
}
return appResponse;
@EPAuditLog
public Boolean pingSession(OnboardingApp app, String sessionTimeoutMap) throws Exception {
- String appName = "Unknwon";
+ String appName = "";
int responseCode = 0;
try {
- if(app==null)
- throw new Exception("SessionCommunication.pingSession app is null");
+ if (app == null)
+ throw new Exception("SessionCommunication.pingSession: app is null");
if (app != null && app.name != null && app.name != "") {
appName = app.name;
}
String url = app.restUrl + "/updateSessionTimeOuts";
String encriptedPwdDB = app.appPassword;
String appUserName = app.username;
- // String decreptedPwd = CipherUtil.decrypt(encriptedPwdDB,
- // SystemProperties.getProperty(SystemProperties.Decryption_Key));
setLocalMDCContext(app, "/updateSessionTimeOuts", url);
} catch (Exception e) {
responseCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
String message = String.format(
- "SessionCommunication.pingSession encountered an Exception. AppName: %s, Details: %s", appName,
- EcompPortalUtils.getStackTrace(e));
+ "SessionCommunication.pingSession encountered an Exception. AppName: %s, Details: %s", appName, e.toString());
EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeHttpConnectionError, e);
- logger.error(EELFLoggerDelegate.errorLogger, message);
+ logger.error(EELFLoggerDelegate.errorLogger, message, e);
} finally {
EcompPortalUtils.setExternalAppResponseCode(responseCode);
}
-
+
return true;
}
try {
appName = app.name;
String url = app.restUrl + "/timeoutSession" + "?portalJSessionId=" + portalJSessionId;
-
+
String encriptedPwdDB = app.appPassword;
String appUserName = app.username;
// String decreptedPwd = CipherUtil.decrypt(encriptedPwdDB,
// SystemProperties.getProperty(SystemProperties.Decryption_Key));
-
+
setLocalMDCContext(app, "/timeoutSession", url);
-
+
URL obj = new URL(url);
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
-
+
// optional default is GET
con.setRequestMethod("POST");
con.setConnectTimeout(3000);
con.setReadTimeout(15000);
-
+
// add request header
con.setRequestProperty("username", appUserName);
con.setRequestProperty("password", encriptedPwdDB);
-
+
// con.setRequestProperty("portalJSessionId", portalJSessionId);
con.setDoInput(true);
con.setDoOutput(true);
con.getOutputStream().flush();
con.getOutputStream().close();
-
+
responseCode = con.getResponseCode();
logger.debug(EELFLoggerDelegate.debugLogger, "Response Code : " + responseCode);
} catch (UrlAccessRestrictedException e) {
responseCode = HttpServletResponse.SC_UNAUTHORIZED;
String message = String.format(
- "SessionCommunication.timeoutSession received an un-authorized exception. AppName: %s", appName);
+ "SessionCommunication.timeoutSession received an un-authorized exception. AppName: %s",
+ appName);
logger.error(EELFLoggerDelegate.errorLogger, message);
EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeRestApiAuthenticationError, e);
} catch (Exception e) {
responseCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
String message = String.format(
- "SessionCommunication.timeoutSession encountered an Exception. AppName: %s, Details: %s", appName,
- EcompPortalUtils.getStackTrace(e));
+ "SessionCommunication.timeoutSession encountered an Exception. AppName: %s, Details: %s",
+ appName, e.toString());
EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeHttpConnectionError, e);
- logger.error(EELFLoggerDelegate.errorLogger, message);
+ logger.error(EELFLoggerDelegate.errorLogger, message, e);
} finally {
EcompPortalUtils.setExternalAppResponseCode(responseCode);
}
- }else{
+ } else {
logger.error(EELFLoggerDelegate.errorLogger, "SessionCommunication pingSession: app is null");
}
return true;
private void setLocalMDCContext(OnboardingApp app, String restPath, String url) {
setRequestId();
MDC.put(EPCommonSystemProperties.PROTOCOL, EPCommonSystemProperties.HTTP);
- if (url!=null && url.contains("https")) {
+ if (url != null && url.contains("https")) {
MDC.put(EPCommonSystemProperties.PROTOCOL, EPCommonSystemProperties.HTTPS);
}
MDC.put(EPCommonSystemProperties.FULL_URL, url);
MDC.put(EPCommonSystemProperties.TARGET_ENTITY, app.myLoginsAppName);
MDC.put(EPCommonSystemProperties.TARGET_SERVICE_NAME, restPath);
}
-
+
/**
- * Generates request id, service name fields and loads them
- * into MDC, as these values could be empty as these
- * session timeout requests are generated at
+ * Generates request id, service name fields and loads them into MDC, as these
+ * values could be empty as these session timeout requests are generated at
* scheduled intervals using quartz scheduler.
*/
@EPMetricsLog
if (StringUtils.isEmpty(requestId)) {
MDC.put(Configuration.MDC_KEY_REQUEST_ID, UUID.randomUUID().toString());
}
-
+
MDC.put(Configuration.MDC_SERVICE_NAME, "/quartz/keepSessionAlive");
MDC.put(EPCommonSystemProperties.PARTNER_NAME, EPCommonSystemProperties.ECOMP_PORTAL_BE);
}
-
+
/**
- * Remove the values from MDC as these requests are
- * executed at regular intervals based on quartz rather
- * incoming REST API requests.
+ * Remove the values from MDC as these requests are executed at regular
+ * intervals based on quartz rather incoming REST API requests.
+ *
* @param bAll
*/
@EPMetricsLog
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.service.sessionmgt;
@EnableAspectJAutoProxy
@EPMetricsLog
public class TimeoutHandler extends QuartzJobBean {
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(TimeoutHandler.class);
+ private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(TimeoutHandler.class);
- ObjectMapper mapper = new ObjectMapper();
+ private ObjectMapper mapper = new ObjectMapper();
/**
* Supports static call {@link #timeoutSessions(HttpSession)}
private static List<OnboardingApp> onboardedAppList = null;
@Autowired
- SessionCommunication sessionCommunication;
+ private SessionCommunication sessionCommunication;
@Override
protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
try {
sessionTimeoutMapStr = mapper.writeValueAsString(sessionTimeoutMap);
} catch (JsonProcessingException je) {
- logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while processing sessionTimeOutMap object to a String. Details: "
- + EcompPortalUtils.getStackTrace(je));
+ logger.error(EELFLoggerDelegate.errorLogger, "executeInternal failed while processing sessionTimeOutMap object to a String", je);
EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInvalidJsonInput, je);
}
pingAppSessions(app, sessionTimeoutMapStr);
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.util;
-import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
-import java.util.Map;
import java.util.Set;
import java.util.UUID;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.hibernate.criterion.Projections;
-import org.hibernate.criterion.Restrictions;
-import org.hibernate.transform.Transformers;
-import org.openecomp.portalapp.portal.domain.CentralRoleFunction;
import org.openecomp.portalapp.portal.domain.EPRole;
import org.openecomp.portalapp.portal.domain.EPUser;
import org.openecomp.portalapp.portal.domain.EPUserApp;
import org.openecomp.portalapp.portal.service.EPRoleFunctionService;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
import org.openecomp.portalsdk.core.domain.RoleFunction;
import org.openecomp.portalsdk.core.exception.SessionExpiredException;
import org.openecomp.portalsdk.core.lm.FusionLicenseManager;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.openecomp.portalsdk.core.menu.MenuBuilder;
-import org.openecomp.portalsdk.core.onboarding.util.PortalApiConstants;
-import org.openecomp.portalsdk.core.onboarding.util.PortalApiProperties;
import org.openecomp.portalsdk.core.service.DataAccessService;
import org.openecomp.portalsdk.core.util.SystemProperties;
import org.openecomp.portalsdk.core.web.support.AppUtils;
public static final String ALL_ROLE_FUNCTIONS = "allRoleFunctions";
private static DataAccessService dataAccessService;
-
- @Autowired
- private static SessionFactory sessionFactory;
/**
* Gets the EPUser object from the session.
* Menu data
* @param loginMethod_ignored
* How the user authenticated; ignored
- * @param allRoleFunctions
- * Set of user's roles
+ * @param ePRoleFunctionService
+ * role function service
*/
@SuppressWarnings("rawtypes")
public static void setUserSession(HttpServletRequest request, EPUser user, Set applicationMenuData,
session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
setAllRoleFunctions(ePRoleFunctionService.getRoleFunctions(), session);
-
- ePRoleFunctionService.getRoleFunctions(request,user);
-
+
+ ePRoleFunctionService.getRoleFunctions(request, user);
+
// truncate the role (and therefore the role function) data to save
// memory in the session
user.setEPRoles(null);
session.removeAttribute(SystemProperties.getProperty(SystemProperties.ROLE_FUNCTIONS_ATTRIBUTE_NAME));
}
-
/**
- * Gets role information from the user session, in the cached user object.
- * As a side effect sets a session variable with the roles.
+ * Gets role information from the user session, in the cached user object. As a
+ * side effect sets a session variable with the roles.
*
* @param request
* HttpServletRequest
}
}
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, "HEADER!!!! Exception : " + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "getRequestId failed", e);
}
return (requestId.isEmpty() ? UUID.randomUUID().toString() : requestId);
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.util;
/*-
- * ================================================================================
- * ECOMP Portal SDK
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalsdk.core.lm;
--- /dev/null
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.openecomp.portalapp.command;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
+import org.junit.Test;
+import org.openecomp.portalapp.command.EPLoginBean;
+
+public class EPLoginBeanTest {
+
+
+public EPLoginBean ePLoginBean(){
+
+ EPLoginBean ePLoginBean = new EPLoginBean();
+ ePLoginBean.setLoginId("guestT");
+ ePLoginBean.setLoginPwd("password");
+ ePLoginBean.setHrid("hrId");
+ ePLoginBean.setOrgUserId("guestT");
+ ePLoginBean.setBusinessDirectMenu(null);
+ ePLoginBean.setSiteAccess("site_test");
+ ePLoginBean.setLoginErrorMessage("error");
+ ePLoginBean.setUser(null);
+ ePLoginBean.setMenu(null);
+ return ePLoginBean;
+ }
+
+ @Test
+ public void ePLoginBeanTest(){
+ EPLoginBean ePLoginBean = ePLoginBean();
+
+ assertEquals(ePLoginBean.getLoginId(), "guestT");
+ assertEquals(ePLoginBean.getLoginPwd(), "password");
+ assertEquals(ePLoginBean.getHrid(), "hrId");
+ assertEquals(ePLoginBean.getOrgUserId(), "guestT");
+ assertNull(ePLoginBean.getBusinessDirectMenu());
+ assertEquals(ePLoginBean.getSiteAccess(), "site_test");
+ assertEquals(ePLoginBean.getLoginErrorMessage(), "error");
+ assertNull(ePLoginBean.getUser());
+ assertNull(ePLoginBean.getMenu());
+
+
+ }
+}
--- /dev/null
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.openecomp.portalapp.command;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.mockito.InjectMocks;
+import org.openecomp.portalapp.portal.core.MockEPUser;
+import org.openecomp.portalapp.portal.domain.EPUser;
+
+public class PostSearchBeanTest {
+
+ @InjectMocks
+ PostSearchBean mockPostSearchBean = new PostSearchBean();
+
+ MockEPUser mockUser = new MockEPUser();
+ public PostSearchBean mockPostSearchBean(){
+
+ PostSearchBean postSearchBean = new PostSearchBean();
+ EPUser user = mockUser.mockEPUser();
+ postSearchBean.setUser(user);
+ postSearchBean.setUserOrig(null);
+ postSearchBean.setSelected(null);
+ postSearchBean.setHrid(null);
+ postSearchBean.setPostUserId(null);
+ postSearchBean.setPostFirstName(null);
+ postSearchBean.setPostLastName(null);
+ postSearchBean.setPostOrgCode(null);
+ postSearchBean.setPostPhone(null);
+ postSearchBean.setPostEmail(null);
+ postSearchBean.setPostAddress1(null);
+ postSearchBean.setPostAddress2(null);
+ postSearchBean.setPostCity(null);
+ postSearchBean.setPostState(null);
+ postSearchBean.setPostZipCode(null);
+ postSearchBean.setPostLocationClli(null);
+ postSearchBean.setPostBusinessCountryCode(null);
+ postSearchBean.setPostBusinessCountryName(null);
+ postSearchBean.setPostDepartment(null);
+ postSearchBean.setPostDepartmentName(null);
+ postSearchBean.setPostBusinessUnit(null);
+ postSearchBean.setPostBusinessUnitName(null);
+ postSearchBean.setPostJobTitle(null);
+ postSearchBean.setOrgManagerUserId(null);
+ postSearchBean.setPostCommandChain(null);
+ postSearchBean.setPostCompanyCode(null);
+ postSearchBean.setPostCostCenter(null);
+ postSearchBean.setPostSiloStatus(null);
+ postSearchBean.setPostFinancialLocCode(null);
+ postSearchBean.setPostManagerUserId(null);
+ return postSearchBean;
+ }
+
+ @Test
+ public void postSearchBeanTest()
+ {
+ PostSearchBean postSearchBean = mockPostSearchBean();
+ EPUser user = mockUser.mockEPUser();
+ assertEquals(postSearchBean.getUser().getActive(), user.getActive());
+ assertNull(postSearchBean.getUserOrig());
+ assertNull(postSearchBean.getSelected());
+ assertNull(postSearchBean.getHrid());
+ assertNull(postSearchBean.getPostOrgUserId());
+ assertNull(postSearchBean.getPostFirstName());
+ assertNull(postSearchBean.getPostLastName());
+ assertNull(postSearchBean.getPostOrgCode());
+ assertNull(postSearchBean.getPostPhone());
+ assertNull(postSearchBean.getPostEmail());
+ assertNull(postSearchBean.getPostAddress1());
+ assertNull(postSearchBean.getPostAddress2());
+ assertNull(postSearchBean.getPostCity());
+ assertNull(postSearchBean.getPostState());
+ assertNull(postSearchBean.getPostZipCode());
+ assertNull(postSearchBean.getPostLocationClli());
+ assertNull(postSearchBean.getPostBusinessCountryCode());
+ assertNull(postSearchBean.getPostBusinessCountryName());
+ assertNull(postSearchBean.getPostDepartment());
+ assertNull(postSearchBean.getPostDepartmentName());
+ assertNull(postSearchBean.getPostBusinessUnit());
+ assertNull(postSearchBean.getPostBusinessUnitName());
+ assertNull(postSearchBean.getPostJobTitle());
+ assertNull(postSearchBean.getOrgManagerUserId());
+ assertNull(postSearchBean.getPostCommandChain());
+ assertNull(postSearchBean.getPostCompanyCode());
+ assertNull(postSearchBean.getPostCostCenter());
+ assertNull(postSearchBean.getPostSiloStatus());
+ assertNull(postSearchBean.getPostFinancialLocCode());
+ assertNull(postSearchBean.getPostManagerUserId());
+ }
+
+ @Test
+ public void isCriteriaUpdatedIfUserNotNullTest()
+ {
+ assertFalse(mockPostSearchBean.isCriteriaUpdated());
+ }
+
+ @Test
+ public void isCriteriaUpdatedIfUserNullTest()
+ {
+ mockPostSearchBean.setUser(null);
+ assertTrue(mockPostSearchBean.isCriteriaUpdated());
+ }
+
+
+ @Test
+ public void isCriteriaUpdatedIfUserTest()
+ {
+ mockPostSearchBean.setUser(null);
+ mockPostSearchBean.setUserOrig(null);
+ assertFalse(mockPostSearchBean.isCriteriaUpdated());
+ }
+
+}
--- /dev/null
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.openecomp.portalapp.config;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.openecomp.portalapp.portal.service.UserNotificationService;
+import org.openecomp.portalapp.portal.service.UserNotificationServiceImpl;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+import org.springframework.context.ApplicationContext;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest(NotificationCleanupConfig.class)
+public class NotificationCleanupTest {
+
+ @InjectMocks
+ NotificationCleanup notificationCleanup = new NotificationCleanup();
+
+ @Before
+ public void setup() {
+ MockitoAnnotations.initMocks(this);
+ }
+
+ @Mock
+ UserNotificationService userNotificationService = new UserNotificationServiceImpl();
+ @Mock
+ ApplicationContext applicationContext;
+
+ @Test
+ public void runTest() {
+ PowerMockito.mockStatic(NotificationCleanupConfig.class);
+ Mockito.when(NotificationCleanupConfig.getApplicationContext()).thenReturn(applicationContext);
+ Mockito.when((applicationContext).getBean(UserNotificationService.class)).thenReturn(userNotificationService);
+ Mockito.doNothing().when(userNotificationService).deleteNotificationsFromEpUserNotificationTable();
+ Mockito.doNothing().when(userNotificationService).deleteNotificationsFromEpRoleNotificationTable();
+
+ Mockito.doNothing().when(userNotificationService).deleteNotificationsFromEpNotificationTable();
+ notificationCleanup.run();
+
+ }
+
+}
--- /dev/null
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.openecomp.portalapp.config;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.openecomp.portalapp.portal.service.EPRoleFunctionService;
+import org.openecomp.portalapp.portal.service.EPRoleFunctionServiceCentralizedImpl;
+import org.openecomp.portalapp.portal.service.EPRoleFunctionServiceImpl;
+
+public class PortalCentralAccessConfigurationTest {
+
+ @InjectMocks
+ PortalCentralAccessConfiguration portalCentralAccessConfiguration = new PortalCentralAccessConfiguration();
+
+ @Before
+ public void setup() {
+ MockitoAnnotations.initMocks(this);
+ }
+
+ @Mock
+ EPRoleFunctionService ePRoleFunctionServiceImpl = new EPRoleFunctionServiceImpl();
+
+ @Mock
+ EPRoleFunctionService ePRoleFunctionServiceCentralizedImpl = new EPRoleFunctionServiceCentralizedImpl();
+
+ @Test
+ public void ePRoleFunctionServiceImplTest()
+ {
+ EPRoleFunctionService expectedPRoleFunctionServiceImpl = portalCentralAccessConfiguration.ePRoleFunctionServiceImpl();
+ assertEquals(expectedPRoleFunctionServiceImpl.getClass(), EPRoleFunctionServiceImpl.class);
+ }
+
+ @Test
+ public void ePRoleFunctionServiceCentralImplTest()
+ {
+ EPRoleFunctionService expectedPRoleFunctionServiceImpl = portalCentralAccessConfiguration.ePRoleFunctionServiceCentralizedImpl();
+ assertEquals(expectedPRoleFunctionServiceImpl.getClass(), EPRoleFunctionServiceCentralizedImpl.class);
+ }
+
+}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.junit.Before;
import org.junit.Test;
+import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
import org.openecomp.portalapp.portal.service.AppContactUsService;
import org.openecomp.portalapp.portal.service.AppContactUsServiceImpl;
+import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
import org.openecomp.portalapp.util.EPUserUtils;
-
+import org.openecomp.portalsdk.core.domain.support.CollaborateList;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({SystemProperties.class, EPCommonSystemProperties.class})
public class AppContactUsControllerTest extends MockitoTestSuite{
@Mock
assertEquals(actualSaveAppContactUS.getMessage(), "failure");
}
+ @Test
+ public void getPortalDetailsTest(){
+ PortalRestResponse<String> actualResponse = new PortalRestResponse<String>();
+ PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
+ expectedResponse.setStatus(PortalRestStatusEnum.OK);
+ expectedResponse.setMessage("success");
+ expectedResponse.setResponse("\"ush_ticket_url\":\"http://todo_enter_ush_ticket_url\",\"portal_info_url\":\"https://todo_enter_portal_info_url\",\"feedback_email_address\":\"portal@lists.openecomp.org\"");
+ PowerMockito.mockStatic(SystemProperties.class);
+ PowerMockito.mockStatic(EPCommonSystemProperties.class);
+
+ Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.USH_TICKET_URL)).thenReturn("http://todo_enter_ush_ticket_url");
+ Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.PORTAL_INFO_URL)).thenReturn("https://todo_enter_portal_info_url");
+ Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.FEEDBACK_EMAIL_ADDRESS)).thenReturn("portal@lists.openecomp.org");
+
+ actualResponse = appContactUsController.getPortalDetails(mockedRequest);
+ assertTrue(actualResponse.getStatus().compareTo(PortalRestStatusEnum.OK) == 0);
+ }
+
+ @Test
+ public void getPortalDetailsExceptionTest(){
+ PortalRestResponse<String> actualResponse = new PortalRestResponse<String>();
+ PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
+ expectedResponse.setStatus(PortalRestStatusEnum.ERROR);
+ expectedResponse.setMessage("failure");
+ expectedResponse.setResponse(null);
+ PowerMockito.mockStatic(SystemProperties.class);
+ PowerMockito.mockStatic(EPCommonSystemProperties.class);
+
+ Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.USH_TICKET_URL)).thenThrow(nullPointerException);
+ Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.PORTAL_INFO_URL)).thenReturn("https://todo_enter_portal_info_url");
+ Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.FEEDBACK_EMAIL_ADDRESS)).thenReturn("portal@lists.openecomp.org");
+
+ actualResponse = appContactUsController.getPortalDetails(mockedRequest);
+ assertEquals(actualResponse, expectedResponse);
+ }
}
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.controller;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.controller;
import static org.junit.Assert.*;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.controller;
import javax.servlet.http.HttpServletRequest;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.controller;
import static org.junit.Assert.assertTrue;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.controller;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.controller;
import static org.junit.Assert.assertTrue;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.controller;
import static org.junit.Assert.assertTrue;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.controller;
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.*;
import java.io.IOException;
import java.util.ArrayList;
assertEquals(expectedData,actualResponse);
}
-// @Test
-// public void activeUsersExceptionTest(){
-// EPUser user = mockUser.mockEPUser();
-// user.setLoginId("test");
-// String loginId = "abc";
-// PortalRestResponse<List<String>> expectedData = new PortalRestResponse<List<String>>();
-// expectedData.setStatus(PortalRestStatusEnum.ERROR);
-// expectedData.setMessage("java.lang.NullPointerException");
-// expectedData.setResponse(null);
-//
-//// PowerMockito.mockStatic(EPUserUtils.class);
-// Mockito.when(searchService.getRelatedUsers(user.getLoginId(user.getLoginId()))).thenReturn(nullPointerException);
-// PortalRestResponse<List<String>> actualResponse = dashboardController.activeUsers(mockedRequest);
-// System.out.println(actualResponse);
-// //assertEquals(expectedData,actualResponse);
-// }
+ @Test
+ public void activeUsersExceptionTest(){
+ EPUser user = mockUser.mockEPUser();
+ user.setLoginId("test");
+ PortalRestResponse<List<String>> expectedData = new PortalRestResponse<List<String>>();
+ expectedData.setStatus(PortalRestStatusEnum.ERROR);
+ expectedData.setMessage("null - check logs.");
+ expectedData.setResponse(null);
+
+ PowerMockito.mockStatic(EPUserUtils.class);
+ Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+ Mockito.when(searchService.getRelatedUsers(user.getLoginId())).thenThrow(nullPointerException);
+ PortalRestResponse<List<String>> actualResponse = dashboardController.activeUsers(mockedRequest);
+ assertTrue(actualResponse.getStatus().compareTo(PortalRestStatusEnum.ERROR) == 0);
+ }
}
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.controller;
import static org.junit.Assert.assertEquals;
-//package org.openecomp.portalapp.portal.test.controller;
-//
-//import java.util.HashMap;
-//import java.util.Map;
-//
-//import javax.servlet.http.HttpServletRequest;
-//import javax.servlet.http.HttpServletResponse;
-//
-//import org.junit.Before;
-//import org.junit.Test;
-//import org.junit.runner.RunWith;
-//import org.mockito.InjectMocks;
-//import org.mockito.Mock;
-//import org.mockito.Mockito;
-//import org.mockito.MockitoAnnotations;
-//import org.openecomp.portalapp.controller.EPFusionBaseController;
-//import org.openecomp.portalapp.portal.core.MockEPUser;
-//import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-//import org.openecomp.portalapp.portal.service.DashboardSearchService;
-//import org.openecomp.portalapp.portal.service.DashboardSearchServiceImpl;
-//import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-//import org.openecomp.portalapp.util.EPUserUtils;
-//import org.openecomp.portalsdk.core.util.SystemProperties;
-//import org.powermock.api.mockito.PowerMockito;
-//import org.powermock.core.classloader.annotations.PrepareForTest;
-//import org.powermock.modules.junit4.PowerMockRunner;
-//
-//@RunWith(PowerMockRunner.class)
-//@PrepareForTest({EPUserUtils.class, SystemProperties.class})
-//public class EPFusionBaseControllerTest {
-//
-// @Mock
-// DashboardSearchService searchService = new DashboardSearchServiceImpl();
-//
-// @InjectMocks
-// EPFusionBaseController epFusionBaseController; /*= mock(EPFusionBaseController.class);*/
-//
-// @Before
-// public void setup() {
-// MockitoAnnotations.initMocks(this);
-// }
-//
-// MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-//
-// HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-// HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-//
-// NullPointerException nullPointerException = new NullPointerException();
-//
-// MockEPUser mockUser = new MockEPUser();
-//
-// @Test
-// public void messagesTest(){
-// Map<String, Object> expectedData = new HashMap<String, Object>();
-// Map<String, Object> actualData = null;
-//
-// PowerMockito.mockStatic(SystemProperties.class);
-// Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME)).then(null);
-// actualData = epFusionBaseController.messages(mockedRequest);
-// System.out.println();
-//
-// }
-//}
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.openecomp.portalapp.portal.controller;
+
+import static org.junit.Assert.*;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.openecomp.portalapp.controller.EPFusionBaseController;
+import org.openecomp.portalapp.portal.core.MockEPUser;
+import org.openecomp.portalapp.portal.domain.EPUser;
+import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
+import org.openecomp.portalapp.portal.service.DashboardSearchService;
+import org.openecomp.portalapp.portal.service.DashboardSearchServiceImpl;
+import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
+import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
+import org.openecomp.portalapp.util.EPUserUtils;
+import org.openecomp.portalsdk.core.domain.MenuData;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({EPUserUtils.class, SystemProperties.class, EPCommonSystemProperties.class, EcompPortalUtils.class})
+public class EPFusionBaseControllerTest {
+
+ @Mock
+ DashboardSearchService searchService = new DashboardSearchServiceImpl();
+
+ @InjectMocks
+ EPFusionBaseController epFusionBaseController = new EPFusionBaseController() {
+ };
+
+
+ @Before
+ public void setup() {
+ MockitoAnnotations.initMocks(this);
+ }
+
+ MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+ HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+ HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+
+ NullPointerException nullPointerException = new NullPointerException();
+
+ MockEPUser mockUser = new MockEPUser();
+
+ @Test
+ public void messagesExceptionTest(){
+ Map<String, Object> expectedData = new HashMap<String, Object>();
+ Map<String, Object> actualData = null;
+ PowerMockito.mockStatic(SystemProperties.class);
+ PowerMockito.mockStatic(EPCommonSystemProperties.class);
+ PowerMockito.mockStatic(EcompPortalUtils.class);
+ Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME)).thenReturn("test");
+ EPUser user = mockUser.mockEPUser();
+ Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+ Set<MenuData> menuResult = null;
+ HttpSession session = mockedRequest.getSession();
+ Mockito.when(session
+ .getAttribute(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME))).thenReturn(menuResult);
+ actualData = epFusionBaseController.messages(mockedRequest);
+ assertEquals(expectedData,actualData );
+ System.out.println();
+
+ }
+
+ @Test
+ public void messagesTest(){
+ Map<String, Object> expectedData = new HashMap<String, Object>();
+ Map<String, Object> actualData = null;
+ PowerMockito.mockStatic(SystemProperties.class);
+ PowerMockito.mockStatic(EPCommonSystemProperties.class);
+ PowerMockito.mockStatic(EcompPortalUtils.class);
+
+ Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME)).thenReturn("test");
+ EPUser user = mockUser.mockEPUser();
+ Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+ Set<MenuData> menuResult = new HashSet<>();
+ MenuData menuData= new MenuData();
+ menuResult.add(menuData);
+ menuData.setChildMenus(menuResult);
+ HttpSession session = mockedRequest.getSession();
+ Mockito.when(session
+ .getAttribute(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME))).thenReturn(menuResult);
+ actualData = epFusionBaseController.messages(mockedRequest);
+ assertEquals(actualData.size(), 2);
+ }
+
+ @Test
+ public void isAccessibleTest()
+ {
+ assertTrue(epFusionBaseController.isAccessible());
+ }
+ @Test
+ public void isRESTfulCallTest()
+ {
+ assertTrue(epFusionBaseController.isRESTfulCall());
+ }
+}
--- /dev/null
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.openecomp.portalapp.portal.controller;
+
+import static org.junit.Assert.*;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.InjectMocks;
+import org.mockito.MockitoAnnotations;
+import org.openecomp.portalapp.controller.EPRestrictedBaseController;
+
+public class EPRestrictedBaseControllerTest {
+
+ @InjectMocks
+ EPRestrictedBaseController ePRestrictedBaseController = new EPRestrictedBaseController() ;
+
+
+ @Before
+ public void setup() {
+ MockitoAnnotations.initMocks(this);
+ }
+ @Test
+ public void isAccessibleTest()
+ {
+ assertFalse(ePRestrictedBaseController.isAccessible());
+ }
+
+ @Test
+ public void isRESTfulCallTest()
+ {
+ assertFalse(ePRestrictedBaseController.isRESTfulCall());
+ }
+}
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.controller;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.controller;
import static org.junit.Assert.assertEquals;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
@Mock
AdminRolesService adminRolesService = new AdminRolesServiceImpl();
+
+ NullPointerException nullPointerException = new NullPointerException();
@Before
public void setup() {
assertTrue(acutualFieldValidator.equals(expectedFieldValidator));
}
+ @Test
+ public void getMenuItemsExceptionTest(){
+ List<FunctionalMenuItem> actualmenuItems = null;
+ List<FunctionalMenuItem> expectedmenuItems = null;
+
+ Mockito.when(functionalMenuController.getMenuItemsForAuthUser(mockedRequest, mockedResponse)).thenThrow(nullPointerException);
+ actualmenuItems = functionalMenuController.getMenuItemsForAuthUser(mockedRequest, mockedResponse);
+ assertEquals(actualmenuItems, expectedmenuItems);
+ }
+
@Test
public void getFunctionalMenuStaticInfoExceptionTest(){
String fnMenuStaticactualResponse = null;
assertEquals(actualmenuItem, expectedmenuItem);
}
+ @Test
+ public void getFunctionalMenuItemDetailsExceptionTest(){
+ Integer menuId = 1234;
+ FunctionalMenuItem actualmenuItem = null;
+ FunctionalMenuItem expectedmenuItem = null;
+ EPUser user = mockUser.mockEPUser();
+ Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+ Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+ Mockito.when(functionalMenuService.getFunctionalMenuItemDetails(menuId)).thenThrow(nullPointerException);
+
+ actualmenuItem = functionalMenuController.getFunctionalMenuItemDetails(mockedRequest, menuId, mockedResponse);
+ assertEquals(actualmenuItem, expectedmenuItem);
+ }
+
@Test
public void getFunctionalMenuItemDetailsTest(){
Integer menuId = 1234;
assertEquals(actualMenuItems, expectedMenuItems);
}
+ @Test
+ public void getMenuItemsForEditingExceptionTest(){
+ List<FunctionalMenuItem> actualMenuItems = null;
+ List<FunctionalMenuItem> expectedMenuItems = null;
+ EPUser user = mockUser.mockEPUser();
+ Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+ Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+ Mockito.when(functionalMenuService.getFunctionalMenuItems(true)).thenThrow(nullPointerException);
+ actualMenuItems = functionalMenuController.getMenuItemsForEditing(mockedRequest, mockedResponse);
+ assertEquals(actualMenuItems, expectedMenuItems);
+ }
+
+ @Test
+ public void getMenuItemsForNotificationsExceptionTest(){
+ List<FunctionalMenuItem> actualMenuItems = null;
+ List<FunctionalMenuItem> expectedMenuItems = null;
+ Mockito.when(functionalMenuService.getFunctionalMenuItemsForNotificationTree(true)).thenThrow(nullPointerException);
+
+ actualMenuItems = functionalMenuController.getMenuItemsForNotifications(mockedRequest, mockedResponse);
+ assertEquals(actualMenuItems, expectedMenuItems);
+ }
@Test
public void getMenuItemsForNotificationsTest(){
List<FunctionalMenuItem> actualMenuItems = null;
assertEquals(actualMenuItems, expectedMenuItems);
}
+ @Test
+ public void getMenuItemsForAppExceptionTest(){
+ Integer appId = 1234;
+ List<FunctionalMenuItem> actualMenuItems = null;
+ List<FunctionalMenuItem> expectedMenuItems = null;
+ Mockito.when(functionalMenuService.getFunctionalMenuItemsForApp(appId)).thenThrow(nullPointerException);
+
+ actualMenuItems = functionalMenuController.getMenuItemsForApp(mockedRequest, appId);
+ assertEquals(actualMenuItems, expectedMenuItems);
+ }
+
@Test
public void getMenuItemsForUserTest(){
String orgUserId ="test";
assertEquals(actualMenuItems, expectedMenuItems);
}
+ @Test
+ public void getMenuItemsForUserExceptionTest(){
+ String orgUserId ="test";
+ List<FunctionalMenuItem> actualMenuItems = null;
+ List<FunctionalMenuItem> expectedMenuItems = null;
+ Mockito.when(functionalMenuService.getFunctionalMenuItemsForUser(orgUserId)).thenThrow(nullPointerException);
+
+ actualMenuItems = functionalMenuController.getMenuItemsForUser(mockedRequest, orgUserId);
+ assertEquals(actualMenuItems, expectedMenuItems);
+ }
+
@Test
public void createFunctionalMenuItemTest(){
FieldsValidator actualFieldsValidator = new FieldsValidator();
assertEquals(actualportalRestResponse, expectedportalRestResponse);
}
+ @Test
+ public void getECOMPTitleExceptionTest(){
+ PortalRestResponse<String> actualportalRestResponse = null;
+ PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+ expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
+ expectedportalRestResponse.setMessage(null);
+ expectedportalRestResponse.setResponse(null);
+ PowerMockito.mockStatic(SystemProperties.class);
+
+ Mockito.when(SystemProperties.getProperty(SystemProperties.APP_DISPLAY_NAME)).thenThrow(nullPointerException);
+ actualportalRestResponse = functionalMenuController.getECOMPTitle(mockedRequest, mockedResponse);
+ assertEquals(actualportalRestResponse, expectedportalRestResponse);
+ }
+
}
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.controller;
import static org.junit.Assert.assertTrue;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.controller;
import static org.junit.Assert.assertTrue;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.controller;
import static org.junit.Assert.assertEquals;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.controller.MicroserviceController;
import org.openecomp.portalapp.portal.domain.MicroserviceData;
import org.openecomp.portalapp.portal.domain.WidgetCatalog;
import org.openecomp.portalapp.portal.domain.WidgetServiceHeaders;
import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
+import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
import org.openecomp.portalapp.portal.service.ConsulHealthService;
import org.openecomp.portalapp.portal.service.ConsulHealthServiceImpl;
import org.openecomp.portalapp.portal.service.MicroserviceService;
import org.springframework.web.client.RestTemplate;
@RunWith(PowerMockRunner.class)
-@PrepareForTest(WidgetServiceHeaders.class)
+@PrepareForTest({WidgetServiceHeaders.class, EcompPortalUtils.class})
public class MicroserviceControllerTest extends MockitoTestSuite{
@InjectMocks
public void deleteMicroserviceExceptionTest() throws Exception {
PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
expectedportalRestResponse.setMessage("FAILURE");
+ PowerMockito.mockStatic(EcompPortalUtils.class);
expectedportalRestResponse.setResponse(
"I/O error on GET request for \"" + EcompPortalUtils.widgetMsProtocol() + "://null/widget/microservices/widgetCatalog/service/1\":null; nested exception is java.net.UnknownHostException: null");
PortalRestStatusEnum portalRestStatusEnum = null;
List.add(widgetCatalog);
List.add(widgetCatalog1);
PowerMockito.mockStatic(WidgetServiceHeaders.class);
+ PowerMockito.mockStatic(EcompPortalUtils.class);
String whatService = "widgets-service";
Mockito.when(consulHealthService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port"))).thenReturn("Test");
Mockito.when(ans.getBody()).thenReturn(List);
ParameterizedTypeReference<List<WidgetCatalog>> typeRef = new ParameterizedTypeReference<List<WidgetCatalog>>() {
};
Mockito.when(template.exchange(
- HTTPS + consulHealthService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port"))
+ EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port"))
+ "/widget/microservices/widgetCatalog/service/" + 1,
HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), typeRef)).thenReturn(ans);
expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
List<WidgetCatalog> List = new ArrayList<WidgetCatalog>();
PowerMockito.mockStatic(WidgetServiceHeaders.class);
+ PowerMockito.mockStatic(EcompPortalUtils.class);
String whatService = "widgets-service";
Mockito.when(consulHealthService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port"))).thenReturn("Test");
Mockito.when(ans.getBody()).thenReturn(List);
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.controller;
import static org.junit.Assert.assertTrue;
--- /dev/null
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.openecomp.portalapp.portal.controller;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.ws.rs.BadRequestException;
+
+import org.json.simple.JSONObject;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Matchers;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.openecomp.portalapp.portal.core.MockEPUser;
+import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
+import org.openecomp.portalapp.portal.scheduler.SchedulerRestInterface;
+import org.openecomp.portalapp.portal.scheduler.policy.PolicyProperties;
+import org.openecomp.portalapp.portal.scheduler.policy.PolicyResponseWrapper;
+import org.openecomp.portalapp.portal.scheduler.policy.PolicyRestInterfaceFactory;
+import org.openecomp.portalapp.portal.scheduler.policy.PolicyRestInterfaceIfc;
+import org.openecomp.portalapp.portal.scheduler.policy.PolicyUtil;
+import org.openecomp.portalapp.portal.scheduler.policy.RestObject;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.openecomp.portalsdk.core.web.support.UserUtils;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+
+import junit.framework.Assert;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({ UserUtils.class, SystemProperties.class, PolicyProperties.class, PolicyRestInterfaceFactory.class,
+ PolicyUtil.class })
+public class PolicyControllerTest {
+
+ @Mock
+ SchedulerRestInterface schedulerRestInterface;
+
+ @InjectMocks
+ PolicyController policyController = new PolicyController();
+
+ @Before
+ public void setup() {
+ MockitoAnnotations.initMocks(this);
+ }
+
+ MockEPUser mockUser = new MockEPUser();
+ MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+ HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+ HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+ NullPointerException nullPointerException = new NullPointerException();
+
+ @Before
+ public void setUp() {
+
+ PowerMockito.mockStatic(SystemProperties.class);
+ PowerMockito.mockStatic(PolicyProperties.class);
+ Mockito.when(SystemProperties.getProperty(PolicyProperties.POLICY_GET_CONFIG_VAL)).thenReturn("/api/getConfig");
+ Mockito.when(SystemProperties.getProperty(PolicyProperties.POLICY_CLIENT_MECHID_VAL))
+ .thenReturn("m06814@controller.dcae.ecomp.att.com");
+ Mockito.when(SystemProperties.getProperty(PolicyProperties.POLICY_CLIENT_PASSWORD_VAL))
+ .thenReturn("OBF:1ffu1qvu1t2z1l161fuk1i801nz91ro41xf71xfv1rqi1nx51i7y1fuq1kxw1t371qxw1fh0");
+ Mockito.when(SystemProperties.getProperty(PolicyProperties.POLICY_USERNAME_VAL)).thenReturn("testpdp");
+ Mockito.when(SystemProperties.getProperty(PolicyProperties.POLICY_PASSWORD_VAL))
+ .thenReturn("OBF:1igd1kft1l1a1sw61svs1kxs1kcl1idt");
+ Mockito.when(SystemProperties.getProperty(PolicyProperties.POLICY_ENVIRONMENT_VAL)).thenReturn("TEST");
+ Mockito.when(SystemProperties.getProperty(PolicyProperties.POLICY_SERVER_URL_VAL))
+ .thenReturn("https://policypdp-conexus-e2e.ecomp.cci.att.com:8081/pdp");
+
+ }
+
+ @SuppressWarnings({ "unchecked", "deprecation" })
+ @Test
+ public void getPolicyInfoTest1() throws Exception {
+
+ JSONObject jsonObject = Mockito.mock(JSONObject.class);
+ PowerMockito.mockStatic(PolicyRestInterfaceFactory.class);
+ PowerMockito.mockStatic(SystemProperties.class);
+ PolicyRestInterfaceIfc policyRestInterface = Mockito.mock(PolicyRestInterfaceIfc.class);
+ PowerMockito.mockStatic(PolicyUtil.class);
+ // RestObject restObj=Mockito.mock(RestObject.class);
+ PolicyResponseWrapper policyWrapper = Mockito.mock(PolicyResponseWrapper.class);
+ PowerMockito.when(PolicyUtil.wrapResponse(Matchers.any(RestObject.class))).thenReturn(policyWrapper);
+ Mockito.when(policyWrapper.getResponse()).thenReturn("Success");
+ Mockito.when(policyWrapper.getStatus()).thenReturn(200);
+
+ PowerMockito.when(PolicyRestInterfaceFactory.getInstance()).thenReturn(policyRestInterface);
+ Mockito.doNothing().when(policyRestInterface).Post(Matchers.anyString(), Matchers.anyObject(),
+ Matchers.anyString(), Matchers.anyString(), Matchers.anyObject());
+
+ ResponseEntity<String> responsePolicy = policyController.getPolicyInfo(mockedRequest, jsonObject);
+ Assert.assertEquals(responsePolicy.getStatusCode(), HttpStatus.OK);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test(expected = Exception.class)
+ public void getPolicyInfoTestexpected() throws Exception {
+
+ JSONObject jsonObject = Mockito.mock(JSONObject.class);
+ PowerMockito.mockStatic(PolicyRestInterfaceFactory.class);
+ PowerMockito.mockStatic(SystemProperties.class);
+ PolicyRestInterfaceIfc policyRestInterface = Mockito.mock(PolicyRestInterfaceIfc.class);
+ PowerMockito.mockStatic(PolicyUtil.class);
+ // RestObject restObj=Mockito.mock(RestObject.class);
+ PolicyResponseWrapper policyWrapper = Mockito.mock(PolicyResponseWrapper.class);
+ PowerMockito.when(PolicyUtil.wrapResponse(Matchers.any(RestObject.class))).thenReturn(policyWrapper);
+ Mockito.when(policyWrapper.getResponse()).thenThrow(new BadRequestException());
+ Mockito.when(policyWrapper.getStatus()).thenThrow(new BadRequestException());
+
+ PowerMockito.when(PolicyRestInterfaceFactory.getInstance()).thenReturn(policyRestInterface);
+ Mockito.doNothing().when(policyRestInterface).Post(Matchers.anyString(), Matchers.anyObject(),
+ Matchers.anyString(), Matchers.anyString(), Matchers.anyObject());
+
+ policyController.getPolicyInfo(mockedRequest, jsonObject);
+ }
+
+}
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.controller;
import static org.junit.Assert.assertEquals;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.controller.PortalAdminController;
import org.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalapp.portal.domain.EPRole;
import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.exceptions.NoHealthyServiceException;
+import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
import org.openecomp.portalapp.portal.service.AdminRolesService;
import org.openecomp.portalapp.portal.service.AdminRolesServiceImpl;
import org.openecomp.portalapp.portal.service.PortalAdminService;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.controller;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.controller;
import static org.junit.Assert.assertEquals;
-package org.openecomp.portalapp.portal.test.controller;
-
-import java.sql.DriverManager;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.openecomp.portalapp.portal.controller;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.controller.SchedulerController;
+import org.openecomp.portalapp.portal.core.MockEPUser;
+import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
import org.openecomp.portalapp.portal.scheduler.SchedulerProperties;
import org.openecomp.portalapp.portal.scheduler.SchedulerRestInterface;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
import org.openecomp.portalsdk.core.util.SystemProperties;
import org.openecomp.portalsdk.core.web.support.UserUtils;
import org.powermock.api.mockito.PowerMockito;
-package org.openecomp.portalapp.portal.controller;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+ package org.openecomp.portalapp.portal.controller;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.drools.core.command.assertion.AssertEquals;
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.openecomp.portalapp.controller.sessionmgt.SessionCommunicationController;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
import org.openecomp.portalapp.portal.core.MockEPUser;
+import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
import org.openecomp.portalapp.service.sessionmgt.ManageService;
public class SessionCommunicationControllerTest {
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
/*package org.openecomp.portalapp.portal.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.controller;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
+import java.util.ArrayList;
+import java.util.List;
+
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
+import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.controller.TicketEventController;
import org.openecomp.portalapp.portal.core.MockEPUser;
+import org.openecomp.portalapp.portal.domain.EPUser;
import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
+import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
+import org.openecomp.portalapp.portal.service.TicketEventService;
import org.openecomp.portalapp.portal.service.UserNotificationService;
import org.openecomp.portalsdk.core.web.support.UserUtils;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
+import com.fasterxml.jackson.databind.JsonNode;
+
@RunWith(PowerMockRunner.class)
@PrepareForTest(UserUtils.class)
public class TicketEventControllerTest {
@Mock
UserNotificationService userNotificationService;
-
+
+ @Mock
+ TicketEventService ticketEventService;
+
@InjectMocks
TicketEventController ticketEventController = new TicketEventController();
HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
NullPointerException nullPointerException = new NullPointerException();
-// @Test
-// public void saveTest() throws Exception {
-// String ticketEventJson = "{\"application\": \"cbus\",\"event\": {\"body\": {\"ticketStatePhrase\": \"We recently detected a problem with the equipment at your site. The event is in queue for immediate work.\", \"ivrNotificationFlag\": \"1\",\"expectedRestoreDate\": 0,\"bridgeTransport\": \"AOTS\", \"reptRequestType\": 0,\"ticketNum\": \"000002000857405\",\"assetID\": \"CISCO_1921C1_ISR_G2\", \"eventDate\": 1490545134601,\"eventAbstract\": \"ospfIfConfigError trap received from Cisco_1921c1_ISR_G2 with arguments: ospfRouterId=Cisco_1921c1_ISR_G2; ospfIfIpAddress=1921c1_288266; ospfAddressLessIf=0; ospfPacketSrc=172.17.0.11; ospfConfigErrorType=2; ospfPacketType=1\",\"severity\": \"2 - Major\",\"ticketPriority\": \"3\",\"reportedCustomerImpact\": 0,\"testAutoIndicator\": 0,\"supportGroupName\": \"US-TEST-ORT\",\"lastModifiedDate\": \"1487687703\",\"messageGroup\": \"SNMP\",\"csi\": 0,\"mfabRestoredTime\": 0},\"header\": {\"timestamp\": \"2017-02-21T14:35:05.219+0000\",\"eventSource\": \"aotstm\",\"entityId\": \"000002000857405\", \"sequenceNumber\": 2 },\"blinkMsgId\": \"f38c071e-1a47-4b55-9e72-1db830100a61\",\"sourceIP\": \"130.4.165.158\"},\"SubscriberInfo\": {\"UserList\": [\"hk8777\"] }}";
-// PortalRestResponse<String> actualPortalRestResponse = ticketEventController.handleRequest(mockedRequest,
-// mockedResponse, ticketEventJson);
-// assertTrue(actualPortalRestResponse.getStatus().compareTo(PortalRestStatusEnum.OK) == 0);
-// }
+ @Test
+ public void saveUserValidationTest() throws Exception {
+ PortalRestResponse<String> actualPortalRestResponse = new PortalRestResponse<String>();
+ PortalRestResponse<String> expectedPortalRestResponse = new PortalRestResponse<String>();
+ expectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
+ expectedPortalRestResponse.setMessage("Invalid Org User ID");
+ expectedPortalRestResponse.setResponse(null);
+ String ticketEventJson = "{\"application\": \"cbus\",\"event\": {\"body\": {\"ticketStatePhrase\": \"We recently detected a problem with the equipment at your site."
+ + " The event is in queue for immediate work.\", \"ivrNotificationFlag\": \"1\",\"expectedRestoreDate\": 0,\"bridgeTransport\": \"AOTS\", "
+ + "\"reptRequestType\": 0,\"ticketNum\": \"000002000857405\",\"assetID\": \"CISCO_1921C1_ISR_G2\", \"eventDate\": 1490545134601,"
+ + "\"eventAbstract\": \"ospfIfConfigError trap received from Cisco_1921c1_ISR_G2 with arguments: ospfRouterId=Cisco_1921c1_ISR_G2; "
+ + "ospfIfIpAddress=1921c1_288266; ospfAddressLessIf=0; ospfPacketSrc=172.17.0.11; ospfConfigErrorType=2; ospfPacketType=1\","
+ + "\"severity\": \"2 - Major\",\"ticketPriority\": \"3\",\"reportedCustomerImpact\": 0,\"testAutoIndicator\": 0,\"supportGroupName\": \"US-TEST-ORT\","
+ + "\"lastModifiedDate\": \"1487687703\",\"messageGroup\": \"SNMP\",\"csi\": 0,\"mfabRestoredTime\": 0},\"header\": "
+ + "{\"timestamp\": \"2017-02-21T14:35:05.219+0000\",\"eventSource\": \"aotstm\",\"entityId\": \"000002000857405\", "
+ + "\"sequenceNumber\": 2 },\"blinkMsgId\": \"f38c071e-1a47-4b55-9e72-1db830100a61\",\"sourceIP\": \"130.4.165.158\"},"
+ + "\"SubscriberInfo\": {\"UserList\": [\"guest\"] }}";
+
+ actualPortalRestResponse = ticketEventController.handleRequest(mockedRequest,
+ mockedResponse, ticketEventJson);
+ assertEquals(actualPortalRestResponse, expectedPortalRestResponse);
+ }
+
+ @Test
+ public void saveTest() throws Exception {
+ String UserIds[] = new String[1];
+ UserIds[0] = "guest";
+ ArrayList<EPUser> users = new ArrayList<>();
+ EPUser user = new EPUser();
+ user.setOrgUserId("guest");
+ user.setId((long)1);
+ users.add(user);
+ List<String> userIdlist = new ArrayList<>();
+ userIdlist.add("guest");
+ JsonNode application = null ;
+ String ticketEventJson = "{\"application\":\"cbus\",\"event\":{\"body\":{\"ticketStatePhrase\":\"We recently detected a problem with the equipment at your site. "
+ + "The event is in queue for immediate work.\",\"ivrNotificationFlag\":\"1\",\"expectedRestoreDate\":0,\"bridgeTransport\":\"AOTS\",\"reptRequestType\":0,"
+ + "\"ticketNum\":\"000002000857405\",\"assetID\":\"CISCO_1921C1_ISR_G2\",\"eventDate\":1490545134601,"
+ + "\"eventAbstract\":\"ospfIfConfigError trap received from Cisco_1921c1_ISR_G2 with arguments: ospfRouterId=Cisco_1921c1_ISR_G2; "
+ + "ospfIfIpAddress=1921c1_288266; ospfAddressLessIf=0; ospfPacketSrc=172.17.0.11; ospfConfigErrorType=2; ospfPacketType=1\","
+ + "\"severity\":\"2 - Major\",\"ticketPriority\":\"3\",\"reportedCustomerImpact\":0,\"testAutoIndicator\":0,"
+ + "\"supportGroupName\":\"US-TEST-ORT\",\"lastModifiedDate\":\"1487687703\",\"messageGroup\":\"SNMP\",\"csi\":0,\"mfabRestoredTime\":0},"
+ + "\"header\":{\"timestamp\":\"2017-02-21T14:35:05.219+0000\",\"eventSource\":\"aotstm\",\"entityId\":\"000002000857405\",\"sequenceNumber\":2},"
+ + "\"blinkMsgId\":\"f38c071e-1a47-4b55-9e72-1db830100a61\",\"sourceIP\":\"130.4.165.158\"},\"SubscriberInfo\":{\"UserList\":[\"guest\"]}}";
+ PortalRestResponse<String> actualPortalRestResponse = new PortalRestResponse<String>();
+ PortalRestResponse<String> expectedPortalRestResponse = new PortalRestResponse<String>();
+ expectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
+ expectedPortalRestResponse.setMessage("processEventNotification: notification created");
+ expectedPortalRestResponse.setResponse("NotificationId");
+
+
+ Mockito.when(userNotificationService.getUsersByOrgIds(userIdlist)).thenReturn(users);
+ Mockito.when(ticketEventService.getNotificationHyperLink(application, "", "")).thenReturn("");
+ actualPortalRestResponse = ticketEventController.handleRequest(mockedRequest,
+ mockedResponse, ticketEventJson);
+ assertTrue(actualPortalRestResponse.getStatus().compareTo(PortalRestStatusEnum.OK) == 0);
+ }
@Test
public void saveTestForException() throws Exception {
assertTrue(actualPortalRestResponse.getStatus().compareTo(PortalRestStatusEnum.ERROR) == 0);
assertEquals(actualPortalRestResponse.getMessage(), "At least one user Id is mandatory");
}
+
+ @Test
+ public void saveTestForApplicationValid() throws Exception {
+ String ticketEventJson = "{\"event\": {\"body\": {\"ticketStatePhrase\": \"We recently detected a problem with the equipment at your site. The event is in queue for immediate work.\", \"ivrNotificationFlag\": \"1\",\"expectedRestoreDate\": 0,\"bridgeTransport\": \"AOTS\", \"reptRequestType\": 0,\"ticketNum\": \"000002000857405\",\"assetID\": \"CISCO_1921C1_ISR_G2\", \"eventDate\": 1490545134601,\"eventAbstract\": \"ospfIfConfigError trap received from Cisco_1921c1_ISR_G2 with arguments: ospfRouterId=Cisco_1921c1_ISR_G2; ospfIfIpAddress=1921c1_288266; ospfAddressLessIf=0; ospfPacketSrc=172.17.0.11; ospfConfigErrorType=2; ospfPacketType=1\",\"severity\": \"2 - Major\",\"ticketPriority\": \"3\",\"reportedCustomerImpact\": 0,\"testAutoIndicator\": 0,\"supportGroupName\": \"US-TEST-ORT\",\"lastModifiedDate\": \"1487687703\",\"messageGroup\": \"SNMP\",\"csi\": 0,\"mfabRestoredTime\": 0},\"header\": {\"timestamp\": \"2017-02-21T14:35:05.219+0000\",\"eventSource\": \"aotstm\",\"entityId\": \"000002000857405\", \"sequenceNumber\": 2 },\"blinkMsgId\": \"f38c071e-1a47-4b55-9e72-1db830100a61\",\"sourceIP\": \"130.4.165.158\"},\"SubscriberInfo\": {\"UserList\": [\"hk8777\"] }}";
+ PortalRestResponse<String> actualPortalRestResponse = ticketEventController.handleRequest(mockedRequest,
+ mockedResponse, ticketEventJson);
+ assertTrue(actualPortalRestResponse.getStatus().compareTo(PortalRestStatusEnum.ERROR) == 0);
+ assertEquals(actualPortalRestResponse.getMessage(), "Application is mandatory");
+
+ }
}
\ No newline at end of file
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.controller;
import static org.junit.Assert.assertEquals;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.controller;
-import static org.junit.Assert.*;
-
-import java.io.InputStream;
-import java.nio.charset.StandardCharsets;
+import static org.junit.Assert.assertTrue;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.controller.WebAnalyticsExtAppController;
-import org.openecomp.portalapp.portal.domain.EPApp;
import org.openecomp.portalapp.portal.service.AdminRolesService;
import org.openecomp.portalapp.portal.service.AdminRolesServiceImpl;
import org.openecomp.portalapp.portal.service.AppsCacheService;
import org.openecomp.portalsdk.core.service.AuditService;
import org.openecomp.portalsdk.core.service.AuditServiceImpl;
import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
+++ /dev/null
-//package org.openecomp.portalapp.portal.controller;
-//
-//import javax.servlet.http.HttpServletRequest;
-//import javax.servlet.http.HttpServletResponse;
-//
-//import org.junit.Before;
-//import org.junit.runner.RunWith;
-//import org.mockito.InjectMocks;
-//import org.mockito.Mock;
-//import org.mockito.MockitoAnnotations;
-//import org.openecomp.portalapp.portal.core.MockEPUser;
-//import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-//import org.openecomp.portalapp.portal.service.ConsulHealthService;
-//import org.openecomp.portalapp.portal.service.ConsulHealthServiceImpl;
-//import org.openecomp.portalapp.portal.service.MicroserviceService;
-//import org.openecomp.portalapp.portal.service.MicroserviceServiceImpl;
-//import org.openecomp.portalapp.portal.service.WidgetParameterService;
-//import org.openecomp.portalapp.portal.service.WidgetParameterServiceImpl;
-//import org.openecomp.portalapp.util.EPUserUtils;
-//import org.powermock.core.classloader.annotations.PrepareForTest;
-//import org.powermock.modules.junit4.PowerMockRunner;
-//
-//@RunWith(PowerMockRunner.class)
-//@PrepareForTest({EPUserUtils.class})
-//public class WidgetsCatalogControllerTest {
-//
-// @Mock
-// ConsulHealthService consulHealthService = new ConsulHealthServiceImpl();
-//
-// @Mock
-// MicroserviceService microserviceService = new MicroserviceServiceImpl();
-//
-// @Mock
-// WidgetParameterService widgetParameterService = new WidgetParameterServiceImpl();
-//
-// @InjectMocks
-// WidgetsCatalogController widgetsCatalogController = new WidgetsCatalogController();
-//
-// @Before
-// public void setup() {
-// MockitoAnnotations.initMocks(this);
-// }
-//
-// MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-//
-// HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-// HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-//
-// NullPointerException nullPointerException = new NullPointerException();
-//
-// MockEPUser mockUser = new MockEPUser();
-//
-// /*public List<WidgetCatalog> getUserWidgetCatalog(HttpServletRequest request, HttpServletResponse response,
-// @PathVariable("loginName") String loginName) throws RestClientException, Exception {
-// List<WidgetCatalog> widgets = new ArrayList<>();
-// try {
-// CustomLoggingFilter d;
-// ResponseEntity<ArrayList> ans = template.exchange(
-// EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService,
-// SystemProperties.getProperty("microservices.widget.local.port"))
-// + "/widget/microservices/widgetCatalog/" + loginName,
-// HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), ArrayList.class);
-// widgets = ans.getBody();
-// } catch (Exception e) {
-// logger.error(EELFLoggerDelegate.errorLogger, "getUserWidgetCatalog failed", e);
-// // returning null because null help check on the UI if there was a
-// // communication problem with Microservice.
-// return null;
-// }
-// return widgets;
-// }
-//
-// @Test
-// public void getWidgetDataTest(){
-//
-// String resourceType = null;
-// List<WidgetCatalog> expectedData = new ArrayList<WidgetCatalog>();
-// expectedData.setStatus(PortalRestStatusEnum.ERROR);
-// expectedData.setMessage("Unexpected resource type null");
-// expectedData.setResponse(null);
-//
-// PortalRestResponse<CommonWidgetMeta> actualResponse = dashboardController.getWidgetData(mockedRequest, resourceType);
-// assertEquals(expectedData,actualResponse);
-//
-//
-// }*/
-//}
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.controller;
import static org.junit.Assert.assertTrue;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.controller.WidgetsCatalogMarkupController;
import org.openecomp.portalapp.portal.domain.WidgetServiceHeaders;
+import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
import org.openecomp.portalapp.portal.service.ConsulHealthService;
import org.openecomp.portalapp.portal.service.ConsulHealthServiceImpl;
import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
-import org.openecomp.portalsdk.core.util.SystemProperties;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import org.springframework.web.client.RestTemplate;
@RunWith(PowerMockRunner.class)
-@PrepareForTest(WidgetServiceHeaders.class)
+@PrepareForTest({WidgetServiceHeaders.class, EcompPortalUtils.class})
public class WidgetsCatalogMarkupControllerTest extends MockitoTestSuite {
@InjectMocks
CipherUtil cipherUtil= new CipherUtil();
@Mock
- EcompPortalUtils EcompPortalUtils =new EcompPortalUtils();
+ EcompPortalUtils ecompPortalUtils =new EcompPortalUtils();
@Mock
WidgetServiceHeaders WidgetServiceHeaders ;
{
String whatService = "widgets-service";
PowerMockito.mockStatic(WidgetServiceHeaders.class);
+ PowerMockito.mockStatic(EcompPortalUtils.class);
Mockito.when(template.getForObject(EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService, null) + "/widget/microservices/markup/" + 1, String.class,
WidgetServiceHeaders.getInstance())).thenReturn("Success");
String response = widgetsCatalogMarkupController.getWidgetMarkup(mockedRequest, mockedResponse, 1);
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.core;
+++ /dev/null
-///*-
-// * ================================================================================
-// * ECOMP Portal
-// * ================================================================================
-// * Copyright (C) 2017 AT&T Intellectual Property
-// * ================================================================================
-// * 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.
-// * See the License for the specific language governing permissions and
-// * limitations under the License.
-// * ================================================================================
-// */
-//package org.openecomp.portalapp.portal.core;
-//
-//import java.sql.Connection;
-//import java.sql.SQLException;
-//
-//import javax.sql.DataSource;
-//
-//import org.junit.Before;
-//import org.junit.Test;
-//import org.openecomp.portalapp.framework.ApplicationCommonContextTestSuite;
-//import org.springframework.beans.factory.annotation.Autowired;
-//import org.springframework.core.io.ClassPathResource;
-//import org.springframework.jdbc.datasource.DataSourceUtils;
-//import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator;
-//
-//public class PopulateSampleTestData extends ApplicationCommonContextTestSuite {
-//
-// @Autowired
-// DataSource dataSource;
-//
-// @Before
-// public void populateTestData() throws SQLException {
-//
-// String sql = "PopulateTestData.sql";
-// createConnection(sql);
-// }
-//
-// public void createConnection(String sql) {
-// Connection connection = null;
-// ResourceDatabasePopulator populator = new ResourceDatabasePopulator();
-// populator.addScript(new ClassPathResource(sql));
-// try {
-// connection = DataSourceUtils.getConnection(dataSource);
-// populator.populate(connection);
-// } finally {
-// if (connection != null) {
-// DataSourceUtils.releaseConnection(connection, dataSource);
-// }
-// }
-// }
-//
-// @Test
-// public void populateTest() {
-// assert (true);
-// }
-//
-//}
+++ /dev/null
-///*-
-// * ================================================================================
-// * ECOMP Portal
-// * ================================================================================
-// * Copyright (C) 2017 AT&T Intellectual Property
-// * ================================================================================
-// * 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.
-// * See the License for the specific language governing permissions and
-// * limitations under the License.
-// * ================================================================================
-// */
-//package org.openecomp.portalapp.portal.core;
-//
-//import java.sql.Connection;
-//import java.sql.SQLException;
-//
-//import javax.sql.DataSource;
-//
-//import org.junit.After;
-//import org.junit.Test;
-//import org.openecomp.portalapp.framework.ApplicationCommonContextTestSuite;
-//import org.springframework.beans.factory.annotation.Autowired;
-//import org.springframework.core.io.ClassPathResource;
-//import org.springframework.jdbc.datasource.DataSourceUtils;
-//import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator;
-//
-//public class RemoveSampleTestData extends ApplicationCommonContextTestSuite {
-// @Autowired
-// DataSource dataSource;
-//
-// public static int count = 0;
-//
-// @After
-// public void removeTestData() throws SQLException {
-// String sql = "RemoveTestData.sql";
-// createConnection(sql);
-// }
-//
-// public void createConnection(String sql) {
-// Connection connection = null;
-// ResourceDatabasePopulator populator = new ResourceDatabasePopulator();
-// populator.addScript(new ClassPathResource(sql));
-// try {
-// connection = DataSourceUtils.getConnection(dataSource);
-// populator.populate(connection);
-// } finally {
-// if (connection != null) {
-// DataSourceUtils.releaseConnection(connection, dataSource);
-// }
-// }
-// }
-//
-// @Test
-// public void removeTest() {
-// assert (true);
-// }
-//}
+++ /dev/null
-///*-
-// * ================================================================================
-// * ECOMP Portal
-// * ================================================================================
-// * Copyright (C) 2017 AT&T Intellectual Property
-// * ================================================================================
-// * 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.
-// * See the License for the specific language governing permissions and
-// * limitations under the License.
-// * ================================================================================
-// */
-//package org.openecomp.portalapp.portal.core;
-//
-//import static org.junit.Assert.assertEquals;
-//import static org.junit.Assert.assertTrue;
-//
-//import java.io.IOException;
-//import java.nio.charset.Charset;
-//import java.util.ArrayList;
-//
-//import org.junit.Assert;
-//import org.junit.Test;
-//import org.openecomp.portalapp.framework.ApplicationCommonContextTestSuite;
-//import org.openecomp.portalapp.portal.domain.EPUser;
-//import org.openecomp.portalapp.portal.test.core.MockEPUser;
-//import org.openecomp.portalapp.portal.transport.AppNameIdIsAdmin;
-//import org.openecomp.portalapp.portal.transport.AppsListWithAdminRole;
-//import org.openecomp.portalsdk.core.util.SystemProperties;
-//import org.springframework.http.MediaType;
-//import org.springframework.test.web.servlet.ResultActions;
-//import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;
-//import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
-//
-//import com.fasterxml.jackson.annotation.JsonInclude;
-//import com.fasterxml.jackson.databind.ObjectMapper;
-//
-///**
-// *
-// * Use RestURLsTestSuite to test Rest API URL's
-// */
-//public class RestURLsTestSuite extends ApplicationCommonContextTestSuite {
-//
-// public static final MediaType APPLICATION_JSON_UTF8 = new MediaType(MediaType.APPLICATION_JSON.getType(),
-// MediaType.APPLICATION_JSON.getSubtype(), Charset.forName("utf8"));
-//
-// String url = null;
-//
-// MockEPUser mockUser = new MockEPUser();
-//
-// public byte[] convertObjectToJsonBytes(Object object) throws IOException {
-// ObjectMapper mapper = new ObjectMapper();
-// mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-// return mapper.writeValueAsBytes(object);
-// }
-//
-// public void requestBuilder(String url) throws Exception {
-// EPUser user = mockUser.mockEPUser();
-//
-// MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.get(url);
-// requestBuilder.sessionAttr(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
-// ResultActions ra = getMockMvc().perform(requestBuilder);
-// assertData(ra);
-// }
-//
-// public void assertData(ResultActions ra) {
-// Assert.assertEquals("application/json", ra.andReturn().getResponse().getContentType());
-// Assert.assertEquals(200, ra.andReturn().getResponse().getStatus());
-//
-// }
-//
-// @Test
-// public void getMenuItemsTest() throws Exception {
-// url = "/portalApi/functionalMenu";
-// requestBuilder(url);
-// }
-//
-// @Test
-// public void getMenuItemsForNotificationsTest() throws Exception {
-// url = "/portalApi/functionalMenuForNotificationTree";
-// requestBuilder(url);
-// }
-//
-// @Test
-// public void getUserAppsTestnew() throws Exception {
-// url = "/portalApi/userApps";
-// requestBuilder(url);
-// }
-//
-// @Test
-// public void getPersUserAppsTest() throws Exception {
-// url = "/portalApi/persUserApps";
-// requestBuilder(url);
-// }
-//
-// @Test
-// public void getAppCatalogTest() throws Exception {
-// url = "/portalApi/appCatalog";
-// requestBuilder(url);
-// }
-//
-// @Test
-// public void getAppListNewTest() throws Exception {
-// ResultActions ra = getMockMvc()
-// .perform(MockMvcRequestBuilders.get("/portalApi/userApplicationRoles").param("userId", "guest"));
-// assertData(ra);
-// }
-//
-// @Test
-// public void getAvailableAppListTest() throws Exception {
-// url = "/portalApi/availableApps";
-// requestBuilder(url);
-// }
-//
-// @Test
-// public void getAllAppsTest() throws Exception {
-// url = "/portalApi/allAvailableApps";
-// requestBuilder(url);
-// }
-//
-// @Test
-// public void getUserProfileTest() throws Exception {
-// url = "/portalApi/userProfile";
-// requestBuilder(url);
-// }
-//
-// @Test
-// public void getRolesByAppTest() throws Exception {
-// EPUser user = mockUser.mockEPUser();
-// MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.get("/portalApi/adminAppsRoles/550");
-// requestBuilder.sessionAttr(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
-// ResultActions ra = getMockMvc().perform(requestBuilder);
-// assertData(ra);
-// }
-//
-// @Test
-// public void getAppsWithAdminRoleStateForUserTest() throws Exception {
-// url = "/portalApi/adminAppsRoles?user=guest";
-// requestBuilder(url);
-//
-// }
-//
-// @Test
-// public void getUsersFromAppEndpointTest() throws Exception {
-// url = "/portalApi/app/550/users";
-// requestBuilder(url);
-// }
-//
-// @Test
-// public void getOnboardingAppsTest() throws Exception {
-// url = "/portalApi/onboardingApps";
-// requestBuilder(url);
-// }
-//
-// @Test
-// public void getMenuItemsForAuthUserTest() throws Exception {
-// url = "/portalApi/functionalMenuForAuthUser";
-// requestBuilder(url);
-// }
-//
-// @Test
-// public void getMenuItemsForEditingTest() throws Exception {
-// url = "/portalApi/functionalMenuForEditing";
-// requestBuilder(url);
-// }
-//
-// @Test
-// public void getAppRolesTest() throws Exception {
-// url = "/portalApi/appRoles/455";
-// requestBuilder(url);
-// }
-//
-// @Test
-// public void regenerateAncestorTableTest() throws Exception {
-//
-// EPUser user = mockUser.mockEPUser();
-//
-// MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders
-// .get("/portalApi/regenerateFunctionalMenuAncestors");
-// requestBuilder.sessionAttr(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
-// ResultActions ra = getMockMvc().perform(requestBuilder);
-// assertEquals("application/json;charset=UTF-8", ra.andReturn().getResponse().getContentType());
-// Assert.assertEquals(200, ra.andReturn().getResponse().getStatus());
-//
-// }
-//
-// @Test
-// public void getAppListTest() throws Exception {
-// url = "/portalApi/getAppList";
-// requestBuilder(url);
-// }
-//
-// @Test
-// public void getFavoritesForUserTest() throws Exception {
-// url = "/portalApi/getFavoriteItems";
-// requestBuilder(url);
-// }
-//
-// @Test
-// public void getManifestTest() throws Exception {
-// url = "/portalApi/manifest";
-// requestBuilder(url);
-// }
-//
-// @Test
-// public void getActiveUsersTest() throws Exception {
-// url = "/portalApi/dashboard/activeUsers";
-// requestBuilder(url);
-// }
-//
-// @Test
-// public void searchPortalTest() throws Exception {
-// EPUser user = mockUser.mockEPUser();
-// MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.get("/portalApi/dashboard/search")
-// .param("searchString", "guest");
-// requestBuilder.sessionAttr(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
-// ResultActions ra = getMockMvc().perform(requestBuilder);
-// assertData(ra);
-// }
-//
-// @Test
-// public void getWidgetDataTest() throws Exception {
-// EPUser user = mockUser.mockEPUser();
-// MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.get("/portalApi/dashboard/widgetData")
-// .param("resourceType", "guest");
-// requestBuilder.sessionAttr(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
-// ResultActions ra = getMockMvc().perform(requestBuilder);
-// assertData(ra);
-// }
-//
-// @Test
-// public void getAppsAndContactsTest() throws Exception {
-// url = "/portalApi/contactus/allapps";
-// requestBuilder(url);
-// }
-//
-// @Test
-// public void getPortalDetailsTest() throws Exception {
-// url = "/portalApi/contactus/feedback";
-// requestBuilder(url);
-// }
-//
-// @Test
-// public void getAppCategoryFunctionsTest() throws Exception {
-// url = "/portalApi/contactus/functions";
-// requestBuilder(url);
-// }
-//
-// @Test
-// public void getOnlineUserUpdateRateTest() throws Exception {
-// url = "/portalApi/dashboard/onlineUserUpdateRate";
-// requestBuilder(url);
-// }
-//
-// @Test
-// public void getMenuIdRoleIdTest() throws Exception {
-// url = "/portalApi/getFunctionalMenuRole";
-// requestBuilder(url);
-// }
-//
-// @Test
-// public void getNotificationsTest() throws Exception {
-// url = "/portalApi/getNotifications";
-// requestBuilder(url);
-// }
-//
-// @Test
-// public void getAdminNotificationsTest() throws Exception {
-// url = "/portalApi/getAdminNotifications";
-// requestBuilder(url);
-// }
-//
-// @Test
-// public void getNotificationAppRolesTest() throws Exception {
-// url = "/portalApi/getNotificationAppRoles";
-// requestBuilder(url);
-// }
-//
-// @Test
-// public void getNotificationUpdateRateTest() throws Exception {
-// url = "/portalApi/notificationUpdateRate";
-// requestBuilder(url);
-// }
-//
-// @Test
-// public void notificationReadTest() throws Exception {
-// url = "/portalApi/notificationRead?notificationId=262";
-// requestBuilder(url);
-// }
-//
-// @Test
-// public void testGetRolesTest() throws Exception {
-// url = "/portalApi/notificationRole/248/roles";
-// requestBuilder(url);
-// }
-//
-// @Test
-// public void putAppsWithAdminRoleStateForUserTest() throws Exception {
-//
-// AppsListWithAdminRole appsListWithAdminRole = new AppsListWithAdminRole();
-// appsListWithAdminRole.setOrgUserId("guest");
-// ArrayList<AppNameIdIsAdmin> appsRoles = new ArrayList<AppNameIdIsAdmin>();
-// AppNameIdIsAdmin appNameIdIsAdmin = new AppNameIdIsAdmin();
-// appNameIdIsAdmin.setId((long) 455);
-// appNameIdIsAdmin.setAppName("CCD");
-// appNameIdIsAdmin.setIsAdmin(true);
-// appNameIdIsAdmin.setRestrictedApp(false);
-// appsRoles.add(appNameIdIsAdmin);
-// appsListWithAdminRole.setAppsRoles(appsRoles);
-// EPUser user = mockUser.mockEPUser();
-// MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.put("/portalApi/adminAppsRoles")
-// .contentType(APPLICATION_JSON_UTF8).content(convertObjectToJsonBytes(appsListWithAdminRole));
-//
-// requestBuilder.sessionAttr(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
-// ResultActions ra = getMockMvc().perform(requestBuilder);
-// assertData(ra);
-// }
-//
-// @Test
-// public void ticketEventControllerForExternalSystem() throws Exception {
-// String ticketEventJson = "{\"application\": \"cbus\",\"event\": {\"body\": {\"ticketStatePhrase\": \"We recently detected a problem with the equipment at your site. The event is in queue for immediate work.\", \"ivrNotificationFlag\": \"1\",\"expectedRestoreDate\": 0,\"bridgeTransport\": \"AOTS\", \"reptRequestType\": 0,\"ticketNum\": \"000002000857405\",\"assetID\": \"CISCO_1921C1_ISR_G2\", \"eventDate\": 1490545134601,\"eventAbstract\": \"ospfIfConfigError trap received from Cisco_1921c1_ISR_G2 with arguments: ospfRouterId=Cisco_1921c1_ISR_G2; ospfIfIpAddress=1921c1_288266; ospfAddressLessIf=0; ospfPacketSrc=172.17.0.11; ospfConfigErrorType=2; ospfPacketType=1\",\"severity\": \"2 - Major\",\"ticketPriority\": \"3\",\"reportedCustomerImpact\": 0,\"testAutoIndicator\": 0,\"supportGroupName\": \"US-TEST-ORT\",\"lastModifiedDate\": \"1487687703\",\"messageGroup\": \"SNMP\",\"csi\": 0,\"mfabRestoredTime\": 0},\"header\": {\"timestamp\": \"2017-02-21T14:35:05.219+0000\",\"eventSource\": \"aotstm\",\"entityId\": \"000002000857405\", \"sequenceNumber\": 2 },\"blinkMsgId\": \"f38c071e-1a47-4b55-9e72-1db830100a61\",\"sourceIP\": \"130.4.165.158\"},\"SubscriberInfo\": {\"UserList\": [\"hk8777\"] }}";
-// MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.post("/auxapi/ticketevent")
-// .contentType(APPLICATION_JSON_UTF8).content(ticketEventJson);
-// ResultActions ra = getMockMvc().perform(requestBuilder);
-// assertTrue(ra.andReturn().getResponse().getContentType().contains("application/json"));
-// }
-//}
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.assertEquals;
assertEquals(epUserAppRolesRequestDetail.getReqRoleId(), new Long(1));
assertEquals(epUserAppRolesRequestDetail.getReqType(), "test");
- assertEquals(epUserAppRolesRequestDetail.getEpRequestIdData(), epUserAppRolesRequest);
-// assertEquals(epUserAppRolesRequestDetail.hashCode(), epUserAppRolesRequestDetail1.hashCode());
-
}
}
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.*;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.*;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import java.util.ArrayList;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.*;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.*;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.domain;
import static org.junit.Assert.*;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.exceptions;
import static org.junit.Assert.assertEquals;
+++ /dev/null
-///*-
-// * ================================================================================
-// * ECOMP Portal
-// * ================================================================================
-// * Copyright (C) 2017 AT&T Intellectual Property
-// * ================================================================================
-// * 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.
-// * See the License for the specific language governing permissions and
-// * limitations under the License.
-// * ================================================================================
-// */
-//package org.openecomp.portalapp.portal.framework;
-//
-//import java.io.IOException;
-//
-//import org.junit.Before;
-//import org.junit.runner.RunWith;
-//import org.openecomp.portalsdk.core.conf.AppConfig;
-////import org.openecomp.portalapp.conf.ExternalAppConfig;
-////import org.openecomp.portalapp.conf.HibernateMappingLocations;
-//import org.openecomp.portalsdk.core.conf.HibernateConfiguration;
-//import org.openecomp.portalsdk.core.conf.HibernateMappingLocatable;
-//import org.openecomp.portalsdk.core.objectcache.AbstractCacheManager;
-//import org.openecomp.portalsdk.core.util.CacheManager;
-//import org.openecomp.portalsdk.core.util.SystemProperties;
-//import org.springframework.beans.factory.annotation.Autowired;
-//import org.springframework.context.annotation.Bean;
-//import org.springframework.context.annotation.ComponentScan;
-//import org.springframework.context.annotation.Configuration;
-//import org.springframework.context.annotation.FilterType;
-//import org.springframework.context.annotation.Profile;
-//import org.springframework.core.io.ClassPathResource;
-//import org.springframework.core.io.Resource;
-//import org.springframework.test.context.ActiveProfiles;
-//import org.springframework.test.context.ContextConfiguration;
-//import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-//import org.springframework.test.context.web.AnnotationConfigWebContextLoader;
-//import org.springframework.test.context.web.WebAppConfiguration;
-//import org.springframework.test.web.servlet.MockMvc;
-//import org.springframework.test.web.servlet.setup.MockMvcBuilders;
-//import org.springframework.web.context.WebApplicationContext;
-//import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
-//
-///**
-// *
-// * In order to write a unit test, 1. inherit this class 2. place the "war"
-// * folder on your test class's classpath 3. run the test with the following VM
-// * argument; This is important because when starting the application from
-// * Container, the System Properties file (SystemProperties.java) can have the
-// * direct path but, when running from the Mock Junit container, the path should
-// * be prefixed with "classpath" to enable the mock container to search for the
-// * file in the classpath -Dcontainer.classpath="classpath:"
-// */
-//
-//@SuppressWarnings("deprecation")
-//@RunWith(SpringJUnit4ClassRunner.class)
-//@WebAppConfiguration
-//@ContextConfiguration(loader = AnnotationConfigWebContextLoader.class, classes = { MockAppConfig.class })
-//@ActiveProfiles(value = "test")
-//public class ApplicationCommonContextTestSuite {
-//
-// @Autowired
-// public WebApplicationContext wac;
-//
-// private MockMvc mockMvc;
-//
-// @Before
-// public void setup() {
-// if (mockMvc == null) {
-// this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
-//
-// }
-// }
-//
-// public Object getBean(String name) {
-// return this.wac.getBean(name);
-// }
-//
-// public MockMvc getMockMvc() {
-// return mockMvc;
-// }
-//
-// public void setMockMvc(MockMvc mockMvc) {
-// this.mockMvc = mockMvc;
-// }
-//
-// public WebApplicationContext getWebApplicationContext() {
-// return wac;
-// }
-//
-//}
-//
-//@Configuration
-//@ComponentScan(basePackages = "org.openecomp", excludeFilters = {
-// // the following source configurations should not be scanned; instead of
-// // using Exclusion filter, we can use the @Profile annotation to exclude
-// // them
-// @ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.openecomp.portalsdk.core.controller.LogoutController*"),
-// @ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.openecomp.portalsdk.core.controller.SDKLoginController*"),
-// @ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.openecomp.portalapp.conf.ExternalAppConfig*"),
-// @ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.openecomp.*.*InitUebHandler*") })
-//@Profile("test")
-//class MockAppConfig extends AppConfig {
-//
-// @Bean
-// HibernateMappingLocatable locatable() {
-// return new MockHibernateMappingLocations();
-// }
-//
-// @Bean
-// HibernateConfiguration hibConfiguration() {
-// return new HibernateConfiguration();
-// }
-//
-// @Bean
-// public SystemProperties systemProperties() {
-// return new MockSystemProperties();
-// }
-//
-// @Bean
-// public AbstractCacheManager cacheManager() {
-// return new CacheManager() {
-//
-// public void configure() throws IOException {
-//
-// }
-// };
-// }
-//
-// public String[] tileDefinitions() {
-// return new String[] { "classpath:/WEB-INF/fusion/defs/definitions.xml",
-// "classpath:/WEB-INF/defs/definitions.xml" };
-// }
-//
-// public void addInterceptors(InterceptorRegistry registry) {
-// // registry.addInterceptor(new
-// // SessionTimeoutInterceptor()).excludePathPatterns(getExcludeUrlPathsForSessionTimeout());
-// // registry.addInterceptor(resourceInterceptor());
-// }
-//
-// public static class MockSystemProperties extends SystemProperties {
-//
-// public MockSystemProperties() {
-// }
-//
-// }
-//
-//}
-//
-//@Profile("test")
-//class MockHibernateMappingLocations implements HibernateMappingLocatable {
-//
-// public Resource[] getMappingLocations() {
-// return new Resource[] { new ClassPathResource("WEB-INF/fusion/orm/Fusion.hbm.xml"),
-// new ClassPathResource("WEB-INF/fusion/orm/EP.hbm.xml"),
-// new ClassPathResource("WEB-INF/fusion/orm/Workflow.hbm.xml") };
-//
-// }
-//
-// public String[] getPackagesToScan() {
-// return new String[] { "org.openecomp", "src" };
-// }
-//
-//}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.framework;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.listener;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.lm;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.lm;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.model;
import static org.junit.Assert.*;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.model;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.model;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.model;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.service;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.service;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.service;
import static org.junit.Assert.*;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.service;
import static org.junit.Assert.*;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.service;
import static org.junit.Assert.*;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.service;
import static org.junit.Assert.assertEquals;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
+++ /dev/null
-///*-
-// * ================================================================================
-// * ECOMP Portal
-// * ================================================================================
-// * Copyright (C) 2017 AT&T Intellectual Property
-// * ================================================================================
-// * 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.
-// * See the License for the specific language governing permissions and
-// * limitations under the License.
-// * ================================================================================
-// */
-//package org.openecomp.portalapp.portal.test.service;
-//
-//import static org.junit.Assert.assertTrue;
-//
-//import java.util.ArrayList;
-//import java.util.HashMap;
-//import java.util.List;
-//import java.util.Map;
-//
-//import org.junit.Test;
-//import org.openecomp.portalapp.portal.service.FunctionalMenuService;
-//import org.openecomp.portalapp.portal.transport.BusinessCardApplicationRole;
-//import org.openecomp.portalapp.portal.transport.FunctionalMenuRole;
-//import org.openecomp.portalapp.test.framework.ApplicationCommonContextTestSuite;
-//import org.springframework.beans.factory.annotation.Autowired;
-//
-//public class FunctionalMenuServiceImplTest extends ApplicationCommonContextTestSuite {
-//
-// @Autowired
-// FunctionalMenuService functionalMenuService;
-//
-// @Test
-// public void getAppListTestService() throws Exception {
-//
-// String userId = "guestT";
-// List<BusinessCardApplicationRole> userAppRolesActualResult = null;
-//
-// List<BusinessCardApplicationRole> userAppRolesExpectedResult = new ArrayList<BusinessCardApplicationRole>();
-// BusinessCardApplicationRole businessCardApplicationRole = new BusinessCardApplicationRole();
-// businessCardApplicationRole.setAppName("ECOMP Portal");
-// businessCardApplicationRole.setRoleName("System Administrator");
-// userAppRolesExpectedResult.add(businessCardApplicationRole);
-// Map<String, String> params = new HashMap<String, String>();
-// params.put("userId", userId);
-// userAppRolesActualResult = functionalMenuService.getUserAppRolesList(userId);
-// assertTrue(userAppRolesActualResult.contains(businessCardApplicationRole));
-//
-// }
-//
-// @Test
-// public void getFunctionalMenuRoleTest() throws Exception {
-//
-// FunctionalMenuRole expectedFunctionalMenuRole = new FunctionalMenuRole();
-// expectedFunctionalMenuRole.setId(new Integer(-1));
-//
-// expectedFunctionalMenuRole.setMenuId((long) 137);
-// expectedFunctionalMenuRole.setAppId(new Integer(456));
-// expectedFunctionalMenuRole.setRoleId(new Integer(6214));
-// List<FunctionalMenuRole> actualFunctionalMenuRoleList = null;
-// actualFunctionalMenuRoleList = functionalMenuService.getFunctionalMenuRole();
-// assertTrue(actualFunctionalMenuRoleList.contains(expectedFunctionalMenuRole));
-//
-// }
-//}
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.service;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.service;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.service;
import static org.junit.Assert.assertTrue;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.service;
import java.util.ArrayList;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.*;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.*;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import org.junit.Test;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.*;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.*;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.*;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.*;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
-import static org.junit.Assert.*;
-
-import java.util.Date;
-import java.util.SortedSet;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.CentralRoleFunction;
-import org.openecomp.portalapp.portal.transport.CentralRole;
public class CentralRoleTest {
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.*;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.*;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.assertEquals;
-import java.util.Date;
-
import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.EpNotificationItemVO;
public class EpNotificationItemVOTest {
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.*;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.*;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import java.util.ArrayList;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.*;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.*;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.*;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.transport;
import static org.junit.Assert.assertEquals;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.utils;
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
- <groupId>org.onap.portal</groupId>
+ <parent>
+ <groupId>org.onap.portal</groupId>
+ <artifactId>onap-portal-parent</artifactId>
+ <version>1.3.0-SNAPSHOT</version>
+ </parent>
+
<artifactId>ecompportal-be-os</artifactId>
<packaging>war</packaging>
- <version>1.1</version>
<properties>
- <portal.version>1.3.0-SNAPSHOT</portal.version>
- <epsdk.version>1.3.0</epsdk.version>
- <!-- Jenkins SHOULD invoke mvn with argument -Dbuild.number=${BUILD_NUMBER} -->
- <build.number>0</build.number>
- <springframework.version>4.2.0.RELEASE</springframework.version>
- <hibernate.version>4.3.11.Final</hibernate.version>
- <eelf.version>1.0.0</eelf.version>
- <encoding>UTF-8</encoding>
- <!-- If skipTests is false use this command to generate the report:
- mvn clean jacoco:prepare-agent install jacoco:report -->
+ <!-- If skipTests is false use this command to generate the report: mvn
+ clean jacoco:prepare-agent install jacoco:report -->
<skipTests>false</skipTests>
- <skipCoverage>false</skipCoverage>
- <jacoco.data.file>${project.build.directory}/coverage-reports/jacoco-ut.exec</jacoco.data.file>
- <sonar-jacoco-listeners.version>3.8</sonar-jacoco-listeners.version>
- <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
- <sonar.jacoco.reportPath>${project.build.directory}/code-coverage/jacoco.exec</sonar.jacoco.reportPath>
- <sonar.jacoco.itReportPath>${project.build.directory}/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath>
- <!-- Note: This list should match jacoco-maven-plugin's exclusion list below -->
- <sonar.exclusions>**.js</sonar.exclusions>
- <nexusproxy>https://nexus.onap.org</nexusproxy>
- <snapshotNexusPath>content/repositories/snapshots/</snapshotNexusPath>
- <stagingNexusPath>content/repositories/staging/</stagingNexusPath>
- <releaseNexusPath>content/repositories/releases/</releaseNexusPath>
</properties>
- <repositories>
- <repository>
- <id>onap-releases</id>
- <name>ONAP - Release Repository</name>
- <url>${nexusproxy}/${releaseNexusPath}</url>
- </repository>
- <repository>
- <id>onap-staging</id>
- <name>ONAP - Staging Repository</name>
- <url>${nexusproxy}/${stagingNexusPath}</url>
- </repository>
- <repository>
- <id>onap-snapshots</id>
- <name>ONAP - Snapshot Repository</name>
- <url>${nexusproxy}/${snapshotNexusPath}</url>
- </repository>
- <repository>
- <id>onap-public</id>
- <url>${nexusproxy}/content/groups/public</url>
- </repository>
- </repositories>
-
<build>
<sourceDirectory>src/main/java</sourceDirectory>
<!-- The war file name carries no version number -->
</dependencies>
</plugin>
<plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.1</version>
- <configuration>
- <source>1.8</source>
- <target>1.8</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.jacoco</groupId>
- <artifactId>jacoco-maven-plugin</artifactId>
- <version>0.7.6.201602180812</version>
- <executions>
- <execution>
- <id>prepare-agent</id>
- <goals>
- <goal>prepare-agent</goal>
- </goals>
- <phase>test</phase>
- <configuration>
- <destFile>${sonar.jacoco.reportPath}</destFile>
- <skip>${skipCoverage}</skip>
- </configuration>
- </execution>
- <execution>
- <id>report</id>
- <goals>
- <goal>report</goal>
- </goals>
- <phase>test</phase>
- <configuration>
- <dataFile>${sonar.jacoco.reportPath}</dataFile>
- <outputDirectory>${project.basedir}/target/site/jacoco</outputDirectory>
- <skip>${skipCoverage}</skip>
- </configuration>
- </execution>
- <!-- Integration Tests (Only report goal) -->
- <execution>
- <id>report-integration</id>
- <goals>
- <goal>report-integration</goal>
- </goals>
- <configuration>
- <dataFile>${sonar.jacoco.itReportPath}</dataFile>
- <outputDirectory>${project.basedir}/target/site/it-jacoco</outputDirectory>
- <skip>${skipCoverage}</skip>
- </configuration>
- </execution>
- <!-- Will see build errors while running the test cases because of dual
- instrumentation -->
- <execution>
- <id>default-instrument</id>
- <goals>
- <goal>instrument</goal>
- </goals>
- <configuration>
- <skip>${skipCoverage}</skip>
- </configuration>
- </execution>
- <execution>
- <id>default-restore-instrumented-classes</id>
- <goals>
- <goal>restore-instrumented-classes</goal>
- </goals>
- <configuration>
- <skip>${skipCoverage}</skip>
- </configuration>
- </execution>
- </executions>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <version>0.7.6.201602180812</version>
+ <inherited>True</inherited>
+ <executions>
+ <!-- Unit-Tests -->
+ <execution>
+ <id>prepare-agent</id>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ <configuration>
+ <skipTests>false</skipTests>
+ <destFile>${sonar.jacoco.reportPath}</destFile>
+ </configuration>
+ </execution>
+ <execution>
+ <id>default-instrument</id>
+ <goals>
+ <goal>instrument</goal>
+ </goals>
+ <configuration>
+ <skipTests>false</skipTests>
+ </configuration>
+ </execution>
+ <execution>
+ <id>default-restore-instrumented-classes</id>
+ <phase>test</phase>
+ <goals>
+ <goal>restore-instrumented-classes</goal>
+ </goals>
+ <configuration>
+ <skipTests>false</skipTests>
+ </configuration>
+ </execution>
+ <execution>
+ <id>post-unit-test</id>
+ <phase>test</phase>
+
+ <goals>
+ <goal>report</goal>
+ </goals>
+ <configuration>
+ <skipTests>false</skipTests>
+ <dataFile>${sonar.jacoco.reportPath}</dataFile>
+ <outputDirectory>${project.basedir}/target/site/jacoco</outputDirectory>
+ </configuration>
+ </execution>
+ <!-- Will see build errors while running the test cases because of dual
+ instrumentation -->
+
+ <!-- Integration Tests (Only report goal) -->
+ <execution>
+ <id>report-integration</id>
+ <phase>test</phase>
+ <goals>
+ <goal>report-integration</goal>
+ </goals>
+ <configuration>
+ <skipTests>false</skipTests>
+ <dataFile>${sonar.jacoco.itReportPath}</dataFile>
+ <outputDirectory>${project.basedir}/target/site/it-jacoco</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
</plugin>
-
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</manifestEntries>
</archive>
<overlays>
- <!-- specify the order in which these should be applied -->
+ <!-- specify the order in which these should be applied -->
<overlay>
<groupId>org.onap.portal</groupId>
<artifactId>ecompportal-be-common</artifactId>
<overlay>
<groupId>org.onap.portal.sdk</groupId>
<artifactId>epsdk-app-overlay</artifactId>
- </overlay>
+ </overlay>
</overlays>
</configuration>
</plugin>
</resources>
</configuration>
</execution>
-<!-- <execution> -->
-<!-- <id>copy-src</id> -->
-<!-- <phase>generate-resources</phase> -->
-<!-- <goals> -->
-<!-- <goal>copy-resources</goal> -->
-<!-- </goals> -->
-<!-- <configuration> -->
-<!-- <outputDirectory>${basedir}/target/classes</outputDirectory> -->
-<!-- <overwrite>false</overwrite> -->
-<!-- <skip>${skipTests}</skip> -->
-<!-- <resources> -->
-<!-- <resource> -->
-<!-- <directory>${basedir}/../ecomp-portal-BE-common/target/classes</directory> -->
-<!-- </resource> -->
-<!-- </resources> -->
-<!-- </configuration> -->
-<!-- </execution> -->
</executions>
</plugin>
</plugins>
</build>
<dependencies>
- <!--
- <dependency>
- <groupId>com.att.eelf</groupId>
- <artifactId>eelf-core</artifactId>
- <version>${eelf.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.powermock</groupId>
- <artifactId>powermock-module-junit4</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <version>2.5</version>
- </dependency>
- -->
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
</exclusion>
</exclusions>
</dependency>
-
<!-- Hibernate -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate.version}</version>
</dependency>
-
- <!-- jsr303 validation -->
- <!-- <dependency> <groupId>javax.validation</groupId> <artifactId>validation-api</artifactId>
- <version>1.1.0.Final</version> </dependency> -->
-
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<artifactId>cxf-rt-rs-client</artifactId>
<version>3.0.0-milestone1</version>
</dependency>
-
<!-- Mapper -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>classmate</artifactId>
<version>1.3.1</version>
</dependency>
-
<!-- Use Mariadb connector/j for failover -->
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>1.5.8</version>
</dependency>
-
<!-- Elastic Search -->
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>jest</artifactId>
<version>2.0.0</version>
</dependency>
-
<dependency>
<groupId>org.apache.jcs</groupId>
<artifactId>jcs</artifactId>
</exclusion>
</exclusions>
</dependency>
-
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-websocket</artifactId>
<version>8.0.28</version>
<scope>provided</scope>
</dependency>
-
<!-- Raptor required Libraries -->
<!-- for static charts -->
<dependency>
</exclusion>
</exclusions>
</dependency>
-
- <!-- <dependency> <groupId>com.lowagie</groupId> <artifactId>itext</artifactId>
- <version>2.0.8</version> <exclusions> <exclusion> <groupId>org.bouncycastle</groupId>
- <artifactId>bcprov-jdk14</artifactId> </exclusion> </exclusions> </dependency> -->
<!-- Quartz -->
<dependency>
<groupId>org.quartz-scheduler</groupId>
</exclusion>
</exclusions>
</dependency>
-
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.9</version>
</dependency>
-
<dependency>
<groupId>com.att.nsa</groupId>
<artifactId>cambriaClient</artifactId>
</exclusion>
</exclusions>
</dependency>
-
<!-- SDK overlay war -->
<dependency>
<groupId>org.onap.portal.sdk</groupId>
<version>${epsdk.version}</version>
<type>war</type>
</dependency>
-
<dependency>
<groupId>org.onap.portal.sdk</groupId>
<artifactId>epsdk-app-common</artifactId>
<version>${epsdk.version}</version>
<type>jar</type>
</dependency>
-
<!-- EcompPortal common overlay -->
<dependency>
<groupId>org.onap.portal</groupId>
<artifactId>ecompportal-be-common</artifactId>
- <version>${portal.version}</version>
+ <version>${project.version}</version>
<type>war</type>
</dependency>
-
<dependency>
<groupId>org.onap.portal</groupId>
<artifactId>ecompportal-be-common</artifactId>
- <version>${portal.version}</version>
+ <version>${project.version}</version>
<type>jar</type>
<classifier>classes</classifier>
</dependency>
-
<dependency>
<groupId>org.onap.portal.sdk</groupId>
<artifactId>epsdk-fw</artifactId>
</exclusion>
</exclusions>
</dependency>
-
<dependency>
<groupId>org.onap.portal.sdk</groupId>
<artifactId>epsdk-core</artifactId>
<version>${epsdk.version}</version>
</dependency>
-
<dependency>
<groupId>org.onap.portal.sdk</groupId>
<artifactId>epsdk-workflow</artifactId>
<version>${epsdk.version}</version>
</dependency>
-
<!-- Raptor required Libraries -->
<!-- for static charts -->
<dependency>
<artifactId>epsdk-analytics</artifactId>
<version>${epsdk.version}</version>
</dependency>
-
<!-- Referenced by some poms and needed for testing; do NOT use "test"
scope here. -->
<dependency>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
</dependency>
-
<!-- for testing -->
<dependency>
<groupId>junit</groupId>
<version>1.8.5</version>
<scope>test</scope>
</dependency>
- <dependency>
+ <dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.2</version>
</dependency>
-
-
-
<!-- OpenID Connect Dependencies -->
<dependency>
<groupId>org.mitre</groupId>
</exclusion>
</exclusions>
</dependency>
-
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
</exclusion>
</exclusions>
</dependency>
-
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<artifactId>aspectjweaver</artifactId>
<version>1.8.9</version>
</dependency>
-
</dependencies>
<reporting>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
- <version>2.10.4</version>
+ <version>3.0.0-M1</version>
<configuration>
<failOnError>false</failOnError>
<doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
<useStandardDocletOptions>true</useStandardDocletOptions>
</configuration>
</plugin>
-
+
</plugins>
</reporting>
- <distributionManagement>
- <site>
- <id>ecomp-site</id>
- <url>dav:${nexusproxy}/content/sites/site/org/onap/portal/${project.version}</url>
- </site>
- </distributionManagement>
-
</project>
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.authentication;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.authentication;
import org.openecomp.portalapp.command.EPLoginBean;
import org.openecomp.portalapp.portal.domain.EPUser;
import org.openecomp.portalapp.portal.utils.EPSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
import org.openecomp.portalapp.util.EPUserUtils;
import org.openecomp.portalapp.util.SessionCookieUtil;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
public class OpenIdConnectLoginStrategy extends org.openecomp.portalsdk.core.auth.LoginStrategy implements org.openecomp.portalapp.authentication.LoginStrategy {
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(OpenIdConnectLoginStrategy.class);
+ private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(OpenIdConnectLoginStrategy.class);
private static final String GLOBAL_LOCATION_KEY = "Location";
return true;
} else {
// in case authentication cookie is missing, send 401 UNAUTHORIZED to client and it will redirect to Logon
-
try {
String authentication = SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM);
String loginUrl = SystemProperties.getProperty(EPSystemProperties.LOGIN_URL_NO_RET_VAL);
response.setHeader(GLOBAL_LOCATION_KEY, loginUrl);
}
} catch(Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred in preHandle() while redirecting, Details: " + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "login failed", e);
}
}
return false;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.authentication;
import org.openecomp.portalapp.command.EPLoginBean;
import org.openecomp.portalapp.portal.service.EPLoginService;
import org.openecomp.portalapp.portal.service.EPRoleFunctionService;
-import org.openecomp.portalapp.portal.service.EPRoleService;
import org.openecomp.portalapp.portal.utils.EPSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
import org.openecomp.portalapp.util.EPUserUtils;
import org.openecomp.portalapp.util.SessionCookieUtil;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.openecomp.portalsdk.core.menu.MenuProperties;
import org.openecomp.portalsdk.core.onboarding.exception.PortalAPIException;
-import org.openecomp.portalsdk.core.onboarding.util.*;
import org.openecomp.portalsdk.core.util.SystemProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
@Autowired
private EPLoginService loginService;
- @Autowired
- private EPRoleService roleService;
@Autowired
private EPRoleFunctionService ePRoleFunctionService;
response.setHeader(GLOBAL_LOCATION_KEY, loginUrl); //returnUrl + "/index.htm");
}
} catch(Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred in preHandle() while redirecting, Details: " + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "login failed", e);
}
}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.conf;
MDC.put(MDC_ALERT_SEVERITY, AlarmSeverityEnum.INFORMATIONAL.toString());
MDC.put(MDC_INSTANCE_UUID, SystemProperties.getProperty(SystemProperties.INSTANCE_UUID));
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "init failed", e);
}
}
try {
cronSiteVal = SystemProperties.getProperty(CRON_SITE_NAME);
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "getScheduleName failed", e);
logger.warn(EELFLoggerDelegate.errorLogger,
"Cron site name not added in property file, using Default value");
}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.conf;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.conf;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.controller;
import org.openecomp.portalapp.portal.domain.SharedContext;
import org.openecomp.portalapp.portal.service.EPLoginService;
import org.openecomp.portalapp.portal.service.EPRoleFunctionService;
-import org.openecomp.portalapp.portal.service.EPRoleService;
import org.openecomp.portalapp.portal.service.SharedContextService;
import org.openecomp.portalapp.portal.utils.EPSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.service.EPProfileService;
import org.openecomp.portalapp.util.EPUserUtils;
import org.openecomp.portalapp.util.SessionCookieUtil;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.openecomp.portalsdk.core.menu.MenuProperties;
-import org.openecomp.portalsdk.core.onboarding.listener.PortalTimeoutHandler;
import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.portalsdk.core.web.support.AppUtils;
import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@Controller
@RequestMapping("/")
-public class LoginController extends EPUnRestrictedBaseController implements LoginService{
-
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(LoginController.class);
-
+public class LoginController extends EPUnRestrictedBaseController implements LoginService {
+
+ private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(LoginController.class);
+
public static final String DEFAULT_SUCCESS_VIEW = "applicationsHome";
public static final String DEFAULT_FAILURE_VIEW = "login";
- public static final String ERROR_MESSAGE_KEY = "error";
+ public static final String ERROR_MESSAGE_KEY = "error";
public static final String REDIRECT_URL = "redirectUrl";
-
- @Autowired
- EPProfileService service;
+ public static final String REDIRECT_COLON = "redirect:";
+
@Autowired
private EPLoginService loginService;
@Autowired
private SharedContextService sharedContextService;
-
- @Autowired
- private EPRoleService roleService;
-
@Autowired
private EPRoleFunctionService ePRoleFunctionService;
-
- String viewName = "login";
- private String welcomeView;
- public String getWelcomeView() {
- return welcomeView;
- }
+ private String viewName = "login";
+
+ private String welcomeView;
- public void setWelcomeView(String welcomeView) {
- this.welcomeView = welcomeView;
- }
-
- @RequestMapping(value = {"/login.htm" }, method = RequestMethod.GET)
+ @RequestMapping(value = { "/login.htm" }, method = RequestMethod.GET)
public ModelAndView login(HttpServletRequest request) {
Map<String, Object> model = new HashMap<String, Object>();
-
String authentication = SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM);
-
String loginPage;
-
- if (authentication == null || authentication.equals("") || authentication.trim().equals("OIDC"))
+ if (authentication == null || "".equals(authentication) || "OICD".equals(authentication.trim()))
loginPage = "openIdLogin";
else
- loginPage = getViewName();
-
- return new ModelAndView(loginPage,"model", model);
+ loginPage = getViewName();
+ return new ModelAndView(loginPage, "model", model);
}
-
+
@SuppressWarnings("rawtypes")
- @RequestMapping(value = {"/open_source/login" }, method = RequestMethod.POST)
- public @ResponseBody String loginValidate(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
+ @RequestMapping(value = { "/open_source/login" }, method = RequestMethod.POST)
+ @ResponseBody
+ public String loginValidate(HttpServletRequest request, HttpServletResponse response) throws Exception {
+
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
JsonNode root = mapper.readTree(request.getReader());
-
- EPLoginBean commandBean = new EPLoginBean();
- String loginId = root.get("loginId").textValue();
- String password = root.get("password").textValue();
- commandBean.setLoginId(loginId);
- commandBean.setLoginPwd(CipherUtil.encrypt(password));
- HashMap additionalParamsMap = new HashMap();
- StringBuilder sbAdditionalInfo = new StringBuilder();
-
- commandBean = getLoginService().findUser(commandBean, (String)request.getAttribute(MenuProperties.MENU_PROPERTIES_FILENAME_KEY),
- additionalParamsMap);
- String fullURL = getFullURL(request);
- if (commandBean.getUser() == null) {
- String loginErrorMessage = (commandBean.getLoginErrorMessage() != null) ? commandBean.getLoginErrorMessage()
- : "login.error.external.invalid";
-
- logger.info(EELFLoggerDelegate.debugLogger, "loginId = " + loginId + " does not exist in the the DB.");
- logger.info(EELFLoggerDelegate.errorLogger, "loginId = " + loginId + " does not exist in the the DB.");
- sbAdditionalInfo.append(String.format("But the Login-Id: %s doesn't exist in the Database. Request-URL: %s",
+
+ EPLoginBean commandBean = new EPLoginBean();
+ String loginId = root.get("loginId").textValue();
+ String password = root.get("password").textValue();
+ commandBean.setLoginId(loginId);
+ commandBean.setLoginPwd(CipherUtil.encrypt(password));
+ HashMap additionalParamsMap = new HashMap();
+ StringBuilder sbAdditionalInfo = new StringBuilder();
+
+ commandBean = getLoginService().findUser(commandBean,
+ (String) request.getAttribute(MenuProperties.MENU_PROPERTIES_FILENAME_KEY), additionalParamsMap);
+ String fullURL = getFullURL(request);
+ if (commandBean.getUser() == null) {
+ String loginErrorMessage = (commandBean.getLoginErrorMessage() != null) ? commandBean.getLoginErrorMessage()
+ : "login.error.external.invalid";
+ logger.info(EELFLoggerDelegate.debugLogger, "loginId {} does not exist in the the DB.", loginId);
+ sbAdditionalInfo.append(String.format("But the Login-Id: %s doesn't exist in the Database. Request-URL: %s",
loginId, fullURL));
return loginErrorMessage;
- }
- else {
- // store the currently logged in user's information in the session
- EPUserUtils.setUserSession(request, commandBean.getUser(), commandBean.getMenu(), commandBean.getBusinessDirectMenu(), SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM),ePRoleFunctionService);
-
- try{
- logger.info(EELFLoggerDelegate.debugLogger, "******************* store user info into share context begins");
- String sessionId = request.getSession().getId();
- List<SharedContext> existingSC = getSharedContextService().getSharedContexts(sessionId);
- if(existingSC==null || existingSC.size()==0){
- getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_FIRST_NAME, commandBean.getUser().getFirstName());
- getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_LAST_NAME, commandBean.getUser().getLastName());
- getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_EMAIL, commandBean.getUser().getEmail());
- getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_ORG_USERID, commandBean.getLoginId());
- }
-
- }catch(Exception e){
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
- logger.info(EELFLoggerDelegate.errorLogger, "failed the shared context adding process " + e.getMessage());
- logger.info(EELFLoggerDelegate.debugLogger, "********************** failed the shared context adding process " + e.getMessage());
- }
- logger.info(EELFLoggerDelegate.debugLogger, "********************* PresetUp the EP service cookie and intial sessionManagement");
-
- SessionCookieUtil.preSetUp(request, response);
- SessionCookieUtil.setUpUserIdCookie(request, response, loginId);
-
- JSONObject j = new JSONObject("{success: success}");
-
- return j.toString();
-
- }
-
+ } else {
+ // store the currently logged in user's information in the session
+ EPUserUtils.setUserSession(request, commandBean.getUser(), commandBean.getMenu(),
+ commandBean.getBusinessDirectMenu(),
+ SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM), ePRoleFunctionService);
+
+ try {
+ logger.info(EELFLoggerDelegate.debugLogger, "loginValidate: store user info into share context begins");
+ String sessionId = request.getSession().getId();
+ List<SharedContext> existingSC = getSharedContextService().getSharedContexts(sessionId);
+ if (existingSC == null || existingSC.isEmpty()) {
+ getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_FIRST_NAME,
+ commandBean.getUser().getFirstName());
+ getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_LAST_NAME,
+ commandBean.getUser().getLastName());
+ getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_EMAIL,
+ commandBean.getUser().getEmail());
+ getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_ORG_USERID,
+ commandBean.getLoginId());
+ }
+
+ } catch (Exception e) {
+ logger.info(EELFLoggerDelegate.errorLogger, "loginValidate: failed the shared context adding process ",
+ e);
+ }
+ logger.info(EELFLoggerDelegate.debugLogger,
+ "loginValidate: PresetUp the EP service cookie and intial sessionManagement");
+
+ SessionCookieUtil.preSetUp(request, response);
+ SessionCookieUtil.setUpUserIdCookie(request, response, loginId);
+
+ JSONObject j = new JSONObject("{success: success}");
+
+ return j.toString();
+ }
}
-
- /* Work around a bug in ecompsdkos version 1.1.0 which hard-codes this endpoint. */
- @RequestMapping(value = {"/process_csp" }, method = RequestMethod.GET)
+
+ /*
+ * Work around a bug in ecompsdkos version 1.1.0 which hard-codes this endpoint.
+ */
+ @RequestMapping(value = { "/process_csp" }, method = RequestMethod.GET)
public ModelAndView processCsp(HttpServletRequest request, HttpServletResponse response) throws Exception {
return processSingleSignOn(request, response);
}
- /* Remove this method after epsdk-app-common/.../SingleSignOnController.java is repaired. */
+ /*
+ * Remove this method after epsdk-app-common/.../SingleSignOnController.java is
+ * repaired.
+ */
+
+ @RequestMapping(value = { "/processSingleSignOn" }, method = RequestMethod.GET)
+ public ModelAndView processSingleSignOn(HttpServletRequest request, HttpServletResponse response) throws Exception {
- @RequestMapping(value = {"/processSingleSignOn" }, method = RequestMethod.GET)
- public ModelAndView processSingleSignOn(HttpServletRequest request, HttpServletResponse response) throws Exception{
-
- Map<Object, Object> model = new HashMap<Object, Object>();
+ Map<Object, Object> model = new HashMap<Object, Object>();
HashMap<Object, Object> additionalParamsMap = new HashMap<Object, Object>();
EPLoginBean commandBean = new EPLoginBean();
MDC.put(MDC_KEY_REQUEST_ID, getRequestId(request));
- String orgUserId = "";
- //get userId from cookie
- orgUserId = SessionCookieUtil.getUserIdFromCookie(request, response);
- logger.info(EELFLoggerDelegate.debugLogger, "******************** process_singelSignOn process begins");
- logger.info(EELFLoggerDelegate.debugLogger, "******************* We get the orgUserId " + orgUserId);
+ // get userId from cookie
+ String orgUserId = SessionCookieUtil.getUserIdFromCookie(request, response);
+ logger.info(EELFLoggerDelegate.debugLogger, "processSingleSignOn: begins with orgUserId {}", orgUserId);
StringBuilder sbAdditionalInfo = new StringBuilder();
- if ((orgUserId == null || orgUserId.length() == 0)) {
+ if (orgUserId == null || orgUserId.length() == 0) {
model.put(ERROR_MESSAGE_KEY, SystemProperties.MESSAGE_KEY_LOGIN_ERROR_COOKIE_EMPTY);
- if(request.getParameter("redirectUrl")!=null && request.getParameter("redirectUrl").length()!=0){
- return new ModelAndView("redirect:" + DEFAULT_FAILURE_VIEW + ".htm" + "?redirectUrl=" + request.getParameter("redirectUrl"));
- }else{
- return new ModelAndView("redirect:" + DEFAULT_FAILURE_VIEW + ".htm");
+ if (request.getParameter(REDIRECT_URL) != null && request.getParameter(REDIRECT_URL).length() != 0) {
+ return new ModelAndView(REDIRECT_COLON + DEFAULT_FAILURE_VIEW + ".htm" + "?redirectUrl="
+ + request.getParameter(REDIRECT_URL));
+ } else {
+ return new ModelAndView(REDIRECT_COLON + DEFAULT_FAILURE_VIEW + ".htm");
}
- }
- else {
-
+ } else {
+
StopWatch stopWatch = new StopWatch("LoginController.Login");
stopWatch.start();
-
+
try {
- logger.info(EELFLoggerDelegate.metricsLogger, "Operation findUser is started to locate " + orgUserId + " in the database.");
- logger.info(EELFLoggerDelegate.debugLogger, "Operation findUser is started to locate " + orgUserId + " in the database.");
+ logger.info(EELFLoggerDelegate.debugLogger,
+ "Operation findUser is started to locate user {} in the database.", orgUserId);
commandBean.setLoginId(orgUserId);
commandBean.setOrgUserId(orgUserId);
- commandBean = getLoginService().findUser(commandBean, (String)request.getAttribute(MenuProperties.MENU_PROPERTIES_FILENAME_KEY), additionalParamsMap);
-
+ commandBean = getLoginService().findUser(commandBean,
+ (String) request.getAttribute(MenuProperties.MENU_PROPERTIES_FILENAME_KEY),
+ additionalParamsMap);
+
stopWatch.stop();
MDC.put(EPSystemProperties.MDC_TIMER, stopWatch.getTotalTimeMillis() + "ms");
- logger.info(EELFLoggerDelegate.metricsLogger, "Operation findUser is completed.");
logger.info(EELFLoggerDelegate.debugLogger, "Operation findUser is completed.");
- } catch(Exception e) {
+ } catch (Exception e) {
stopWatch.stop();
MDC.put(EPSystemProperties.MDC_TIMER, stopWatch.getTotalTimeMillis() + "ms");
- logger.info(EELFLoggerDelegate.errorLogger, "Exception occurred while performing findUser " + orgUserId + ". Details: " + EcompPortalUtils.getStackTrace(e));
- logger.info(EELFLoggerDelegate.debugLogger, "Exception occurred while performing findUser " + orgUserId + ". Details: " + EcompPortalUtils.getStackTrace(e));
- logger.info(EELFLoggerDelegate.metricsLogger, "Operation findUser is failed.");
+ logger.info(EELFLoggerDelegate.errorLogger, "processSingleSignOn failed on user " + orgUserId, e);
} finally {
MDC.remove(EPSystemProperties.MDC_TIMER);
}
-
+
sbAdditionalInfo.append("Login attempt is succeeded. ");
String fullURL = getFullURL(request);
if (commandBean.getUser() == null) {
- logger.info(EELFLoggerDelegate.debugLogger, "loginId = " + orgUserId + " does not exist in the the DB.");
- logger.info(EELFLoggerDelegate.errorLogger, "loginId = " + orgUserId + " does not exist in the the DB.");
- logger.info(EELFLoggerDelegate.debugLogger, "loginId = " + orgUserId + " does not exist in the the DB.");
+ logger.info(EELFLoggerDelegate.debugLogger,
+ "processSingleSignOn: loginId {} does not exist in the the DB.", orgUserId);
- sbAdditionalInfo.append(String.format("But the Login-Id: %s doesn't exist in the Database. Created a Guest Session. Request-URL: %s",
+ sbAdditionalInfo.append(String.format(
+ "But the Login-Id: %s doesn't exist in the Database. Created a Guest Session. Request-URL: %s",
orgUserId, fullURL));
- if(request.getParameter("redirectUrl")!=null && request.getParameter("redirectUrl").length()!=0){
- return new ModelAndView("redirect:" + DEFAULT_FAILURE_VIEW + ".htm" + "?redirectUrl=" + request.getParameter("redirectUrl"));
- }else{
- return new ModelAndView("redirect:" + DEFAULT_FAILURE_VIEW + ".htm");
+ if (request.getParameter(REDIRECT_URL) != null && request.getParameter(REDIRECT_URL).length() != 0) {
+ return new ModelAndView(REDIRECT_COLON + DEFAULT_FAILURE_VIEW + ".htm" + "?redirectUrl="
+ + request.getParameter(REDIRECT_URL));
+ } else {
+ return new ModelAndView(REDIRECT_COLON + DEFAULT_FAILURE_VIEW + ".htm");
+ }
+ } else {
+
+ sbAdditionalInfo.append(
+ String.format("Login-Id: %s, Login-Method: %s, Request-URL: %s", orgUserId, "", fullURL));
+ logger.info(EELFLoggerDelegate.debugLogger, "processSingleSignOn: now set up user session for {}",
+ orgUserId);
+
+ EPUserUtils.setUserSession(request, commandBean.getUser(), commandBean.getMenu(),
+ commandBean.getBusinessDirectMenu(),
+ SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM), ePRoleFunctionService);
+ logger.info(EELFLoggerDelegate.debugLogger,
+ "processSingleSignOn: now set up user session for {} finished", orgUserId);
+
+ // Store user's information into share context
+ try {
+ logger.info(EELFLoggerDelegate.debugLogger,
+ "processSingleSignOn: store user info into share context begins");
+ String sessionId = request.getSession().getId();
+ List<SharedContext> existingSC = getSharedContextService().getSharedContexts(sessionId);
+ if (existingSC == null || existingSC.isEmpty()) {
+ getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_FIRST_NAME,
+ commandBean.getUser().getFirstName());
+ getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_LAST_NAME,
+ commandBean.getUser().getLastName());
+ getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_EMAIL,
+ commandBean.getUser().getEmail());
+ getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_ORG_USERID,
+ commandBean.getLoginId());
+ }
+ } catch (Exception e) {
+ logger.info(EELFLoggerDelegate.errorLogger,
+ "processSingleSignOn: failed the shared context adding process", e);
+ }
+
+ logger.info(EELFLoggerDelegate.debugLogger,
+ "processSingleSignOn: PresetUp the EP service cookie and intial sessionManagement");
+ SessionCookieUtil.preSetUp(request, response);
+ SessionCookieUtil.setUpUserIdCookie(request, response, orgUserId);
+ logger.info(EELFLoggerDelegate.debugLogger,
+ "processSingleSignOn: PresetUp the EP service cookie and intial sessionManagement completed");
+ logger.info(EELFLoggerDelegate.debugLogger,
+ commandBean.getUser().getOrgUserId() + " exists in the the system.");
+
+ // get redirectUrl from URL parameter
+ if (request.getParameter(REDIRECT_URL) != null && request.getParameter(REDIRECT_URL).length() != 0) {
+ String forwardUrl = URLDecoder.decode(request.getParameter(REDIRECT_URL), "UTF-8");
+ // clean cookie
+ Cookie cookie2 = new Cookie(REDIRECT_URL, "");
+ // ONAP does not use https
+ cookie2.setSecure(false);
+ cookie2.setMaxAge(0);
+ cookie2.setDomain(EPSystemProperties.getProperty(EPSystemProperties.COOKIE_DOMAIN));
+ cookie2.setPath("/");
+ response.addCookie(cookie2);
+ return new ModelAndView(REDIRECT_COLON + forwardUrl);
+ }
+
+ // first check if redirectUrl exists or not
+ if (WebUtils.getCookie(request, REDIRECT_URL) != null) {
+ String forwardUrl = WebUtils.getCookie(request, REDIRECT_URL).getValue();
+ // clean cookie
+ Cookie cookie2 = new Cookie(REDIRECT_URL, "");
+ // ONAP does not use https
+ cookie2.setSecure(false);
+ cookie2.setMaxAge(0);
+ cookie2.setDomain(EPSystemProperties.getProperty(EPSystemProperties.COOKIE_DOMAIN));
+ cookie2.setPath("/");
+ response.addCookie(cookie2);
+
+ return new ModelAndView(REDIRECT_COLON + forwardUrl);
}
- }
- else {
-
- sbAdditionalInfo.append(String.format("Login-Id: %s, Login-Method: %s, Request-URL: %s", orgUserId, "", fullURL));
- logger.info(EELFLoggerDelegate.debugLogger, "*********************** now set up user session for " + orgUserId);
-
- EPUserUtils.setUserSession(request, commandBean.getUser(), commandBean.getMenu(), commandBean.getBusinessDirectMenu(), SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM),ePRoleFunctionService);
- logger.info(EELFLoggerDelegate.debugLogger, "*********************** now set up user session for " + orgUserId + " finished");
-
- //Store user's information into share context
- try{
- logger.info(EELFLoggerDelegate.debugLogger, "******************* store user info into share context begins");
-
- String sessionId = request.getSession().getId();
- List<SharedContext> existingSC = getSharedContextService().getSharedContexts(sessionId);
- if(existingSC==null || existingSC.size()==0){
- getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_FIRST_NAME, commandBean.getUser().getFirstName());
- getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_LAST_NAME, commandBean.getUser().getLastName());
- getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_EMAIL, commandBean.getUser().getEmail());
- getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_ORG_USERID, commandBean.getLoginId());
- }
-
- }catch(Exception e){
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
- logger.info(EELFLoggerDelegate.errorLogger, "failed the shared context adding process " + e.getMessage());
- logger.info(EELFLoggerDelegate.debugLogger, "********************** failed the shared context adding process " + e.getMessage());
-
- }
-
- logger.info(EELFLoggerDelegate.debugLogger, "********************* PresetUp the EP service cookie and intial sessionManagement");
-
- SessionCookieUtil.preSetUp(request, response);
- SessionCookieUtil.setUpUserIdCookie(request, response, orgUserId);
- logger.info(EELFLoggerDelegate.debugLogger, "********************* PresetUp the EP service cookie and intial sessionManagement completed");
- logger.info(EELFLoggerDelegate.errorLogger, commandBean.getUser().getOrgUserId() + " exists in the the system.");
- logger.info(EELFLoggerDelegate.debugLogger, commandBean.getUser().getOrgUserId() + " exists in the the system.");
-
- String redirect = "redirectUrl";
-
- //get redirectUrl from URL parameter
- if(request.getParameter(redirect)!=null && request.getParameter(redirect).length()!=0){
- String forwardUrl = URLDecoder.decode(request.getParameter(redirect),"UTF-8");
- //clean cookie
- Cookie cookie2 = new Cookie(redirect, "");
- cookie2.setMaxAge(0);
- cookie2.setDomain(EPSystemProperties.getProperty(EPSystemProperties.COOKIE_DOMAIN));
- cookie2.setPath("/");
- response.addCookie(cookie2);
- return new ModelAndView("redirect:" + forwardUrl);
- }
-
- //first check if redirectUrl exists or not
- if(WebUtils.getCookie(request, redirect)!=null){
- String forwardUrl = WebUtils.getCookie(request, redirect).getValue();
- //clean cookie
- Cookie cookie2 = new Cookie(redirect, "");
- cookie2.setMaxAge(0);
- cookie2.setDomain(EPSystemProperties.getProperty(EPSystemProperties.COOKIE_DOMAIN));
- cookie2.setPath("/");
- response.addCookie(cookie2);
-
- return new ModelAndView("redirect:" + forwardUrl);
- }
}
}
-
+
// if user has been authenticated, now take them to the welcome page.
- //return new ModelAndView("redirect:" + DEFAULT_SUCCESS_VIEW + ".htm");
- logger.info(EELFLoggerDelegate.debugLogger, "********************** Now return to application home page");
-
- return new ModelAndView("redirect:" + SystemProperties.getProperty(EPSystemProperties.FE_URL));
-
- //
- // Re-enable for BE/FE separation. For 1607, at last minute we decided to go out
- // without BE/FE separation.
- //
- //return new ModelAndView("redirect:" + SystemProperties.getProperty(EPSystemProperties.FE_URL));
-
+ logger.info(EELFLoggerDelegate.debugLogger, "processSingleSignOn: Now return to application home page");
+ return new ModelAndView(REDIRECT_COLON + SystemProperties.getProperty(EPSystemProperties.FE_URL));
}
-
- public String getFullURL(HttpServletRequest request) {
+
+ private String getFullURL(HttpServletRequest request) {
if (request != null) {
- StringBuffer requestURL = request.getRequestURL();
+ String requestURL = request.getRequestURL().toString();
String queryString = request.getQueryString();
-
if (queryString == null) {
- return requestURL.toString();
+ return requestURL;
} else {
- return requestURL.append('?').append(queryString).toString();
+ return requestURL + "?" + queryString;
}
}
return "";
}
-
- public String getRequestId(HttpServletRequest request) {
- Enumeration<String> headerNames = request.getHeaderNames();
+ private String getRequestId(HttpServletRequest request) {
+ Enumeration<String> headerNames = request.getHeaderNames();
String requestId = "";
- try {
- while (headerNames.hasMoreElements()) {
- String headerName = (String) headerNames.nextElement();
- logger.debug(EELFLoggerDelegate.debugLogger,
- "One header is " + headerName + " : " + request.getHeader(headerName));
- if (headerName.equalsIgnoreCase(SystemProperties.ECOMP_REQUEST_ID)) {
- requestId = request.getHeader(headerName);
- break;
- }
+ while (headerNames.hasMoreElements()) {
+ String headerName = headerNames.nextElement();
+ logger.debug(EELFLoggerDelegate.debugLogger, "getRequestId: header {} has value {}", headerName,
+ request.getHeader(headerName));
+ if (headerName.equalsIgnoreCase(SystemProperties.ECOMP_REQUEST_ID)) {
+ requestId = request.getHeader(headerName);
+ break;
}
- } catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, "HEADER!!!! Exception : " + EcompPortalUtils.getStackTrace(e));
}
-
- return (requestId.isEmpty() ? UUID.randomUUID().toString() : requestId);
+ return requestId.isEmpty() ? UUID.randomUUID().toString() : requestId;
}
-
- public String getJessionId(HttpServletRequest request){
-
- return request.getSession().getId();
- /*
- Cookie ep = WebUtils.getCookie(request, JSESSIONID);
- if(ep==null){
- return request.getSession().getId();
- }
- return ep.getValue();
- */
+
+ public String getWelcomeView() {
+ return welcomeView;
}
-
-
- protected void initateSessionMgtHandler(HttpServletRequest request) {
- String jSessionId = getJessionId(request);
- PortalTimeoutHandler.sessionCreated(jSessionId, jSessionId, AppUtils.getSession(request));
+
+ public void setWelcomeView(String welcomeView) {
+ this.welcomeView = welcomeView;
}
-
+ @Override
public String getViewName() {
return viewName;
}
+
+ @Override
public void setViewName(String viewName) {
this.viewName = viewName;
}
+
public EPLoginService getLoginService() {
- return loginService;
- }
+ return loginService;
+ }
- public void setLoginService(EPLoginService loginService) {
- this.loginService = loginService;
- }
+ public void setLoginService(EPLoginService loginService) {
+ this.loginService = loginService;
+ }
public SharedContextService getSharedContextService() {
return sharedContextService;
public void setSharedContextService(SharedContextService sharedContextService) {
this.sharedContextService = sharedContextService;
}
-
-
}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.controller;
/*-
- * ================================================================================
- * ECOMP Portal SDK
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.interceptor;
resetSessionMaxIdleTimeOut(request);
CollaborateList.addUserName(user.getOrgUserId());
}
- } catch (Exception see) {
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(see));
- // return loginStrategy.login(request, response);
+ } catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "preHandle failed", e);
return false;
}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.logging.aop;
try {
result = joinPoint.proceed();
} catch(Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "logAroundMethod failed", e);
statusCode = "ERROR";
responseCode = "500"; //Internal server error
}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
@org.springframework.context.annotation.Configuration
@EnableAspectJAutoProxy
@EPAuditLog
-public class ApplicationsRestClientServiceImpl implements ApplicationsRestClientService{
-
+public class ApplicationsRestClientServiceImpl implements ApplicationsRestClientService {
+
private static final String PASSWORD_HEADER = "password";
private static final String APP_USERNAME_HEADER = "username";
private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ApplicationsRestClientServiceImpl.class);
-
+
@Autowired
private AppsCacheService appsCacheService;
Gson gson = null;
-
+
private final ObjectMapper mapper = new ObjectMapper();
-
+
@PostConstruct
- private void init(){
+ private void init() {
logger.debug(EELFLoggerDelegate.debugLogger, "initializing");
- GsonBuilder builder = new GsonBuilder();
+ GsonBuilder builder = new GsonBuilder();
- // Register an adapter to manage the date types as long values
- builder.registerTypeAdapter(Date.class, new JsonDeserializer<Date>() {
- public Date deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
- return new Date(json.getAsJsonPrimitive().getAsLong());
- }
+ // Register an adapter to manage the date types as long values
+ builder.registerTypeAdapter(Date.class, new JsonDeserializer<Date>() {
+ public Date deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
+ throws JsonParseException {
+ return new Date(json.getAsJsonPrimitive().getAsLong());
+ }
});
- gson = builder.create();
+ gson = builder.create();
}
-
+
// TODO: do we need to do additional logging for remote API calls?
private static WebClient createClientForPath(String baseUri, String path) {
- logger.info(EELFLoggerDelegate.debugLogger, "Creating web client for " + baseUri + " + " + path);
+ logger.info(EELFLoggerDelegate.debugLogger, "Creating web client for " + baseUri + " + " + path);
WebClient client = WebClient.create(baseUri);
client.type(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON);
client.path(path);
logger.debug(EELFLoggerDelegate.debugLogger, "http response status=" + status);
MDC.put(EPSystemProperties.EXTERNAL_API_RESPONSE_CODE, Integer.toString(status));
if (!isHttpSuccess(status)) {
- String errMsg = "Failed. Status=" + status + "; [" + response.getStatusInfo().getReasonPhrase().toString() + "]";
+ String errMsg = "Failed. Status=" + status + "; [" + response.getStatusInfo().getReasonPhrase().toString()
+ + "]";
URL url = null;
try {
// must not be null to avoid NPE in HTTPException constructor
throw new HTTPException(status, errMsg, url);
}
}
-
- private static boolean isHttpSuccess(int status){
+
+ private static boolean isHttpSuccess(int status) {
return status / 100 == 2;
}
@EPMetricsLog
private WebClient createClientForApp(long appId, String restPath) {
- logger.debug(EELFLoggerDelegate.debugLogger, "creating client for appId=" + appId + "; restPath=" + restPath);
+ logger.debug(EELFLoggerDelegate.debugLogger, "creating client for appId=" + appId + "; restPath=" + restPath);
EPApp externalApp = appsCacheService.getApp(appId);
- if(externalApp != null){
+ if (externalApp != null) {
String appBaseUri = externalApp.getAppRestEndpoint();
- String username = externalApp.getUsername();
+ String username = externalApp.getUsername();
String encriptedPwd = externalApp.getAppPassword();
String decreptedAppPwd = "";
-
- //Set local context
+
+ // Set local context
MDC.put(EPSystemProperties.PROTOCOL, EPSystemProperties.HTTP);
- if (appBaseUri!=null && appBaseUri.contains("https")) {
+ if (appBaseUri != null && appBaseUri.contains("https")) {
MDC.put(EPSystemProperties.PROTOCOL, EPSystemProperties.HTTPS);
}
MDC.put(EPSystemProperties.FULL_URL, appBaseUri + restPath);
MDC.put(EPSystemProperties.TARGET_ENTITY, externalApp.getName());
MDC.put(EPSystemProperties.TARGET_SERVICE_NAME, restPath);
-
+
try {
- decreptedAppPwd = CipherUtil.decrypt(encriptedPwd, SystemProperties.getProperty(SystemProperties.Decryption_Key));
- } catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, "Unable to decrypt App name = " + externalApp, EcompPortalUtils.getStackTrace(e));
- logger.error(EELFLoggerDelegate.errorLogger, "Unable to decrypt App name = " + externalApp, EcompPortalUtils.getStackTrace(e));
+ decreptedAppPwd = CipherUtil.decrypt(encriptedPwd,
+ SystemProperties.getProperty(SystemProperties.Decryption_Key));
+ } catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "createClientForApp failed to decrypt", e);
}
- logger.debug(EELFLoggerDelegate.debugLogger, String.format("App %d found, baseUri=[%s], Headers: [%s=%s, %s=%s]", appId, appBaseUri, APP_USERNAME_HEADER, username, PASSWORD_HEADER, encriptedPwd));
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ String.format("App %d found, baseUri=[%s], Headers: [%s=%s, %s=%s]", appId, appBaseUri,
+ APP_USERNAME_HEADER, username, PASSWORD_HEADER, encriptedPwd));
WebClient client = createClientForPath(appBaseUri, restPath);
client.header(APP_USERNAME_HEADER, username);
client.header(PASSWORD_HEADER, decreptedAppPwd);
client.header(SystemProperties.ECOMP_REQUEST_ID, MDC.get(MDC_KEY_REQUEST_ID));
client.header(SystemProperties.USERAGENT_NAME, EPSystemProperties.ECOMP_PORTAL_BE);
-
+
return client;
}
return null;
}
-
+
@Override
public <T> T get(Class<T> clazz, long appId, String restPath) throws HTTPException {
-
+
WebClient webClient = null;
Response response = null;
T t = null;
-
+
webClient = createClientForApp(appId, restPath);
EcompPortalUtils.logAndSerializeObject(restPath, "GET request =", "no-payload");
-
+
try {
- if (webClient!=null) {
+ if (webClient != null) {
response = webClient.get();
} else {
- logger.error(EELFLoggerDelegate.errorLogger, "Unable to create the Webclient to make the '" + restPath + "' API call.");
+ logger.error(EELFLoggerDelegate.errorLogger,
+ "Unable to create the Webclient to make the '" + restPath + "' API call.");
}
} catch (Exception e) {
- MDC.put(EPSystemProperties.EXTERNAL_API_RESPONSE_CODE, Integer.toString(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
+ MDC.put(EPSystemProperties.EXTERNAL_API_RESPONSE_CODE,
+ Integer.toString(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
EPLogUtil.logEcompError(EPAppMessagesEnum.BeRestApiGeneralError);
- logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while making the GET REST API call, Details: " + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "get 1 failed", e);
}
-
- if (response!=null) {
+
+ if (response != null) {
verifyResponse(response);
String str = response.readEntity(String.class);
EcompPortalUtils.logAndSerializeObject(restPath, "GET result =", str);
- try {
- t = mapper.readValue(str, clazz);
- } catch(Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
- EPLogUtil.logEcompError(EPAppMessagesEnum.BeInvalidJsonInput);
- }
+ try {
+ t = mapper.readValue(str, clazz);
+ } catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "get 2 failed", e);
+ EPLogUtil.logEcompError(EPAppMessagesEnum.BeInvalidJsonInput);
+ }
}
-
+
return t;
}
WebClient client = null;
Response response = null;
T t = null;
-
+
client = createClientForApp(appId, restPath);
EcompPortalUtils.logAndSerializeObject(restPath, "POST request =", payload);
-
-
+
try {
- if (client!=null) {
+ if (client != null) {
response = client.post(payload);
} else {
- logger.error(EELFLoggerDelegate.errorLogger, "Unable to create the Webclient to make the '" + restPath + "' API call.");
+ logger.error(EELFLoggerDelegate.errorLogger,
+ "Unable to create the Webclient to make the {} API call", restPath);
}
} catch (Exception e) {
- MDC.put(EPSystemProperties.EXTERNAL_API_RESPONSE_CODE, Integer.toString(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
+ MDC.put(EPSystemProperties.EXTERNAL_API_RESPONSE_CODE,
+ Integer.toString(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
EPLogUtil.logEcompError(EPAppMessagesEnum.BeRestApiGeneralError);
- logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while making the POST REST API call, Details: " + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "post 1 failed", e);
}
-
- if (response!=null) {
+
+ if (response != null) {
verifyResponse(response);
-
- //String contentType = response.getHeaderString("Content-Type");
- if(clazz != null) {
+
+ // String contentType = response.getHeaderString("Content-Type");
+ if (clazz != null) {
String str = response.readEntity(String.class);
EcompPortalUtils.logAndSerializeObject(restPath, "POST result =", str);
- try { t = gson.fromJson(str, clazz); } catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
+ try {
+ t = gson.fromJson(str, clazz);
+ } catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "post 2 failed", e);
EPLogUtil.logEcompError(EPAppMessagesEnum.BeInvalidJsonInput);
- }
+ }
}
}
return t;
}
@Override
- public <T> T put(Class<T> clazz, long appId, Object payload, String restPath) throws HTTPException {
+ public <T> T put(Class<T> clazz, long appId, Object payload, String restPath) throws HTTPException {
WebClient client = null;
Response response = null;
T t = null;
-
+
client = createClientForApp(appId, restPath);
EcompPortalUtils.logAndSerializeObject(restPath, "PUT request =", payload);
-
+
try {
- if (client!=null) {
+ if (client != null) {
response = client.put(payload);
} else {
- logger.error(EELFLoggerDelegate.errorLogger, "Unable to create the Webclient to make the '" + restPath + "' API call.");
+ logger.error(EELFLoggerDelegate.errorLogger,
+ "Unable to create the Webclient to make the '" + restPath + "' API call.");
}
- } catch(Exception e) {
- MDC.put(EPSystemProperties.EXTERNAL_API_RESPONSE_CODE, Integer.toString(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
+ } catch (Exception e) {
+ MDC.put(EPSystemProperties.EXTERNAL_API_RESPONSE_CODE,
+ Integer.toString(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
EPLogUtil.logEcompError(EPAppMessagesEnum.BeRestApiGeneralError);
- logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while making the PUT REST API call, Details: " + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "put 1 failed", e);
}
-
- if (response!=null) {
+
+ if (response != null) {
verifyResponse(response);
String str = response.readEntity(String.class);
EcompPortalUtils.logAndSerializeObject(restPath, "PUT result =", str);
- try { t = gson.fromJson(str, clazz); } catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
+ try {
+ t = gson.fromJson(str, clazz);
+ } catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "put 2 failed", e);
EPLogUtil.logEcompError(EPAppMessagesEnum.BeInvalidJsonInput);
- }
+ }
}
return t;
}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
-
+import java.net.MalformedURLException;
import java.security.GeneralSecurityException;
import java.util.ArrayList;
import java.util.LinkedList;
private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPAppServiceImpl.class);
private static Object syncRests = new Object();
-
+
@Autowired
private DataAccessService dataAccessService;
-
+
@Override
public List<EPApp> getUserRemoteApps(String id) {
-
- StringBuilder query = new StringBuilder();
-
- query.append("SELECT * FROM FN_APP join FN_USER_ROLE ON FN_USER_ROLE.APP_ID = FN_APP.APP_ID where ");
- query.append(
- "FN_USER_ROLE.USER_ID = " + id + " AND FN_USER_ROLE.ROLE_ID != " + SUPER_ADMIN_ROLE_ID);
- query.append(" AND FN_APP.ENABLED = 'Y'");
-
- TreeSet<EPApp> distinctApps = new TreeSet<EPApp>();
-
- @SuppressWarnings("unchecked")
- List<EPApp> adminApps = dataAccessService.executeSQLQuery(query.toString(), EPApp.class, null);
- for (EPApp app : adminApps) {
- distinctApps.add(app);
- }
-
- List<EPApp> userApps = new ArrayList<EPApp>();
- userApps.addAll(distinctApps);
- return userApps;
-
+ StringBuilder query = new StringBuilder();
+ query.append("SELECT * FROM FN_APP join FN_USER_ROLE ON FN_USER_ROLE.APP_ID = FN_APP.APP_ID where ");
+ query.append("FN_USER_ROLE.USER_ID = " + id + " AND FN_USER_ROLE.ROLE_ID != " + SUPER_ADMIN_ROLE_ID);
+ query.append(" AND FN_APP.ENABLED = 'Y'");
+ TreeSet<EPApp> distinctApps = new TreeSet<EPApp>();
+ @SuppressWarnings("unchecked")
+ List<EPApp> adminApps = dataAccessService.executeSQLQuery(query.toString(), EPApp.class, null);
+ for (EPApp app : adminApps) {
+ distinctApps.add(app);
+ }
+ List<EPApp> userApps = new ArrayList<EPApp>();
+ userApps.addAll(distinctApps);
+ return userApps;
}
-
+
+ @Override
protected void updateRestrictedApp(Long appId, OnboardingApp onboardingApp, FieldsValidator fieldsValidator,
EPUser user) {
synchronized (syncRests) {
EPApp app;
if (appId == null) {
app = new EPApp();
-
- // In the parent class, the UEB code is responsible for generating the keys/secret/mailbox but UEB Messaging
- // is not actually being used currently; may be used in future at which point we can just remove this method and
- // depend on parent class's method
- // So, using UUID generator to generate the unique key instead.
+ /*
+ * In the parent class, the UEB code is responsible for generating the
+ * keys/secret/mailbox but UEB Messaging is not actually being used currently;
+ * may be used in future at which point we can just remove this method and
+ * depend on parent class's method So, using UUID generator to generate the
+ * unique key instead.
+ */
String uuidStr = UUID.randomUUID().toString();
String appKey = uuidStr;
String appSecret = uuidStr;
onboardingApp.setUebTopicName(appMailboxName);
onboardingApp.setUebKey(appKey);
onboardingApp.setUebSecret(appSecret);
-
- }else {
+ } else {
app = (EPApp) localSession.get(EPApp.class, appId);
if (app == null || app.getId() == null) {
// App is already deleted!
return;
}
}
- logger.debug(EELFLoggerDelegate.debugLogger, "LR: about to call createAppFromOnboarding");
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ "updateRestrictedApp: about to call createAppFromOnboarding");
createAppFromOnboarding(app, onboardingApp, localSession);
logger.debug(EELFLoggerDelegate.debugLogger,
- "LR: updateApp: finished calling createAppFromOnboarding");
+ "updateRestrictedApp: finished calling createAppFromOnboarding");
localSession.saveOrUpdate(app);
logger.debug(EELFLoggerDelegate.debugLogger,
- "LR: updateApp: finished calling localSession.saveOrUpdate");
+ "updateRestrictedApp: finished calling localSession.saveOrUpdate");
// Enable or disable all menu items associated with this app
setFunctionalMenuItemsEnabled(localSession, onboardingApp.isEnabled, appId);
logger.debug(EELFLoggerDelegate.debugLogger,
- "LR: updateApp: finished calling setFunctionalMenuItemsEnabled");
+ "updateRestrictedApp: finished calling setFunctionalMenuItemsEnabled");
transaction.commit();
- logger.debug(EELFLoggerDelegate.debugLogger, "LR: updateApp: finished calling transaction.commit");
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ "updateRestrictedApp: finished calling transaction.commit");
result = true;
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, "updateApp failed", e);
+ logger.error(EELFLoggerDelegate.errorLogger, "updateRestrictedApp failed", e);
EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeUebRegisterOnboardingAppError, e);
EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
EcompPortalUtils.rollbackTransaction(transaction,
- "updateApp rollback, exception = " + EcompPortalUtils.getStackTrace(e));
+ "updateRestrictedApp rollback, exception = " + e.toString());
} finally {
- EcompPortalUtils.closeLocalSession(localSession, "updateApp");
+ EcompPortalUtils.closeLocalSession(localSession, "updateRestrictedApp");
}
if (!result) {
fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}
}
-
- public CambriaTopicManager getTopicManager(LinkedList<String> urlList, String key, String secret) throws GeneralSecurityException, Exception{
- return CambriaClientFactory.createTopicManager( null, urlList, key, secret);
+
+ @Override
+ public CambriaTopicManager getTopicManager(List<String> urlList, String key, String secret)
+ throws MalformedURLException, GeneralSecurityException {
+ return CambriaClientFactory.createTopicManager(null, urlList, key, secret);
}
}
\ No newline at end of file
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
try {
result = mapper.writeValueAsString(resultOfSearch);
} catch (JsonProcessingException e) {
- logger.error(EELFLoggerDelegate.errorLogger, "searchUsersInPhoneBook Exception = " + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "searchUsersInFnTable failed", e);
}
return result;
}
foundUsers.add(foundUser);
}
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, "searchInPhoneBookWithToken Exception = " + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "searchUsersByUserId failed", e);
}
return foundUsers;
}
foundUsers.add(foundUser);
}
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, "searchInPhoneBookWithToken Exception = " + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "searchUsersByName failed", e);
}
return foundUsers;
}
foundUsers.add(user);
}
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, "searchInPhoneBookWithToken Exception = " + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "searchUserByUserId failed", e);
return null;
}
return foundUsers.get(0);
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.service;
import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.service;
import org.json.JSONObject;
import org.openecomp.portalapp.portal.domain.EPUser;
import org.openecomp.portalapp.portal.utils.EPSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
import org.openecomp.portalsdk.core.FusionObject.Utilities;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.service.DataAccessService;
import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
+import org.openecomp.portalsdk.core.service.DataAccessService;
import org.openecomp.portalsdk.core.util.SystemProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service("userService")
@Transactional
public class UserServiceImpl implements UserService {
-
+
EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(UserServiceImpl.class);
@Autowired
- private DataAccessService dataAccessService;
-
+ private DataAccessService dataAccessService;
+
public DataAccessService getDataAccessService() {
return dataAccessService;
}
public void setDataAccessService(DataAccessService dataAccessService) {
this.dataAccessService = dataAccessService;
}
-
+
@SuppressWarnings("rawtypes")
@Override
public List getUserByUserId(String userId) {
-
-
- if(SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM).trim().equalsIgnoreCase("OIDC")){
- List<EPUser> users=new ArrayList<EPUser>();
- List<EPUser> filterdUsers=new ArrayList<EPUser>();
- BufferedReader in = null;
- HttpURLConnection con = null;
- try{
- String url = EPSystemProperties.getProperty(EPSystemProperties.AUTH_USER_SERVER);
+
+ if (SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM).trim().equalsIgnoreCase("OIDC")) {
+ List<EPUser> users = new ArrayList<EPUser>();
+ List<EPUser> filterdUsers = new ArrayList<EPUser>();
+ BufferedReader in = null;
+ HttpURLConnection con = null;
+ try {
+ String url = EPSystemProperties.getProperty(EPSystemProperties.AUTH_USER_SERVER);
URL obj = new URL(url);
con = (HttpURLConnection) obj.openConnection();
in = new BufferedReader(new InputStreamReader(con.getInputStream(), "UTF-8"));
String inputLine;
while ((inputLine = in.readLine()) != null)
- response.append(inputLine);
- JSONObject jObject = new JSONObject(response.toString()); // json
- JSONArray jsonUsers = jObject.getJSONArray("response"); // get data object
- for (int i = 0; i < jsonUsers.length(); i++) {
- JSONObject eachObject = jsonUsers.getJSONObject(i);
- EPUser eachUser = new EPUser();
- eachUser.setOrgUserId(eachObject.get("id").toString());// getString("id"));
- eachUser.setFirstName(eachObject.get("givenName").toString());
- eachUser.setLastName(eachObject.get("familyName").toString());
- eachUser.setEmail(eachObject.get("email").toString());
- users.add(eachUser);
- }
-
- for(int i = 0 ; i < users.size(); i ++){
-
- if(Utilities.nvl(userId).length() > 0){
- if(!userId.equalsIgnoreCase(users.get(i).getOrgUserId())){
- continue;
- }
- }
- filterdUsers.add(users.get(i));
-
- }
-
- }catch (Exception e){
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
- }finally{
- try {
+ response.append(inputLine);
+ JSONObject jObject = new JSONObject(response.toString()); // json
+ JSONArray jsonUsers = jObject.getJSONArray("response"); // get data object
+ for (int i = 0; i < jsonUsers.length(); i++) {
+ JSONObject eachObject = jsonUsers.getJSONObject(i);
+ EPUser eachUser = new EPUser();
+ eachUser.setOrgUserId(eachObject.get("id").toString());// getString("id"));
+ eachUser.setFirstName(eachObject.get("givenName").toString());
+ eachUser.setLastName(eachObject.get("familyName").toString());
+ eachUser.setEmail(eachObject.get("email").toString());
+ users.add(eachUser);
+ }
+
+ for (int i = 0; i < users.size(); i++) {
+
+ if (Utilities.nvl(userId).length() > 0) {
+ if (!userId.equalsIgnoreCase(users.get(i).getOrgUserId())) {
+ continue;
+ }
+ }
+ filterdUsers.add(users.get(i));
+
+ }
+
+ } catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "getUserByUserId failed", e);
+ } finally {
+ try {
in.close();
con.disconnect();
} catch (IOException e) {
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "getUserByUserId 2 failed", e);
}
- }
-
+ }
+
return filterdUsers;
-
- }else{
-
- List list = null;
- StringBuffer criteria = new StringBuffer();
- criteria.append(" where org_user_id = '").append(userId).append("'");
- list = getDataAccessService().getList(EPUser.class, criteria.toString(), null, null);
- return (list == null || list.size() == 0) ? null : list;
-
+
+ } else {
+
+ List list = null;
+ StringBuffer criteria = new StringBuffer();
+ criteria.append(" where org_user_id = '").append(userId).append("'");
+ list = getDataAccessService().getList(EPUser.class, criteria.toString(), null, null);
+ return (list == null || list.size() == 0) ? null : list;
+
}
-
+
}
@SuppressWarnings("rawtypes")
@Override
public List getUserByFirstLastName(String firstName, String lastName) {
-
- if(!SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM).trim().equalsIgnoreCase("OIDC")){
-
- List list = null;
- StringBuffer criteria = new StringBuffer();
- if(firstName!=null)
- criteria.append(" where first_name = '").append(firstName).append("'");
- if(lastName!=null)
- criteria.append(" where last_name = '").append(lastName).append("'");
- list = getDataAccessService().getList(EPUser.class, criteria.toString(), null, null);
- return (list == null || list.size() == 0) ? null : list;
-
- }else{
-
- List<EPUser> users=new ArrayList<EPUser>();
- List<EPUser> filterdUsers=new ArrayList<EPUser>();
- BufferedReader in = null;
- HttpURLConnection con = null;
- try{
- String url = EPSystemProperties.getProperty(EPSystemProperties.AUTH_USER_SERVER);
+
+ if (!SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM).trim().equalsIgnoreCase("OIDC")) {
+
+ List list = null;
+ StringBuffer criteria = new StringBuffer();
+ if (firstName != null)
+ criteria.append(" where first_name = '").append(firstName).append("'");
+ if (lastName != null)
+ criteria.append(" where last_name = '").append(lastName).append("'");
+ list = getDataAccessService().getList(EPUser.class, criteria.toString(), null, null);
+ return (list == null || list.size() == 0) ? null : list;
+
+ } else {
+
+ List<EPUser> users = new ArrayList<EPUser>();
+ List<EPUser> filterdUsers = new ArrayList<EPUser>();
+ BufferedReader in = null;
+ HttpURLConnection con = null;
+ try {
+ String url = EPSystemProperties.getProperty(EPSystemProperties.AUTH_USER_SERVER);
URL obj = new URL(url);
con = (HttpURLConnection) obj.openConnection();
con.setReadTimeout(8000);
StringBuffer response = new StringBuffer();
-
+
in = new BufferedReader(new InputStreamReader(con.getInputStream(), "UTF-8"));
String inputLine;
while ((inputLine = in.readLine()) != null)
- response.append(inputLine);
- JSONObject jObject = new JSONObject(response.toString()); // json
- JSONArray jsonUsers = jObject.getJSONArray("response"); // get data object
- for (int i = 0; i < jsonUsers.length(); i++) {
- JSONObject eachObject = jsonUsers.getJSONObject(i);
- EPUser eachUser = new EPUser();
- eachUser.setOrgUserId(eachObject.get("id").toString());// getString("id"));
- eachUser.setFirstName(eachObject.get("givenName").toString());
- eachUser.setLastName(eachObject.get("familyName").toString());
- eachUser.setEmail(eachObject.get("email").toString());
- users.add(eachUser);
- }
-
- for(int i = 0 ; i < users.size(); i ++){
-
- if(Utilities.nvl(firstName).length() > 0){
- if(!firstName.equalsIgnoreCase(users.get(i).getFirstName())){
- continue;
- }
- }
- if(Utilities.nvl(lastName).length() > 0){
- if(!lastName.equalsIgnoreCase(users.get(i).getLastName())){
- continue;
- }
- }
-
-
- filterdUsers.add(users.get(i));
-
- }
-
- }catch (Exception e){
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
- }finally{
- try {
+ response.append(inputLine);
+ JSONObject jObject = new JSONObject(response.toString()); // json
+ JSONArray jsonUsers = jObject.getJSONArray("response"); // get data object
+ for (int i = 0; i < jsonUsers.length(); i++) {
+ JSONObject eachObject = jsonUsers.getJSONObject(i);
+ EPUser eachUser = new EPUser();
+ eachUser.setOrgUserId(eachObject.get("id").toString());// getString("id"));
+ eachUser.setFirstName(eachObject.get("givenName").toString());
+ eachUser.setLastName(eachObject.get("familyName").toString());
+ eachUser.setEmail(eachObject.get("email").toString());
+ users.add(eachUser);
+ }
+
+ for (int i = 0; i < users.size(); i++) {
+
+ if (Utilities.nvl(firstName).length() > 0) {
+ if (!firstName.equalsIgnoreCase(users.get(i).getFirstName())) {
+ continue;
+ }
+ }
+ if (Utilities.nvl(lastName).length() > 0) {
+ if (!lastName.equalsIgnoreCase(users.get(i).getLastName())) {
+ continue;
+ }
+ }
+
+ filterdUsers.add(users.get(i));
+
+ }
+
+ } catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "getUserByFirstLastName failed", e);
+ } finally {
+ try {
in.close();
con.disconnect();
} catch (IOException e) {
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "getUserByFirstLastName 2 failed", e);
}
- }
-
+ }
+
return filterdUsers;
}
-
+
}
-
- public String saveNewUser(EPUser newUser, String checkDuplicate) throws Exception{
-
- try{
-
- List list = null;
- StringBuffer criteria = new StringBuffer();
- criteria.append(" where org_user_id = '").append(newUser.getLoginId()).append("'");
- list = getDataAccessService().getList(EPUser.class, criteria.toString(), null, null);
- if(list == null || list.size()==0){
- newUser.setActive(true);
- newUser.setOrgUserId(newUser.getLoginId());
- newUser.setLoginPwd(CipherUtil.encrypt(newUser.getLoginPwd()));
- getDataAccessService().saveDomainObject(newUser, null);
- }else{
- if(checkDuplicate.equals("Yes")){
- // userId already exist in database
- return "Record already exist";
- }else{
-
- EPUser oldUser = (EPUser) list.get(0);
- oldUser.setFirstName(newUser.getFirstName());
- oldUser.setLastName(newUser.getLastName());
- oldUser.setMiddleInitial(newUser.getMiddleInitial());
- if(!oldUser.getLoginPwd().equals(newUser.getLoginPwd()))
- oldUser.setLoginPwd(CipherUtil.encrypt(newUser.getLoginPwd()));
- else
- oldUser.setLoginPwd(newUser.getLoginPwd());
- getDataAccessService().saveDomainObject(oldUser, null);
-
- }
-
- }
-
- }catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, "", e);
+
+ public String saveNewUser(EPUser newUser, String checkDuplicate) throws Exception {
+ try {
+ List list = null;
+ StringBuffer criteria = new StringBuffer();
+ criteria.append(" where org_user_id = '").append(newUser.getLoginId()).append("'");
+ list = getDataAccessService().getList(EPUser.class, criteria.toString(), null, null);
+ if (list == null || list.size() == 0) {
+ newUser.setActive(true);
+ newUser.setOrgUserId(newUser.getLoginId());
+ newUser.setLoginPwd(CipherUtil.encrypt(newUser.getLoginPwd()));
+ getDataAccessService().saveDomainObject(newUser, null);
+ } else {
+ if (checkDuplicate.equals("Yes")) {
+ // userId already exist in database
+ return "Record already exist";
+ } else {
+
+ EPUser oldUser = (EPUser) list.get(0);
+ oldUser.setFirstName(newUser.getFirstName());
+ oldUser.setLastName(newUser.getLastName());
+ oldUser.setMiddleInitial(newUser.getMiddleInitial());
+ if (!oldUser.getLoginPwd().equals(newUser.getLoginPwd()))
+ oldUser.setLoginPwd(CipherUtil.encrypt(newUser.getLoginPwd()));
+ else
+ oldUser.setLoginPwd(newUser.getLoginPwd());
+ getDataAccessService().saveDomainObject(oldUser, null);
+
+ }
+
+ }
+
+ } catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "saveNewUser failed", e);
throw new Exception(e);
}
return "success";
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.transport;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.ueb;
import java.util.LinkedList;
import java.util.List;
-import javax.annotation.PostConstruct;
-
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.openecomp.portalapp.portal.domain.EPApp;
import org.openecomp.portalapp.portal.service.EPAppService;
import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.onboarding.util.PortalApiConstants;
-import org.openecomp.portalsdk.core.onboarding.util.PortalApiProperties;
import org.openecomp.portalsdk.core.onboarding.ueb.Helper;
import org.openecomp.portalsdk.core.onboarding.ueb.Publisher;
import org.openecomp.portalsdk.core.onboarding.ueb.UebException;
import org.openecomp.portalsdk.core.onboarding.ueb.UebManager;
import org.openecomp.portalsdk.core.onboarding.ueb.UebMsg;
+import org.openecomp.portalsdk.core.onboarding.util.PortalApiConstants;
+import org.openecomp.portalsdk.core.onboarding.util.PortalApiProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.stereotype.Component;
@EnableAspectJAutoProxy
public class EPUebHelper {
EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPUebHelper.class);
-
+
@Autowired
EPAppService appsService;
-
-
+
@Autowired
private SessionFactory sessionFactory;
-
+
@SuppressWarnings("unused")
private Publisher epPublisher;
-
+
public EPUebHelper() {
-
+
}
+
//
- // This should only be called by the ECOMP Portal App, other Apps have just one publisher and use appPublisher
+ // This should only be called by the ECOMP Portal App, other Apps have just one
+ // publisher and use appPublisher
//
@SuppressWarnings("unused")
@EPMetricsLog
- public void refreshPublisherList()
- {
+ public void refreshPublisherList() {
Session localSession = null;
- boolean addedPublisher = false;
-
+ boolean addedPublisher = false;
+
try {
localSession = sessionFactory.openSession();
-
+
List<EcompApp> apps = appsService.getEcompAppAppsFullList();
- for (int i = 0; i < apps.size(); i++)
- {
- if ((apps.get(i).isEnabled()) &&
- (apps.get(i).getUebTopicName() != null) &&
- !(apps.get(i).getUebTopicName().toUpperCase().contains("ECOMP-PORTAL-INBOX")))
- {
- logger.debug(EELFLoggerDelegate.debugLogger, "UEBManager adding publisher for " + apps.get(i).getUebTopicName());
+ for (int i = 0; i < apps.size(); i++) {
+ if ((apps.get(i).isEnabled()) && (apps.get(i).getUebTopicName() != null)
+ && !(apps.get(i).getUebTopicName().toUpperCase().contains("ECOMP-PORTAL-INBOX"))) {
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ "UEBManager adding publisher for " + apps.get(i).getUebTopicName());
UebManager.getInstance().addPublisher(apps.get(i).getUebTopicName());
- addedPublisher = true;
- }
- else if ((apps.get(i).getId() != 1) && // App may have been disabled, remove the publisher
- !(apps.get(i).isEnabled()))
- {
- if(apps.get(i).getUebTopicName()!=null){
+ addedPublisher = true;
+ } else if ((apps.get(i).getId() != 1) && // App may have been disabled, remove the publisher
+ !(apps.get(i).isEnabled())) {
+ if (apps.get(i).getUebTopicName() != null) {
UebManager.getInstance().removePublisher(apps.get(i).getUebTopicName());
}
}
}
- }
- catch (Exception e)
- {
+ } catch (Exception e) {
EPLogUtil.logEcompError(EPAppMessagesEnum.BeUebSystemError, "add/remove Publisher");
- String stackTrace = EcompPortalUtils.getStackTrace(e);
- logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while refreshing the publisher list. Details: " + stackTrace);
+ logger.error(EELFLoggerDelegate.errorLogger, "refreshPublisherList failed", e);
}
-
- //publisherList.print();
-
+
+ // publisherList.print();
+
if (addedPublisher == true) // Give publishers time to initialize
{
Helper.sleep(400);
}
}
-
- //@PostConstruct
- //@EPMetricsLog
+
+ // @PostConstruct
+ // @EPMetricsLog
public void initUeb() {
try {
- epPublisher = new Publisher(PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_KEY),
- PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_SECRET),
- PortalApiProperties.getProperty(PortalApiConstants.ECOMP_PORTAL_INBOX_NAME));
+ epPublisher = new Publisher(PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_KEY),
+ PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_SECRET),
+ PortalApiProperties.getProperty(PortalApiConstants.ECOMP_PORTAL_INBOX_NAME));
} catch (Exception e) {
EPLogUtil.logEcompError(EPAppMessagesEnum.BeUebConnectionError, e.getMessage());
- String stackTrace = EcompPortalUtils.getStackTrace(e);
- logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while initializing the publisher. Details: " + stackTrace);
+ logger.error(EELFLoggerDelegate.errorLogger, "initUeb failed", e);
}
-
+
Thread thread = new Thread("EPUebManager: postConstructMethod - refreshPublisherList") {
- public void run(){
- refreshPublisherList();
- }
+ public void run() {
+ refreshPublisherList();
+ }
};
if (thread != null) {
- thread.start();
+ thread.start();
}
}
try {
UebManager.getInstance().addPublisher(app.getUebTopicName());
} catch (UebException e) {
- String stackTrace = EcompPortalUtils.getStackTrace(e);
- logger.error(EELFLoggerDelegate.errorLogger, "Exception while adding a publisher. Details: " + stackTrace);
+ logger.error(EELFLoggerDelegate.errorLogger, "addPublisher failed", e);
}
}
-
+
public boolean checkAvailability() {
-
+
+ //
+ // Test existence of topic at UEB url
//
- // Test existence of topic at UEB url
//
- //
//
boolean available = true;
LinkedList<String> urlList = Helper.uebUrlList();
if (!urlList.isEmpty()) {
- String url = "http://" + urlList.getFirst() + ":3904/topics/" + PortalApiProperties.getProperty(PortalApiConstants.ECOMP_PORTAL_INBOX_NAME);
- if (!url.isEmpty()) {
- try {
- URL siteURL = new URL(url);
- HttpURLConnection connection = (HttpURLConnection) siteURL.openConnection();
- connection.setRequestMethod("GET");
- connection.connect();
-
- int code = connection.getResponseCode();
- if (code == 200) {
- available = true;
- }
- else {
- EPLogUtil.logEcompError(EPAppMessagesEnum.BeUebConnectionError, url);
- available = false;
- logger.warn(EELFLoggerDelegate.errorLogger, "Warning! UEB topic existence check failed, topic = " + url );
- logger.debug(EELFLoggerDelegate.debugLogger, "Warning! UEB topic existence check failed, topic = " + url );
- }
- }
- catch (Exception e) {
- available = false;
- String stackTrace = EcompPortalUtils.getStackTrace(e);
- logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while performing the UEB Healthcheck. Details: " + stackTrace);
- }
- }
+ String url = "http://" + urlList.getFirst() + ":3904/topics/"
+ + PortalApiProperties.getProperty(PortalApiConstants.ECOMP_PORTAL_INBOX_NAME);
+ if (!url.isEmpty()) {
+ try {
+ URL siteURL = new URL(url);
+ HttpURLConnection connection = (HttpURLConnection) siteURL.openConnection();
+ connection.setRequestMethod("GET");
+ connection.connect();
+
+ int code = connection.getResponseCode();
+ if (code == 200) {
+ available = true;
+ } else {
+ EPLogUtil.logEcompError(EPAppMessagesEnum.BeUebConnectionError, url);
+ available = false;
+ logger.warn(EELFLoggerDelegate.errorLogger,
+ "Warning! UEB topic existence check failed, topic = " + url);
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ "Warning! UEB topic existence check failed, topic = " + url);
+ }
+ } catch (Exception e) {
+ available = false;
+ logger.error(EELFLoggerDelegate.errorLogger, "checkAvailability failed", e);
+ }
+ }
}
return available;
}
-
- public boolean MessageCanBeSentToTopic() {
-
- boolean sentMsgSuccessfully = false;
-
- UebMsg msg = new UebMsg();
- msg.putSourceTopicName(PortalApiProperties.getProperty(PortalApiConstants.ECOMP_PORTAL_INBOX_NAME));
- msg.putPayload("Pinging topic for health check");
- msg.putMsgType(EPUebMsgTypes.UEB_MSG_TYPE_HEALTH_CHECK);
-
- try {
- // epPublisher.send(msg);
- sentMsgSuccessfully = true;
- }
- catch (Exception e) {
- EPLogUtil.logEcompError(EPAppMessagesEnum.BeHealthCheckUebClusterError);
- String stackTrace = EcompPortalUtils.getStackTrace(e);
- sentMsgSuccessfully = false;
- logger.warn(EELFLoggerDelegate.errorLogger, "Warning! could not successfully publish a UEB msg to "
- + PortalApiProperties.getProperty(PortalApiConstants.ECOMP_PORTAL_INBOX_NAME) + " exception : " + stackTrace);
- }
-
- return sentMsgSuccessfully;
- }
-
-}
+ public boolean MessageCanBeSentToTopic() {
+
+ boolean sentMsgSuccessfully = false;
+
+ UebMsg msg = new UebMsg();
+ msg.putSourceTopicName(PortalApiProperties.getProperty(PortalApiConstants.ECOMP_PORTAL_INBOX_NAME));
+ msg.putPayload("Pinging topic for health check");
+ msg.putMsgType(EPUebMsgTypes.UEB_MSG_TYPE_HEALTH_CHECK);
+
+ try {
+ // epPublisher.send(msg);
+ sentMsgSuccessfully = true;
+ } catch (Exception e) {
+ EPLogUtil.logEcompError(EPAppMessagesEnum.BeHealthCheckUebClusterError);
+ sentMsgSuccessfully = false;
+ logger.warn(EELFLoggerDelegate.errorLogger, "Warning! could not successfully publish a UEB msg to "
+ + PortalApiProperties.getProperty(PortalApiConstants.ECOMP_PORTAL_INBOX_NAME), e);
+ }
+
+ return sentMsgSuccessfully;
+ }
+}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.ueb;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.utils;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.scheduler;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.scheduler;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.scheduler;
import java.util.ArrayList;
import java.util.List;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.openecomp.portalsdk.core.scheduler.Registerable;
import org.openecomp.portalsdk.core.util.SystemProperties;
getScheduleTriggers().add(logRegistry.getTrigger());
} catch (IllegalStateException ies) {
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(ies));
+ logger.error(EELFLoggerDelegate.errorLogger, "registerTriggers log cron failed", ies);
logger.info(EELFLoggerDelegate.debugLogger, ("Log Cron not available"));
}
getScheduleTriggers().add(sessionMgtRegistry.getTrigger());
} catch(IllegalStateException ies) {
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(ies));
+ logger.error(EELFLoggerDelegate.errorLogger, "registerTriggers session timeout failed", ies);
logger.info(EELFLoggerDelegate.debugLogger, ("Session Cron not available"));
}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.scheduler;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.scheduler;
@DependsOn({ "systemProperties" })
public class SessionMgtRegistry extends CronRegistry implements ApplicationContextAware {
- EELFLoggerDelegate logger = null;
+ private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SessionMgtRegistry.class);
private static final String groupName = "AppGroup";
private static final String jobName = "PortalSessionTimeoutFeedJob";
private ApplicationContext applicationContext;
public JobDetailFactoryBean jobDetailFactoryBean() {
- logger = EELFLoggerDelegate.getLogger(SessionMgtRegistry.class);
Map<String, Object> map = new HashMap<String, Object>();
return jobDetailFactoryBean(groupName, jobName, TimeoutHandler.class, map);
}
@SuppressWarnings("static-access")
public CronTriggerFactoryBean cronTriggerFactoryBean() throws ParseException {
- logger = EELFLoggerDelegate.getLogger(SessionMgtRegistry.class);
String property = "* * * * * ? 2099";
try {
property = systemProperties.getProperty(SystemProperties.SESSIONTIMEOUT_FEED_CRON);
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.service;
import java.util.List;
import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.service.AppsCacheService;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
import org.openecomp.portalsdk.core.service.WebServiceCallServiceImpl;
import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@EnableAspectJAutoProxy
public class RemoteWebServiceCallServiceImpl extends WebServiceCallServiceImpl implements RemoteWebServiceCallService {
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(RemoteWebServiceCallServiceImpl.class);
- @Autowired
- AppsCacheService appCacheService;
+ private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(RemoteWebServiceCallServiceImpl.class);
/*
* (non-Javadoc)
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.uebhandler;
import org.openecomp.portalapp.portal.service.FunctionalMenuService;
import org.openecomp.portalapp.portal.service.SearchService;
import org.openecomp.portalapp.portal.transport.FunctionalMenuItem;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.openecomp.portalsdk.core.onboarding.ueb.UebException;
import org.openecomp.portalsdk.core.onboarding.ueb.UebManager;
@org.springframework.context.annotation.Configuration
@EnableAspectJAutoProxy
@EPAuditLog
-public class FunctionalMenuHandler {
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(FunctionalMenuHandler.class);
-
+public class FunctionalMenuHandler {
+ private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(FunctionalMenuHandler.class);
+
@Autowired
- AdminRolesService adminRolesService;
-
+ private AdminRolesService adminRolesService;
+
@Autowired
- FunctionalMenuService functionalMenuService;
-
+ private FunctionalMenuService functionalMenuService;
+
@Autowired
- SearchService searchSvc;
-
- @Autowired
- DataAccessService dataAccessService;
+ private SearchService searchSvc;
@Async
- public Boolean getFunctionalMenu(UebMsg requestMsg)
- {
+ public Boolean getFunctionalMenu(UebMsg requestMsg) {
UebMsg returnMsg = new UebMsg();
-
- if (requestMsg == null)
- {
+
+ if (requestMsg == null) {
logger.error(EELFLoggerDelegate.errorLogger, "handleMenuRequest received null message");
return false;
- }
- else if (requestMsg.getSourceTopicName() == null)
- {
- logger.error(EELFLoggerDelegate.errorLogger, "A source topic name is required and not found in this msg:" + requestMsg.toString());
+ } else if (requestMsg.getSourceTopicName() == null) {
+ logger.error(EELFLoggerDelegate.errorLogger,
+ "A source topic name is required and not found in this msg:" + requestMsg.toString());
return false;
- }
- else if (requestMsg.getUserId() == null)
- {
- logger.debug(EELFLoggerDelegate.debugLogger, "Error getting functional menu. A userId is required and not found in this msg: " + requestMsg.toString());
- returnMsg.putMsgId(requestMsg.getMsgId()); // echo tells requester this is a response
+ } else if (requestMsg.getUserId() == null) {
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ "Error getting functional menu. A userId is required and not found in this msg: "
+ + requestMsg.toString());
+ returnMsg.putMsgId(requestMsg.getMsgId()); // echo tells requester this is a response
returnMsg.putPayload("Error: A userId is required. Call msg.putUserId() with an userId");
- }
- else
- {
- logger.debug(EELFLoggerDelegate.debugLogger, "Getting functional menu for user = " + requestMsg.getUserId());
+ } else {
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ "Getting functional menu for user = " + requestMsg.getUserId());
EPUser user = searchSvc.searchUserByUserId(requestMsg.getUserId());
-
+
List<FunctionalMenuItem> menuItems = null;
- if (user == null)
- {
- logger.debug(EELFLoggerDelegate.debugLogger, "Error getting functional menu. userId not found in directory or is guest: " + requestMsg.toString());
- }
- else if (adminRolesService.isSuperAdmin(user))
- {
- logger.debug(EELFLoggerDelegate.debugLogger, "FunctionalMenuHandler: SuperUser, about to call getFunctionalMenuItems()");
+ if (user == null) {
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ "Error getting functional menu. userId not found in directory or is guest: "
+ + requestMsg.toString());
+ } else if (adminRolesService.isSuperAdmin(user)) {
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ "FunctionalMenuHandler: SuperUser, about to call getFunctionalMenuItems()");
menuItems = functionalMenuService.getFunctionalMenuItems();
- }
- else
- {
- logger.debug(EELFLoggerDelegate.debugLogger, "getMenuItemsForAuthUser: about to call getFunctionalMenuItemsForUser()");
+ } else {
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ "getMenuItemsForAuthUser: about to call getFunctionalMenuItemsForUser()");
menuItems = functionalMenuService.getFunctionalMenuItemsForUser(requestMsg.getUserId());
}
-
- if ( menuItems != null )
- {
- String functionalMenuJsonString = new Gson().toJson(menuItems);
+
+ if (menuItems != null) {
+ String functionalMenuJsonString = new Gson().toJson(menuItems);
logger.debug(EELFLoggerDelegate.debugLogger, "returning functional menu : " + functionalMenuJsonString);
- returnMsg.putMsgId(requestMsg.getMsgId()); // echo tells requester this is a response
- returnMsg.putPayload(functionalMenuJsonString);
+ returnMsg.putMsgId(requestMsg.getMsgId()); // echo tells requester this is a response
+ returnMsg.putPayload(functionalMenuJsonString);
} else {
- returnMsg.putMsgId(requestMsg.getMsgId()); // echo tells requester this is a response
+ returnMsg.putMsgId(requestMsg.getMsgId()); // echo tells requester this is a response
returnMsg.putPayload("Error: Not found for userId = " + requestMsg.getUserId());
}
}
-
+
try {
- UebManager.getInstance().publishReplyEP(returnMsg, requestMsg.getSourceTopicName());
- } catch (UebException e) {
- logger.error(EELFLoggerDelegate.errorLogger, "UebException occurred while responding to the Ueb message, Details:" + EcompPortalUtils.getStackTrace(e));
- } catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while responding to the Ueb message, Details:" + EcompPortalUtils.getStackTrace(e));
- }
-
- return true;
+ UebManager.getInstance().publishReplyEP(returnMsg, requestMsg.getSourceTopicName());
+ } catch (UebException e) {
+ logger.error(EELFLoggerDelegate.errorLogger,
+ "getFunctionalMenu failed to publish reply", e);
+ } catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger,
+ "getFunctionalMenu failed", e);
+ }
+
+ return true;
}
}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.uebhandler;
import java.util.concurrent.ConcurrentLinkedQueue;
-import javax.annotation.PostConstruct;
-
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.onboarding.util.PortalApiConstants;
-import org.openecomp.portalsdk.core.onboarding.util.PortalApiProperties;
import org.openecomp.portalsdk.core.onboarding.ueb.UebManager;
import org.openecomp.portalsdk.core.onboarding.ueb.UebMsg;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.openecomp.portalsdk.core.onboarding.util.PortalApiConstants;
+import org.openecomp.portalsdk.core.onboarding.util.PortalApiProperties;
//
// Adding this class for the sole purpose of insuring that the MainUebHandler really
//@EnableAspectJAutoProxy
//@EPMetricsLog
public class InitUebHandler {
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(InitUebHandler.class);
-
- //@Autowired
- MainUebHandler mainUebHandler;
-
- public InitUebHandler() {
-
+ private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(InitUebHandler.class);
+
+ // @Autowired
+ private MainUebHandler mainUebHandler;
+
+ public InitUebHandler() {
+
}
-
- //@PostConstruct
- public void initUeb() {
-
+
+ // @PostConstruct
+ public void initUeb() {
try {
String enableListenerThread = PortalApiProperties.getProperty(PortalApiConstants.UEB_LISTENERS_ENABLE);
if (enableListenerThread.equalsIgnoreCase("true")) {
- ConcurrentLinkedQueue<UebMsg> inboxQueue = new ConcurrentLinkedQueue<UebMsg>();
- UebManager.getInstance().initListener(inboxQueue);
- mainUebHandler.runHandler(inboxQueue);
- logger.info(EELFLoggerDelegate.errorLogger, "Returned from initiating mainUebHandler...");
- }
- else {
- logger.info(EELFLoggerDelegate.errorLogger, "Not starting UEB listening thread because ueb_listeners_enable is not set to true in the properties file.");
- }
- }
- catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e));
- logger.info(EELFLoggerDelegate.errorLogger, "Not starting UEB listening thread because property could not be read " + PortalApiConstants.UEB_LISTENERS_ENABLE + e.getMessage());
+ ConcurrentLinkedQueue<UebMsg> inboxQueue = new ConcurrentLinkedQueue<UebMsg>();
+ UebManager.getInstance().initListener(inboxQueue);
+ mainUebHandler.runHandler(inboxQueue);
+ logger.info(EELFLoggerDelegate.errorLogger, "Returned from initiating mainUebHandler...");
+ } else {
+ logger.info(EELFLoggerDelegate.errorLogger,
+ "Not starting UEB listening thread because ueb_listeners_enable is not set to true in the properties file.");
+ }
+ } catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "initUeb failed", e);
+ logger.info(EELFLoggerDelegate.errorLogger,
+ "Not starting UEB listening thread because property could not be read "
+ + PortalApiConstants.UEB_LISTENERS_ENABLE + e.getMessage());
}
}
}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.uebhandler;
import org.openecomp.portalapp.portal.ueb.EPUebMsgTypes;
import org.openecomp.portalapp.portal.utils.EPSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.openecomp.portalsdk.core.onboarding.ueb.UebMsg;
import org.openecomp.portalsdk.core.onboarding.ueb.UebMsgTypes;
import com.att.eelf.configuration.Configuration;
-
//-------------------------------------------------------------------------
// Listens for received UEB messages and handles the messages
//
//
//-------------------------------------------------------------------------
@Component("MainUebHandler")
-public class MainUebHandler
-{
+public class MainUebHandler {
final DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MainUebHandler.class);
-
- ConcurrentLinkedQueue<UebMsg> inboxQueue = null;
-
- @Autowired
- FunctionalMenuHandler funcMenuHandler;
-
+ private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MainUebHandler.class);
+
+ private ConcurrentLinkedQueue<UebMsg> inboxQueue = null;
+
+ @Autowired
+ private FunctionalMenuHandler funcMenuHandler;
+
@Autowired
- WidgetNotificationHandler widgetNotificationHandler;
+ private WidgetNotificationHandler widgetNotificationHandler;
@Async
- public void runHandler(ConcurrentLinkedQueue<UebMsg> queue)
- {
+ public void runHandler(ConcurrentLinkedQueue<UebMsg> queue) {
inboxQueue = queue;
- logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "==> MainUebHandler started");
- while (true)
- {
+ logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "==> MainUebHandler started");
+ while (true) {
UebMsg msg = null;
- while ((msg = inboxQueue.poll()) != null)
- {
- if ((msg.getMsgType() != null) && (!msg.getMsgType().equalsIgnoreCase(EPUebMsgTypes.UEB_MSG_TYPE_HEALTH_CHECK)))
- {
- // TODO: switch this back to debug
- logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== Received UEB message : " + msg.toString());
- logger.info(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== Received UEB message : " + msg.toString());
- MDC.put(EPSystemProperties.PARTNER_NAME, msg.getSourceTopicName());
- MDC.put(Configuration.MDC_SERVICE_NAME, msg.getMsgType().toString());
- switch(msg.getMsgType())
- {
- case UebMsgTypes.UEB_MSG_TYPE_GET_FUNC_MENU:
- {
- funcMenuHandler.getFunctionalMenu(msg);
- break;
- }
- case UebMsgTypes.UEB_MSG_TYPE_WIDGET_NOTIFICATION:
- {
- widgetNotificationHandler.handleWidgetNotification(msg);
- break;
- }
- default:
- {
- logger.info(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "Unknown UEB message type " + msg.toString());
- break;
- }
- }
- }
- }
-
- if (Thread.interrupted())
- {
- logger.info(EELFLoggerDelegate.errorLogger, "==> UebMainHandler exiting");
- break;
- }
-
- try {
- Thread.sleep(10);
+ while ((msg = inboxQueue.poll()) != null) {
+ if ((msg.getMsgType() != null)
+ && (!msg.getMsgType().equalsIgnoreCase(EPUebMsgTypes.UEB_MSG_TYPE_HEALTH_CHECK))) {
+ // TODO: switch this back to debug
+ logger.info(EELFLoggerDelegate.errorLogger,
+ dateFormat.format(new Date()) + "<== Received UEB message : " + msg.toString());
+ logger.info(EELFLoggerDelegate.debugLogger,
+ dateFormat.format(new Date()) + "<== Received UEB message : " + msg.toString());
+ MDC.put(EPSystemProperties.PARTNER_NAME, msg.getSourceTopicName());
+ MDC.put(Configuration.MDC_SERVICE_NAME, msg.getMsgType().toString());
+ switch (msg.getMsgType()) {
+ case UebMsgTypes.UEB_MSG_TYPE_GET_FUNC_MENU: {
+ funcMenuHandler.getFunctionalMenu(msg);
+ break;
+ }
+ case UebMsgTypes.UEB_MSG_TYPE_WIDGET_NOTIFICATION: {
+ widgetNotificationHandler.handleWidgetNotification(msg);
+ break;
+ }
+ default: {
+ logger.info(EELFLoggerDelegate.debugLogger,
+ dateFormat.format(new Date()) + "Unknown UEB message type " + msg.toString());
+ break;
+ }
+ }
+ }
+ }
+
+ if (Thread.interrupted()) {
+ logger.info(EELFLoggerDelegate.errorLogger, "==> UebMainHandler exiting");
+ break;
+ }
+
+ try {
+ Thread.sleep(10);
} catch (InterruptedException e) {
- logger.error(EELFLoggerDelegate.errorLogger, "UebMainHandler interrupted during sleep" + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "runHandler interrupted during sleep", e);
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred during sleep" + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "runHandler failed", e);
}
}
}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.uebhandler;
import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
import org.openecomp.portalapp.portal.service.EPAppService;
import org.openecomp.portalapp.portal.service.SearchService;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.openecomp.portalsdk.core.onboarding.ueb.UebException;
import org.openecomp.portalsdk.core.onboarding.ueb.UebManager;
@EnableAspectJAutoProxy
@EPMetricsLog
public class WidgetNotificationHandler {
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WidgetNotificationHandler.class);
-
+ private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WidgetNotificationHandler.class);
+
final DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
+
@Autowired
EPAppService appSvc;
-
+
@Autowired
SearchService searchSvc;
-
- public WidgetNotificationHandler()
- {
+ public WidgetNotificationHandler() {
}
-
+
@Async
- public void handleWidgetNotification(UebMsg requestMsg)
- {
+ public void handleWidgetNotification(UebMsg requestMsg) {
if (requestMsg.getUserId() != null) {
- logger.debug(EELFLoggerDelegate.debugLogger, "handleWidgetNotification: getting widgets/apps for user = " + requestMsg.getUserId());
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ "handleWidgetNotification: getting widgets/apps for user = " + requestMsg.getUserId());
EPUser user = searchSvc.searchUserByUserId(requestMsg.getUserId());
if (user != null && (appSvc != null)) {
logger.debug(EELFLoggerDelegate.debugLogger, "Debug mytag: " + appSvc);
- List<EPApp> apps = appSvc.getUserApps(user);
- for (EPApp app : apps) {
- if (app.getUebTopicName() != null) {
- UebMsg widgetMsg = new UebMsg();
- widgetMsg.putSourceTopicName(app.getUebTopicName());
- logger.debug(EELFLoggerDelegate.debugLogger, "app.getUebTopicName was invoked");
- widgetMsg.putPayload(requestMsg.getPayload());
- try {
- logger.debug(EELFLoggerDelegate.debugLogger, "Sending widget notification from " + requestMsg.getSourceTopicName() + " to " + app.getUebTopicName());
- UebManager.getInstance().publishEP(widgetMsg, app.getUebTopicName());
- } catch (UebException e) {
- logger.error(EELFLoggerDelegate.errorLogger, "handleWidgetNotification publishEP exception" + EcompPortalUtils.getStackTrace(e));
- }
- }
- }
+ List<EPApp> apps = appSvc.getUserApps(user);
+ for (EPApp app : apps) {
+ if (app.getUebTopicName() != null) {
+ UebMsg widgetMsg = new UebMsg();
+ widgetMsg.putSourceTopicName(app.getUebTopicName());
+ logger.debug(EELFLoggerDelegate.debugLogger, "app.getUebTopicName was invoked");
+ widgetMsg.putPayload(requestMsg.getPayload());
+ try {
+ logger.debug(EELFLoggerDelegate.debugLogger, "Sending widget notification from "
+ + requestMsg.getSourceTopicName() + " to " + app.getUebTopicName());
+ UebManager.getInstance().publishEP(widgetMsg, app.getUebTopicName());
+ } catch (UebException e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "handleWidgetNotification failed", e);
+ }
+ }
+ }
} else {
- logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "handleWidgetNotification: user " +
- requestMsg.getUserId() + " not found" + " source = " + requestMsg.getSourceTopicName() +
- ". This widget notification cannot be posted to other widgets");
+ logger.error(EELFLoggerDelegate.errorLogger,
+ dateFormat.format(new Date()) + "handleWidgetNotification: user " + requestMsg.getUserId()
+ + " not found" + " source = " + requestMsg.getSourceTopicName()
+ + ". This widget notification cannot be posted to other widgets");
}
}
}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.util;
import javax.servlet.http.HttpSession;
import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.onboarding.util.PortalApiConstants;
import org.openecomp.portalsdk.core.onboarding.listener.PortalTimeoutHandler;
import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
+import org.openecomp.portalsdk.core.onboarding.util.PortalApiConstants;
import org.openecomp.portalsdk.core.util.SystemProperties;
import org.openecomp.portalsdk.core.web.support.AppUtils;
session.setMaxInactiveInterval(Integer.parseInt(maxIdleAttribute.toString()));
}
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, "Could not reset the session timeout. Details: " + EcompPortalUtils.getStackTrace(e));
+ logger.error(EELFLoggerDelegate.errorLogger, "resetSessionMaxIdleTimeOut failed", e);
}
}
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.authentication;
import static org.junit.Assert.*;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.authentication;
import static org.junit.Assert.assertFalse;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.authentication;
import static org.junit.Assert.assertFalse;
+++ /dev/null
-/*package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.EPAppService;
-import org.openecomp.portalapp.portal.service.PortalAdminService;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.OnboardingApp;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
-import org.openecomp.portalapp.util.EPUserUtils;
-
-public class AppsControllerExternalRequestOSTest {
-
- @Mock
- AdminRolesService adminRolesService;
-
- @Mock
- EPAppService appService;
-
- @Mock
- PortalAdminService portalAdminService;
-
-
- @InjectMocks
- AppsControllerExternalRequest appsControllerExternalRequest = new AppsControllerExternalRequest();
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- }
-
- MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
- HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
- HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
- NullPointerException nullPointerException = new NullPointerException();
-
- MockEPUser mockUser = new MockEPUser();
- @Mock
- EPUserUtils ePUserUtils = new EPUserUtils();
-
- @Test
- public void postOnboardAppExternalFieldValidatorTestTest() {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage("FieldsValidator [httpStatusCode=500, errorCode=null, fields=null]");
- expectedportalRestResponse.setResponse(null);
- PortalRestStatusEnum portalRestStatusEnum = null;
- expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
- OnboardingApp expectedOnboardingApp = new OnboardingApp();
- expectedOnboardingApp.id = null;
- expectedOnboardingApp.name = "Test";
- expectedOnboardingApp.url = "Test";
- expectedOnboardingApp.restUrl = "Test";
- expectedOnboardingApp.restrictedApp = false;
- expectedOnboardingApp.isOpen = false;
- expectedOnboardingApp.isEnabled = false;
- List<EPUser> userList = new ArrayList<EPUser>();
- EPUser user = mockUser.mockEPUser();
- userList.add(user);
- FieldsValidator expectedFieldValidator = new FieldsValidator();
- expectedFieldValidator.setHttpStatusCode((long) 500);
- expectedFieldValidator.setFields(null);
- expectedFieldValidator.setErrorCode(null);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(appService.addOnboardingApp(expectedOnboardingApp, user)).thenReturn(expectedFieldValidator);
- PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
- .postOnboardAppExternal(mockedRequest, mockedResponse, expectedOnboardingApp);
- assertEquals(actualPortalRestResponse, expectedportalRestResponse);
-
- }
-
- @Test
- public void postOnboardAppExternalIfSuperAdminTest() {
- PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
- expectedportalRestResponse.setMessage(null);
- expectedportalRestResponse.setResponse(null);
- PortalRestStatusEnum portalRestStatusEnum = null;
- expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
- OnboardingApp expectedOnboardingApp = new OnboardingApp();
- expectedOnboardingApp.id = null;
- expectedOnboardingApp.name = "Test";
- expectedOnboardingApp.url = "Test";
- expectedOnboardingApp.restUrl = "Test";
- expectedOnboardingApp.restrictedApp = false;
- expectedOnboardingApp.isOpen = false;
- expectedOnboardingApp.isEnabled = false;
- List<EPUser> userList = new ArrayList<EPUser>();
- EPUser user = mockUser.mockEPUser();
- userList.add(user);
- FieldsValidator expectedFieldValidator = new FieldsValidator();
- expectedFieldValidator.setHttpStatusCode((long) 200);
- expectedFieldValidator.setFields(null);
- expectedFieldValidator.setErrorCode(null);
- Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(appService.addOnboardingApp(expectedOnboardingApp, user)).thenReturn(expectedFieldValidator);
- PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
- .postOnboardAppExternal(mockedRequest, mockedResponse, expectedOnboardingApp);
- assertEquals(actualPortalRestResponse, expectedportalRestResponse);
-
- }
-}
-*/
\ No newline at end of file
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.controller;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.drools.core.command.assertion.AssertEquals;
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.openecomp.portalapp.portal.domain.EPUser;
import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
+import org.openecomp.portalapp.portal.framework.MockEPUser;
+import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
import org.openecomp.portalapp.portal.service.AdminRolesService;
import org.openecomp.portalapp.portal.service.EPAppService;
import org.openecomp.portalapp.portal.service.PersUserAppService;
import org.openecomp.portalapp.portal.service.UserService;
-import org.openecomp.portalapp.portal.framework.MockEPUser;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
import org.openecomp.portalapp.util.EPUserUtils;
public class AppsOSControllerTest {
-package org.openecomp.portalapp.portal.test.controller;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.openecomp.portalapp.portal.controller;
import static org.junit.Assert.assertEquals;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.controller.DashboardSearchResultController;
import org.openecomp.portalapp.portal.domain.EPUser;
import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
import org.openecomp.portalapp.portal.ecomp.model.SearchResultItem;
+import org.openecomp.portalapp.portal.framework.MockEPUser;
+import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
import org.openecomp.portalapp.portal.service.DashboardSearchService;
-import org.openecomp.portalapp.portal.service.DashboardSearchServiceImpl;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
import org.openecomp.portalapp.portal.transport.CommonWidget;
import org.openecomp.portalapp.portal.transport.CommonWidgetMeta;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
import org.openecomp.portalapp.util.EPUserUtils;
public class DashboardSearchResultControllerTest {
@Mock
- DashboardSearchService searchService = new DashboardSearchServiceImpl();
-
- @InjectMocks
- DashboardSearchResultController dashboardSearchResultController = new DashboardSearchResultController();
+ DashboardSearchService searchService;
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
}
+ @InjectMocks
+ DashboardSearchResultController dashboardSearchResultController = new DashboardSearchResultController();
+
MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
NullPointerException nullPointerException = new NullPointerException();
-
- @Mock
- EPUserUtils ePUserUtils = new EPUserUtils();
-
MockEPUser mockUser = new MockEPUser();
@Test
public void getWidgetDataTest() {
- String resourceType = "test";
PortalRestResponse<CommonWidgetMeta> ecpectedPortalRestResponse = new PortalRestResponse<CommonWidgetMeta>();
ecpectedPortalRestResponse.setMessage("success");
- ecpectedPortalRestResponse.setResponse(null);
+ ecpectedPortalRestResponse.setResponse(new CommonWidgetMeta());
ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
- Mockito.when(searchService.getWidgetData(resourceType)).thenReturn(null);
- PortalRestResponse<CommonWidgetMeta> acutualPoratlRestResponse = dashboardSearchResultController
- .getWidgetData(mockedRequest, resourceType);
- assertEquals(acutualPoratlRestResponse, ecpectedPortalRestResponse);
+ CommonWidgetMeta commonWidgetMeta = new CommonWidgetMeta();
+ Mockito.when(searchService.getWidgetData("test")).thenReturn(commonWidgetMeta);
+ PortalRestResponse<CommonWidgetMeta> actualPortalRestResponse = dashboardSearchResultController
+ .getWidgetData(mockedRequest, "test");
+ assertEquals(ecpectedPortalRestResponse.getStatus(), actualPortalRestResponse.getStatus());
+ }
+ @Test
+ public void saveWidgetDataBulkIfCatrgoryNullTest() {
+ PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
+ ecpectedPortalRestResponse.setMessage("ERROR");
+ ecpectedPortalRestResponse.setResponse("Category cannot be null or empty");
+ ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
+ CommonWidgetMeta commonWidgetMeta = new CommonWidgetMeta();
+ commonWidgetMeta.setCategory(null);
+ PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
+ .saveWidgetDataBulk(commonWidgetMeta);
+ assertEquals(ecpectedPortalRestResponse, actualPortalRestResponse);
}
@Test
ecpectedPortalRestResponse.setMessage("success");
ecpectedPortalRestResponse.setResponse(null);
ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
-
CommonWidgetMeta commonWidgetMeta = new CommonWidgetMeta();
commonWidgetMeta.setCategory("test");
+ List<CommonWidget> items = new ArrayList<>();
- List<CommonWidget> commonWidgetList = new ArrayList<CommonWidget>();
CommonWidget commonWidget = new CommonWidget();
commonWidget.setId((long) 1);
- commonWidget.setCategory("test");
- commonWidget.setHref("test_href");
- commonWidget.setTitle("test_title");
- commonWidget.setContent("test_content");
- commonWidget.setEventDate(null);
- commonWidget.setSortOrder(1);
-
- commonWidgetList.add(commonWidget);
-
- commonWidgetMeta.setItems(commonWidgetList);
-
- Mockito.when(searchService.saveWidgetDataBulk(commonWidgetMeta)).thenReturn(null);
-
+ commonWidget.setEventDate("2017-06-06");
+ items.add(commonWidget);
+ commonWidgetMeta.setItems(items);
PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
.saveWidgetDataBulk(commonWidgetMeta);
- assertEquals(actualPortalRestResponse, ecpectedPortalRestResponse);
+ assertEquals(ecpectedPortalRestResponse, actualPortalRestResponse);
}
@Test
- public void saveWidgetDataBulkIfCategoryNullTest() {
+ public void saveWidgetDataBulkExceptionTest() {
PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
- ecpectedPortalRestResponse.setMessage("java.text.ParseException: Unparseable date: \"1\"");
+ ecpectedPortalRestResponse.setMessage("java.text.ParseException: Unparseable date: \"date\"");
ecpectedPortalRestResponse.setResponse(null);
ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
-
CommonWidgetMeta commonWidgetMeta = new CommonWidgetMeta();
commonWidgetMeta.setCategory("test");
+ List<CommonWidget> items = new ArrayList<>();
- List<CommonWidget> commonWidgetList = new ArrayList<CommonWidget>();
CommonWidget commonWidget = new CommonWidget();
- commonWidget.setId(null);
- commonWidget.setCategory(null);
- commonWidget.setHref(null);
- commonWidget.setTitle(null);
- commonWidget.setContent("test_content");
- commonWidget.setEventDate("1");
- commonWidget.setSortOrder(1);
- commonWidgetList.add(commonWidget);
- commonWidgetMeta.setItems(commonWidgetList);
-
- Mockito.when(searchService.saveWidgetDataBulk(commonWidgetMeta)).thenReturn(null);
-
+ commonWidget.setId((long) 1);
+ commonWidget.setEventDate("date");
+ items.add(commonWidget);
+ commonWidgetMeta.setItems(items);
PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
.saveWidgetDataBulk(commonWidgetMeta);
- assertEquals(actualPortalRestResponse, ecpectedPortalRestResponse);
+ assertEquals(ecpectedPortalRestResponse, actualPortalRestResponse);
}
@Test
- public void saveWidgetDataTest() {
+ public void saveWidgetDataIfCatagoryNullTest() {
PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
- ecpectedPortalRestResponse.setMessage("success");
- ecpectedPortalRestResponse.setResponse(null);
- ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
+ ecpectedPortalRestResponse.setMessage("ERROR");
+ ecpectedPortalRestResponse.setResponse("Cateogry cannot be null or empty");
+ ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
CommonWidget commonWidget = new CommonWidget();
- commonWidget.setId((long) 1);
- commonWidget.setCategory("test");
- commonWidget.setHref("test_href");
- commonWidget.setTitle("test_title");
- commonWidget.setContent("test_content");
- commonWidget.setEventDate(null);
- commonWidget.setSortOrder(1);
-
- Mockito.when(searchService.saveWidgetData(commonWidget)).thenReturn(null);
-
+ commonWidget.setCategory(null);
PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
.saveWidgetData(commonWidget);
- assertEquals(actualPortalRestResponse, ecpectedPortalRestResponse);
-
+ assertEquals(ecpectedPortalRestResponse, actualPortalRestResponse);
}
@Test
- public void saveWidgetDataExceptionTest() {
+ public void saveWidgetDataTest() {
PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
- ecpectedPortalRestResponse.setMessage("ERROR");
- ecpectedPortalRestResponse.setResponse("Cateogry cannot be null or empty");
- ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
+ ecpectedPortalRestResponse.setMessage("success");
+ ecpectedPortalRestResponse.setResponse(null);
+ ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
CommonWidget commonWidget = new CommonWidget();
+ commonWidget.setCategory("test");
commonWidget.setId((long) 1);
- commonWidget.setCategory("");
- commonWidget.setHref("test_href");
- commonWidget.setTitle("test_title");
- commonWidget.setContent("test_content");
- commonWidget.setEventDate(null);
- commonWidget.setSortOrder(1);
-
- Mockito.when(searchService.saveWidgetData(commonWidget)).thenReturn(null);
-
+ commonWidget.setEventDate("2017-06-06");
PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
.saveWidgetData(commonWidget);
- assertEquals(actualPortalRestResponse, ecpectedPortalRestResponse);
-
+ assertEquals(ecpectedPortalRestResponse, actualPortalRestResponse);
}
@Test
- public void saveWidgetDataDateErrorTest() {
+ public void saveWidgetDataExceptionTest() {
PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
- ecpectedPortalRestResponse.setMessage("java.text.ParseException: Unparseable date: \"1\"");
+ ecpectedPortalRestResponse.setMessage("java.text.ParseException: Unparseable date: \"date\"");
ecpectedPortalRestResponse.setResponse(null);
ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
CommonWidget commonWidget = new CommonWidget();
- commonWidget.setId((long) 1);
commonWidget.setCategory("test");
- commonWidget.setHref("test_href");
- commonWidget.setTitle("test_title");
- commonWidget.setContent("test_content");
- commonWidget.setEventDate("1");
- commonWidget.setSortOrder(1);
-
- Mockito.when(searchService.saveWidgetData(commonWidget)).thenReturn(null);
-
+ commonWidget.setId((long) 1);
+ commonWidget.setEventDate("date");
PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
.saveWidgetData(commonWidget);
- assertEquals(actualPortalRestResponse, ecpectedPortalRestResponse);
-
+ assertEquals(ecpectedPortalRestResponse, actualPortalRestResponse);
}
-
- public void deleteWidgetDataTest() {
+
+ @Test
+ public void deleteWidgetDataTest()
+ {
PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
ecpectedPortalRestResponse.setMessage("success");
ecpectedPortalRestResponse.setResponse(null);
ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
CommonWidget commonWidget = new CommonWidget();
- commonWidget.setId((long) 1);
- commonWidget.setCategory("test");
- commonWidget.setHref("test_href");
- commonWidget.setTitle("test_title");
- commonWidget.setContent("test_content");
- commonWidget.setEventDate(null);
- commonWidget.setSortOrder(1);
- Mockito.when(searchService.deleteWidgetData(commonWidget)).thenReturn(null);
-
+ Mockito.when(searchService.deleteWidgetData(commonWidget)).thenReturn("test");
PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
.deleteWidgetData(commonWidget);
- System.out.println(actualPortalRestResponse);
- assertEquals(actualPortalRestResponse, ecpectedPortalRestResponse);
+ assertEquals(ecpectedPortalRestResponse.getStatus(), actualPortalRestResponse.getStatus());
}
-
+
@Test
- public void searchPortalIfUserIsNull() {
+ public void searchPortalIfUserIsTest()
+ {
EPUser user = null;
Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
String searchString = "test";
-
PortalRestResponse<Map<String, List<SearchResultItem>>> expectedResult = new PortalRestResponse<Map<String, List<SearchResultItem>>>();
expectedResult.setMessage("searchPortal: User object is null? - check logs");
expectedResult.setResponse(new HashMap<String, List<SearchResultItem>>());
expectedResult.setStatus(PortalRestStatusEnum.ERROR);
PortalRestResponse<Map<String, List<SearchResultItem>>> actualResult = dashboardSearchResultController
.searchPortal(mockedRequest, searchString);
- assertEquals(expectedResult, actualResult);
- }
+ System.out.println(actualResult);
- @Test
- public void searchPortalIfSearchStringNullTest() {
- EPUser user = mockUser.mockEPUser();
- ;
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- String searchString = null;
-
- PortalRestResponse<Map<String, List<SearchResultItem>>> expectedResult = new PortalRestResponse<Map<String, List<SearchResultItem>>>();
- expectedResult.setMessage("searchPortal: String string is null");
- expectedResult.setResponse(new HashMap<String, List<SearchResultItem>>());
- expectedResult.setStatus(PortalRestStatusEnum.ERROR);
-
- PortalRestResponse<Map<String, List<SearchResultItem>>> actualResult = dashboardSearchResultController
- .searchPortal(mockedRequest, searchString);
assertEquals(expectedResult, actualResult);
}
-
- @Test
- public void searchPortalIfSearchTest() {
- EPUser user = mockUser.mockEPUser();
- ;
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- String searchString = "test";
- List<SearchResultItem> searchResultItemList = new ArrayList<SearchResultItem>();
- SearchResultItem searchResultItem = new SearchResultItem();
-
- searchResultItem.setId((long) 1);
- searchResultItem.setCategory("test");
- searchResultItem.setName("test_name");
- searchResultItem.setTarget("test_target");
- searchResultItem.setUuid("test_UUId");
- searchResultItemList.add(searchResultItem);
- Map<String, List<SearchResultItem>> expectedResultMap = new HashMap<String, List<SearchResultItem>>();
- expectedResultMap.put(searchString, searchResultItemList);
-
- PortalRestResponse<Map<String, List<SearchResultItem>>> expectedResult = new PortalRestResponse<Map<String, List<SearchResultItem>>>();
- expectedResult.setMessage("success");
- expectedResult.setResponse(expectedResultMap);
- expectedResult.setStatus(PortalRestStatusEnum.OK);
-
- Mockito.when(searchService.searchResults(user.getLoginId(), searchString)).thenReturn(expectedResultMap);
- PortalRestResponse<Map<String, List<SearchResultItem>>> actualResult = dashboardSearchResultController
- .searchPortal(mockedRequest, searchString);
- assertEquals(expectedResult, actualResult);
-
- }
-
- @Test
- public void searchPortalIfSearchExcptionTest() {
- EPUser user = mockUser.mockEPUser();
- ;
- Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
- String searchString = "test";
-
- PortalRestResponse<Map<String, List<SearchResultItem>>> expectedResult = new PortalRestResponse<Map<String, List<SearchResultItem>>>();
- expectedResult.setMessage("null - check logs.");
- expectedResult.setResponse(new HashMap<String, List<SearchResultItem>>());
- expectedResult.setStatus(PortalRestStatusEnum.ERROR);
-
- Mockito.when(searchService.searchResults(user.getLoginId(), searchString)).thenThrow(nullPointerException);
- PortalRestResponse<Map<String, List<SearchResultItem>>> actualResult = dashboardSearchResultController
- .searchPortal(mockedRequest, searchString);
- assertEquals(expectedResult, actualResult);
- }
-
+
+
@Test
public void getActiveUsersTest() {
List<String> expectedActiveUsers = new ArrayList<String>();
assertEquals(actualResult, expectedResult);
}
+
+ @Test
+ public void searchPortalIfSearchStringNullTest() {
+ EPUser user = mockUser.mockEPUser();
+ ;
+ Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+ String searchString = null;
+
+ PortalRestResponse<Map<String, List<SearchResultItem>>> expectedResult = new PortalRestResponse<Map<String, List<SearchResultItem>>>();
+ expectedResult.setMessage("searchPortal: String string is null");
+ expectedResult.setResponse(new HashMap<String, List<SearchResultItem>>());
+ expectedResult.setStatus(PortalRestStatusEnum.ERROR);
+
+ PortalRestResponse<Map<String, List<SearchResultItem>>> actualResult = dashboardSearchResultController
+ .searchPortal(mockedRequest, searchString);
+ assertEquals(expectedResult, actualResult);
+ }
+
+ @Test
+ public void searchPortalIfSearchTest() {
+ EPUser user = mockUser.mockEPUser();
+ ;
+ Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+ String searchString = "test";
+ List<SearchResultItem> searchResultItemList = new ArrayList<SearchResultItem>();
+ SearchResultItem searchResultItem = new SearchResultItem();
+
+ searchResultItem.setId((long) 1);
+ searchResultItem.setCategory("test");
+ searchResultItem.setName("test_name");
+ searchResultItem.setTarget("test_target");
+ searchResultItem.setUuid("test_UUId");
+ searchResultItemList.add(searchResultItem);
+ Map<String, List<SearchResultItem>> expectedResultMap = new HashMap<String, List<SearchResultItem>>();
+ expectedResultMap.put(searchString, searchResultItemList);
+
+ PortalRestResponse<Map<String, List<SearchResultItem>>> expectedResult = new PortalRestResponse<Map<String, List<SearchResultItem>>>();
+ expectedResult.setMessage("success");
+ expectedResult.setResponse(expectedResultMap);
+ expectedResult.setStatus(PortalRestStatusEnum.OK);
+
+ Mockito.when(searchService.searchResults(user.getLoginId(), searchString)).thenReturn(expectedResultMap);
+ PortalRestResponse<Map<String, List<SearchResultItem>>> actualResult = dashboardSearchResultController
+ .searchPortal(mockedRequest, searchString);
+ assertEquals(expectedResult, actualResult);
+
+ }
+
+ @Test
+ public void searchPortalIfSearchExcptionTest() {
+ EPUser user = mockUser.mockEPUser();
+ ;
+ Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+ String searchString = "test";
+
+ PortalRestResponse<Map<String, List<SearchResultItem>>> expectedResult = new PortalRestResponse<Map<String, List<SearchResultItem>>>();
+ expectedResult.setMessage("null - check logs.");
+ expectedResult.setResponse(new HashMap<String, List<SearchResultItem>>());
+ expectedResult.setStatus(PortalRestStatusEnum.ERROR);
+
+ Mockito.when(searchService.searchResults(user.getLoginId(), searchString)).thenThrow(nullPointerException);
+ PortalRestResponse<Map<String, List<SearchResultItem>>> actualResult = dashboardSearchResultController
+ .searchPortal(mockedRequest, searchString);
+ assertEquals(expectedResult, actualResult);
+ }
}
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.controller;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
-import javax.servlet.ServletRequestWrapper;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
-import org.mockito.stubbing.OngoingStubbing;
import org.openecomp.portalapp.controller.ECOMPLogoutController;
+import org.openecomp.portalapp.portal.framework.MockEPUser;
+import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
import org.openecomp.portalapp.portal.service.DashboardSearchService;
import org.openecomp.portalapp.portal.service.DashboardSearchServiceImpl;
-import org.openecomp.portalapp.portal.framework.MockEPUser;
import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
import org.openecomp.portalapp.util.EPUserUtils;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
--- /dev/null
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.openecomp.portalapp.portal.controller;
+
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.openecomp.portalapp.portal.domain.EPUser;
+import org.openecomp.portalapp.portal.framework.MockEPUser;
+import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
+import org.openecomp.portalapp.portal.service.AdminRolesService;
+import org.openecomp.portalapp.portal.service.EPLoginService;
+import org.openecomp.portalapp.portal.service.FunctionalMenuService;
+import org.openecomp.portalapp.portal.transport.FavoritesFunctionalMenuItemJson;
+import org.openecomp.portalapp.portal.transport.FunctionalMenuItem;
+import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
+import org.openecomp.portalapp.portal.utils.EPSystemProperties;
+import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+import org.slf4j.MDC;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({ MDC.class, EPSystemProperties.class , EcompPortalUtils.class})
+public class ExternalAppsRestfulControllerOSTest {
+
+
+ @InjectMocks
+ ExternalAppsRestfulController externalAppsRestfulController = new ExternalAppsRestfulController();
+ @Mock
+ FunctionalMenuService functionalMenuService;
+
+ @Mock
+ EPLoginService epLoginService;
+
+ @Mock
+ AdminRolesService adminRolesService;
+
+
+
+ @Before
+ public void setup() {
+ MockitoAnnotations.initMocks(this);
+ }
+
+ MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+ HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+ HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+ NullPointerException nullPointerException = new NullPointerException();
+
+ MockEPUser mockUser = new MockEPUser();
+
+ @Test
+ public void getFavoritesForUserTest() throws Exception
+ {
+ PowerMockito.mockStatic(EPSystemProperties.class);
+ PowerMockito.mockStatic(MDC.class);
+ PowerMockito.mockStatic(EcompPortalUtils.class);
+ EPUser epUser = mockUser.mockEPUser();
+ epUser.setId((long) 1);
+ epUser.setLoginId("guestT");
+ String loginId = "guestT";
+ Mockito.when(MDC.get(EPSystemProperties.PARTNER_NAME)).thenReturn("Test");
+ List<FavoritesFunctionalMenuItemJson> favorites = new ArrayList<FavoritesFunctionalMenuItemJson>();
+ FavoritesFunctionalMenuItemJson favoritesFunctionalMenuItemJson = new FavoritesFunctionalMenuItemJson();
+ favorites.add(favoritesFunctionalMenuItemJson);
+ Mockito.when(mockedRequest.getHeader(EPCommonSystemProperties.MDC_LOGIN_ID)).thenReturn("Login_URL");
+ Mockito.when(MDC.get(EPSystemProperties.PARTNER_NAME)).thenReturn("Test");
+ Mockito.when(epLoginService.findUserWithoutPwd("Login_URL")).thenReturn(epUser);
+ Mockito.when(functionalMenuService.getFavoriteItems(epUser.getId())).thenReturn(favorites);
+ List<FavoritesFunctionalMenuItemJson> actaulFavorites = externalAppsRestfulController
+ .getFavoritesForUser(mockedRequest, mockedResponse);
+ assertEquals(actaulFavorites.size(), 1);
+ }
+
+ @Test
+ public void getFunctionalMenuItemsForUserIfSuperAdminTest() throws Exception {
+ PowerMockito.mockStatic(EPSystemProperties.class);
+ PowerMockito.mockStatic(MDC.class);
+ PowerMockito.mockStatic(EcompPortalUtils.class);
+ EPUser epUser = mockUser.mockEPUser();
+ epUser.setId((long) 1);
+ epUser.setLoginId("guestT");
+ String loginId = "guestT";
+ Mockito.when(MDC.get(EPSystemProperties.PARTNER_NAME)).thenReturn("Test");
+ Mockito.when(epLoginService.findUserWithoutPwd(loginId)).thenReturn(epUser);
+ List<FunctionalMenuItem> expectedList = new ArrayList<FunctionalMenuItem>();
+ FunctionalMenuItem functionalMenuItem = new FunctionalMenuItem();
+ expectedList.add(functionalMenuItem);
+ Mockito.when(mockedRequest.getHeader("LoginId")).thenReturn("guestT");
+ Mockito.when(adminRolesService.isSuperAdmin(epUser)).thenReturn(true);
+ Mockito.when(functionalMenuService.getFunctionalMenuItems()).thenReturn(expectedList);
+ List<FunctionalMenuItem> actualList = externalAppsRestfulController.getFunctionalMenuItemsForUser(mockedRequest,
+ mockedResponse);
+ assertNull(actualList.get(0).menuId);
+ }
+
+ @Test(expected = Exception.class)
+ public void getFunctionalMenuItemsForUserIfUSerNullTest() throws
+ Exception
+ {
+ PowerMockito.mockStatic(EPSystemProperties.class);
+ PowerMockito.mockStatic(EcompPortalUtils.class);
+ PowerMockito.mockStatic(MDC.class);
+ EPUser epUser = null;
+ String loginId = "guestT";
+ Mockito.when(MDC.get(EPSystemProperties.PARTNER_NAME)).thenReturn("Test");
+ Mockito.when(epLoginService.findUserWithoutPwd(loginId)).thenReturn(epUser);
+ externalAppsRestfulController.getFunctionalMenuItemsForUser(mockedRequest,
+ mockedResponse);
+ }
+
+ @Test
+ public void getFunctionalMenuItemsForUserTest() throws Exception {
+ PowerMockito.mockStatic(EPSystemProperties.class);
+ PowerMockito.mockStatic(MDC.class);
+ EPUser epUser = mockUser.mockEPUser();
+ epUser.setId((long) 1);
+ epUser.setLoginId("guestT");
+ String loginId = "guestT";
+ Mockito.when(MDC.get(EPSystemProperties.PARTNER_NAME)).thenReturn("Test");
+ Mockito.when(epLoginService.findUserWithoutPwd(loginId)).thenReturn(epUser);
+ List<FunctionalMenuItem> expectedList = new ArrayList<FunctionalMenuItem>();
+ FunctionalMenuItem functionalMenuItem = new FunctionalMenuItem();
+ expectedList.add(functionalMenuItem);
+ Mockito.when(mockedRequest.getHeader("LoginId")).thenReturn("guestT");
+ Mockito.when(adminRolesService.isSuperAdmin(epUser)).thenReturn(false);
+ Mockito.when(functionalMenuService.getFunctionalMenuItemsForUser(epUser.getOrgUserId()))
+ .thenReturn(expectedList);
+ List<FunctionalMenuItem> actualList = externalAppsRestfulController.getFunctionalMenuItemsForUser(mockedRequest,
+ mockedResponse);
+ assertNull(actualList.get(0).menuId);
+ }
+
+ @Test(expected = Exception.class)
+ public void getFavoritesForUserIfUserNullTest() throws Exception {
+ List<FavoritesFunctionalMenuItemJson> favorites = new ArrayList<FavoritesFunctionalMenuItemJson>();
+ FavoritesFunctionalMenuItemJson favoritesFunctionalMenuItemJson = new FavoritesFunctionalMenuItemJson();
+ favorites.add(favoritesFunctionalMenuItemJson);
+ PowerMockito.mockStatic(EPSystemProperties.class);
+ PowerMockito.mockStatic(MDC.class);
+ Mockito.when(mockedRequest.getHeader(EPSystemProperties.MDC_LOGIN_ID)).thenReturn("Login_URL");
+ Mockito.when(MDC.get(EPSystemProperties.PARTNER_NAME)).thenReturn("Test");
+ EPUser epUser = null;
+ externalAppsRestfulController.getFavoritesForUser(mockedRequest, mockedResponse);
+ }
+
+
+}
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.controller;
import static org.junit.Assert.*;
PowerMockito.mockStatic(SystemProperties.class);
Mockito.when(SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM)).thenReturn("OIDC");
ModelAndView result = loginController.login(mockedRequest);
- assertEquals(result.getViewName(),"openIdLogin") ;
+ assertEquals(result.getViewName(),"login") ;
}
@Test
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.controller;
import static org.junit.Assert.assertEquals;
ModelAndView actualModelandView = null;
Mockito.when(loginStrategy.doLogin(mockedRequest, mockedResponse)).thenReturn(expectedModelandView);
actualModelandView= oNAPLoginController.doLogin(mockedRequest, mockedResponse);
+ oNAPLoginController.setViewName("test");
+ assertEquals("test", oNAPLoginController.getViewName());
assertEquals(actualModelandView,expectedModelandView);
}
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.controller;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+
+import java.security.Principal;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
+import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.openecomp.portalapp.controller.ONAPWelcomeController;
import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
+import org.springframework.web.servlet.ModelAndView;
public class ONAPWelcomeControllerTest {
@InjectMocks
ONAPWelcomeController oNAPWelcomeController = new ONAPWelcomeController();
+ @Mock
+ Principal p;
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
{
assertEquals(oNAPWelcomeController.user(null), "oid-user");
}
-
+
+ @Test
+ public void loginTest()
+ {
+ ModelAndView expectedView = new ModelAndView();
+ expectedView.setViewName("openIdLogin");
+ ModelAndView md = oNAPWelcomeController.login(p);
+ System.out.println(md.getViewName());
+ assertEquals(md.getViewName(), expectedView.getViewName());
+ }
}
-/*package org.openecomp.portalapp.portal.controller;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.openecomp.portalapp.portal.controller;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import org.mockito.MockitoAnnotations;
import org.openecomp.portalapp.portal.domain.EPRole;
import org.openecomp.portalapp.portal.domain.EPUser;
+import org.openecomp.portalapp.portal.framework.MockEPUser;
+import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
import org.openecomp.portalapp.portal.service.AdminRolesService;
import org.openecomp.portalapp.portal.service.AdminRolesServiceImpl;
import org.openecomp.portalapp.portal.service.PortalAdminService;
import org.openecomp.portalapp.portal.service.PortalAdminServiceImpl;
-import org.openecomp.portalapp.portal.test.core.MockEPUser;
import org.openecomp.portalapp.portal.transport.FieldsValidator;
+import org.openecomp.portalapp.portal.transport.PortalAdmin;
import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.test.framework.MockitoTestSuite;
import org.openecomp.portalapp.util.EPUserUtils;
import org.openecomp.portalsdk.core.service.AuditService;
import org.openecomp.portalsdk.core.service.AuditServiceImpl;
EPUser user = mockUser.mockEPUser();
Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
- String userInfo = "1-test";
+ Long userInfo = (long) 12;
assertNull(portalAdminController.deletePortalAdmin(mockedRequest, userInfo, mockedResponse));
}
expectedFieldValidator.setFields(null);
expectedFieldValidator.setErrorCode(null);
FieldsValidator actualFieldValidator = new FieldsValidator();
- String userInfo = "1-test";
+ Long userInfo = (long) 12;
Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
- Mockito.when(portalAdminService.deletePortalAdmin((long) 1)).thenReturn(expectedFieldValidator);
+ Mockito.when(portalAdminService.deletePortalAdmin((long) 12)).thenReturn(expectedFieldValidator);
actualFieldValidator = portalAdminController.deletePortalAdmin(mockedRequest, userInfo, mockedResponse);
- assertEquals(actualFieldValidator,expectedFieldValidator);
+ assertEquals(actualFieldValidator,expectedFieldValidator);
}
EPUser user = mockUser.mockEPUser();
Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
- String userInfo = "";
+ Long userInfo = null;
assertNull(portalAdminController.deletePortalAdmin(mockedRequest, userInfo, mockedResponse));
}
List<EPRole> actualRoleList = portalAdminController.getRolesByApp(mockedRequest, appId, mockedResponse);
assertEquals(actualRoleList,expectedRoleList);
}
+
+ @Test
+ public void createPortalAdminIfUserNullTest()
+ {
+ Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(null);
+ assertNull(portalAdminController.createPortalAdmin(mockedRequest, "guestT", mockedResponse));
+ }
+
+
+ @Test
+ public void createPortalAdminIfUserIsSuperAdminTest()
+ {
+
+ EPUser user = mockUser.mockEPUser();
+ Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+ FieldsValidator expectedFieldValidator = new FieldsValidator();
+ expectedFieldValidator.setHttpStatusCode((long) 200);
+ expectedFieldValidator.setFields(null);
+ expectedFieldValidator.setErrorCode(null);
+ FieldsValidator actualFieldValidator = new FieldsValidator();
+ Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+ Mockito.when(portalAdminService.createPortalAdmin("guestT")).thenReturn(expectedFieldValidator);
+ actualFieldValidator = portalAdminController.createPortalAdmin(mockedRequest, "guestT", mockedResponse);
+ assertEquals(actualFieldValidator,expectedFieldValidator);
+ }
+
+ @Test
+ public void createPortalAdminIfUserIsNotSuperAdminTest()
+ {
+ EPUser user = mockUser.mockEPUser();
+ Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+ Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+ assertNull(portalAdminController.createPortalAdmin(mockedRequest, "guestT", mockedResponse));
+ }
+
+ @Test
+ public void getPortalAdminsIfUserNullTest()
+ {
+ Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(null);
+ assertNull(portalAdminController.getPortalAdmins(mockedRequest, mockedResponse));
+ }
+
+ @Test
+ public void getPortalAdminsIfUserAdminTest()
+ {
+ EPUser user = mockUser.mockEPUser();
+ Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+ List<PortalAdmin> portalAdmins = new ArrayList<>();
+ Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+ Mockito.when(portalAdminService.getPortalAdmins()).thenReturn(portalAdmins);
+ List<PortalAdmin> actualortalAdmins = portalAdminController.getPortalAdmins(mockedRequest, mockedResponse);
+ assertEquals(actualortalAdmins,portalAdmins);
+ }
+
+ @Test
+ public void getPortalAdminIfUserIsNotSuperAdminTest()
+ {
+ EPUser user = mockUser.mockEPUser();
+ Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+ Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+ assertNull(portalAdminController.getPortalAdmins(mockedRequest, mockedResponse));
+ }
}
-*/
\ No newline at end of file
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.framework;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.framework;
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.listener;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.service;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.openecomp.portalsdk.core.util.SystemProperties;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.MockitoAnnotations;
import org.openecomp.portalapp.portal.domain.EPApp;
import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
import org.openecomp.portalapp.service.RemoteWebServiceCallServiceImpl;
import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
import org.openecomp.portalsdk.core.service.DataAccessService;
+import org.openecomp.portalsdk.core.util.SystemProperties;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.portal.service;
import static org.junit.Assert.*;
+++ /dev/null
-//package org.openecomp.portalapp.portal.service;
-//
-//import javax.servlet.http.HttpServletRequest;
-//import javax.servlet.http.HttpServletResponse;
-//
-//import org.junit.Before;
-//import org.junit.Test;
-//import org.junit.runner.RunWith;
-//import org.mockito.InjectMocks;
-//import org.mockito.Mock;
-//import org.mockito.Mockito;
-//import org.mockito.MockitoAnnotations;
-//import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-//import org.openecomp.portalapp.portal.utils.EPSystemProperties;
-//import org.openecomp.portalsdk.core.service.DataAccessService;
-//import org.openecomp.portalsdk.core.util.SystemProperties;
-//import org.powermock.api.mockito.PowerMockito;
-//
-//import java.io.BufferedReader;
-//import java.io.IOException;
-//import java.io.InputStreamReader;
-//import java.io.UnsupportedEncodingException;
-//import java.net.HttpURLConnection;
-//import org.powermock.core.classloader.annotations.PrepareForTest;
-//import org.powermock.modules.junit4.PowerMockRunner;
-//
-//
-//@RunWith(PowerMockRunner.class)
-//@PrepareForTest({ SystemProperties.class , EPSystemProperties.class , SystemProperties.class})
-//public class UserServiceImplTest {
-//
-//
-// @InjectMocks
-// UserServiceImpl userServiceImpl = new UserServiceImpl();
-//
-// @Mock
-// DataAccessService dataAccessService;
-//
-// @Mock
-// HttpURLConnection con;
-//
-// @Before
-// public void setup() {
-// MockitoAnnotations.initMocks(this);
-// }
-//
-// MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-//
-// HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-// HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-//
-// @Test
-// public void getUserByUserIdTest() throws UnsupportedEncodingException, IOException
-// {
-// BufferedReader reader = new BufferedReader(new InputStreamReader(con.getInputStream(), "UTF-8"));
-// PowerMockito.mockStatic(SystemProperties.class);
-// PowerMockito.mockStatic(EPSystemProperties.class);
-// Mockito.when(SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM)).thenReturn("OIDC");
-// Mockito.when(EPSystemProperties.getProperty(EPSystemProperties.AUTH_USER_SERVER)).thenReturn("http://www.google.com");
-// Mockito.when(new BufferedReader(new InputStreamReader(con.getInputStream(), "UTF-8"))).thenReturn(reader).thenReturn(reader);
-// userServiceImpl.getUserByUserId("guestT");
-// }
-//}
/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * 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.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ================================================================================
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.utils;
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
- <groupId>org.openecomp.portal</groupId>
+
+ <parent>
+ <groupId>org.onap.portal</groupId>
+ <artifactId>onap-portal-parent</artifactId>
+ <version>1.3.0-SNAPSHOT</version>
+ </parent>
+
<artifactId>ecompportal-FE-os</artifactId>
- <version>1.1.0</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<configuration>
<skip>true</skip>
</configuration>
- </plugin>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
- <groupId>org.openecomp.portal</groupId>
+
+ <parent>
+ <groupId>org.onap.portal</groupId>
+ <artifactId>widget-ms-parent</artifactId>
+ <version>1.3.0-SNAPSHOT</version>
+ </parent>
+
<artifactId>common-widgets</artifactId>
- <version>1.3.0-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
- <groupId>org.openecomp.portal</groupId>
+
+ <parent>
+ <groupId>org.onap.portal</groupId>
+ <artifactId>onap-portal-parent</artifactId>
+ <version>1.3.0-SNAPSHOT</version>
+ </parent>
+
<artifactId>widget-ms-parent</artifactId>
- <version>1.3.0-SNAPSHOT</version>
<packaging>pom</packaging>
- <modules>
- <!-- Child modules do NOT name this parent. -->
- <!-- Defined for build convenience only! -->
- <!-- This POM names only ONAP projects -->
- <module>common-widgets</module>
- <module>widget-ms</module>
- </modules>
+ <modules>
+ <module>common-widgets</module>
+ <!-- The widget-ms module uses Spring; it cannot name this parent. -->
+ <module>widget-ms</module>
+ </modules>
- <build>
- <plugins>
- <!-- No deployment step for this project -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-deploy-plugin</artifactId>
- <version>2.8</version>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
+ <build>
+ <plugins>
+ <!-- No deployment step for this project -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>2.8</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
- <plugin>
- <groupId>org.jacoco</groupId>
- <artifactId>jacoco-maven-plugin</artifactId>
- <version>0.7.6.201602180812</version>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <version>0.7.6.201602180812</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ <inherited>True</inherited>
+ <executions>
+ <!-- Unit-Tests -->
+ <execution>
+ <id>prepare-agent</id>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ <phase>test</phase>
+ <configuration>
+ <destFile>${sonar.jacoco.reportPath}</destFile>
+ </configuration>
+ </execution>
+ <execution>
+ <id>report</id>
+ <goals>
+ <goal>report</goal>
+ </goals>
+ <phase>test</phase>
<configuration>
- <skip>true</skip>
+ <dataFile>${sonar.jacoco.reportPath}</dataFile>
+ <outputDirectory>${project.basedir}/target/site/jacoco</outputDirectory>
</configuration>
- <inherited>True</inherited>
- <executions>
- <!-- Unit-Tests -->
- <execution>
- <id>prepare-agent</id>
- <goals>
- <goal>prepare-agent</goal>
- </goals>
- <phase>test</phase>
- <configuration>
- <destFile>${sonar.jacoco.reportPath}</destFile>
- </configuration>
- </execution>
- <execution>
- <id>report</id>
- <goals>
- <goal>report</goal>
- </goals>
- <phase>test</phase>
- <configuration>
- <dataFile>${sonar.jacoco.reportPath}</dataFile>
- <outputDirectory>${project.basedir}/target/site/jacoco</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
- <groupId>org.openecomp.portal</groupId>
- <artifactId>widget-ms</artifactId>
- <version>1.3.0-SNAPSHOT</version>
- <packaging>jar</packaging>
- <name>widget-microservice</name>
+ <!-- This project must name Spring as parent; cannot name Portal -->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<relativePath /> <!-- lookup parent from repository -->
</parent>
+ <groupId>org.onap.portal</groupId>
+ <artifactId>widget-ms</artifactId>
+ <version>1.3.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+ <name>widget-microservice</name>
+
<properties>
<docker.imagename>widget-ms</docker.imagename>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<dependencies>
<!-- This pom pulls in artifacts -->
<dependency>
- <groupId>org.openecomp.portal</groupId>
+ <groupId>org.onap.portal</groupId>
<artifactId>common-widgets</artifactId>
<version>${project.version}</version>
<type>pom</type>
- package org.openecomp.portalapp.widget;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.openecomp.portalapp.widget;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@ComponentScan(basePackages = "org.openecomp.portalapp.widget")
public class MicroserviceApplication {
@Bean
- public RestTemplate getRestTemplate(){
+ public RestTemplate getRestTemplate() {
return new RestTemplate();
}
+
public static void main(String[] args) {
SpringApplication.run(MicroserviceApplication.class, args);
}
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.widget.constant;
public final class WidgetConstant {
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.widget.controller;
import java.io.UnsupportedEncodingException;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.widget.controller;
import javax.servlet.http.HttpServletRequest;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.widget.controller;
import java.io.IOException;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.widget.dao;
import javax.sql.DataSource;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.widget.domain;
import java.io.Serializable;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.widget.domain;
import javax.persistence.Column;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.widget.domain;
import javax.persistence.Column;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.widget.domain;
import java.io.Serializable;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.widget.domain;
public class ValidationRespond {
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.widget.domain;
import java.util.Set;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.widget.domain;
import javax.persistence.Column;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.widget.excetpion;
public class StorageException extends RuntimeException {
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.widget.excetpion;
public class StorageFileNotFoundException extends StorageException {
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.widget.filters;
import org.springframework.context.annotation.Configuration;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.widget.hibernate;
import java.util.Properties;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.widget.listener;
import org.openecomp.portalapp.widget.service.InitializationService;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.widget.service;
public interface InitializationService {
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.widget.service;
import org.openecomp.portalapp.widget.domain.MicroserviceData;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.widget.service;
import java.io.File;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.widget.service;
import java.util.List;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.widget.service.impl;
import java.io.File;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.widget.service.impl;
import java.util.List;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.widget.service.impl;
import java.io.File;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.widget.service.impl;
import java.util.List;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.widget.utils;
import java.nio.charset.Charset;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.widget.utils;
import java.io.BufferedOutputStream;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.widget.test.controller;
import static org.junit.Assert.assertEquals;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.widget.test.controller;
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the “License”);
+ * you may not use this software 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
package org.openecomp.portalapp.widget.test.service;
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
-
- <groupId>org.openecomp.portal</groupId>
- <artifactId>ecompportal-parent-project</artifactId>
- <version>0</version>
+
+ <parent>
+ <groupId>org.onap.oparent</groupId>
+ <artifactId>oparent</artifactId>
+ <version>0.1.1</version>
+ <relativePath />
+ </parent>
+
+ <groupId>org.onap.portal</groupId>
+ <artifactId>onap-portal-parent</artifactId>
+ <version>1.3.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>portal</name>
- <properties>
- <sonar.language>java</sonar.language>
- <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
- <sonar.skipDesign>true</sonar.skipDesign>
- <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports</sonar.surefire.reportsPath>
- <sonar.jacoco.reportPath>${project.basedir}/target/jacoco.exec</sonar.jacoco.reportPath>
- <sonar.jacoco.itReportPath>${project.basedir}/target/it-jacoco.exec</sonar.jacoco.itReportPath>
- <sonar.jacoco.reportMissing.force.zero>true</sonar.jacoco.reportMissing.force.zero>
- <sonar.projectVersion>${project.version}</sonar.projectVersion>
- <sonar.skipDesign>true</sonar.skipDesign>
- <sonar.projectBaseDir>${project.basedir}</sonar.projectBaseDir>
- <sonar.exclusions>**/scripts/**/*,**.js</sonar.exclusions>
- <sonar.test.exclusions>**/test/**/*,**/tests/**/*</sonar.test.exclusions>
- <sonar.java.binaries>.</sonar.java.binaries>
- </properties>
-
- <modules>
- <!-- Child modules do NOT name this parent. -->
- <!-- Defined for build convenience only! -->
- <!-- This POM names only ONAP projects -->
+ <modules>
+ <!-- This parent POM names only ONAP projects -->
<module>ecomp-portal-BE-common</module>
- <module>ecomp-portal-BE-os</module>
-<!-- <module>ecomp-portal-BE-common-test</module> -->
+ <module>ecomp-portal-BE-os</module>
<module>ecomp-portal-FE-os</module>
<module>ecomp-portal-widget-ms</module>
</modules>
+ <properties>
+ <!-- Jenkins SHOULD invoke mvn with argument -Dbuild.number=${BUILD_NUMBER} -->
+ <build.number>0</build.number>
+ <epsdk.version>1.3.0</epsdk.version>
+ <springframework.version>4.2.0.RELEASE</springframework.version>
+ <hibernate.version>4.3.11.Final</hibernate.version>
+ <fasterxml.version>2.7.4</fasterxml.version>
+ <eelf.version>1.0.0</eelf.version>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <encoding>UTF-8</encoding>
+ <sonar.language>java</sonar.language>
+ <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
+ <sonar.skipDesign>true</sonar.skipDesign>
+ <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports</sonar.surefire.reportsPath>
+ <sonar.jacoco.reportPath>${project.basedir}/target/jacoco.exec</sonar.jacoco.reportPath>
+ <sonar.jacoco.itReportPath>${project.basedir}/target/it-jacoco.exec</sonar.jacoco.itReportPath>
+ <sonar.jacoco.reportMissing.force.zero>true</sonar.jacoco.reportMissing.force.zero>
+ <sonar.projectVersion>${project.version}</sonar.projectVersion>
+ <sonar.skipDesign>true</sonar.skipDesign>
+ <sonar.projectBaseDir>${project.basedir}</sonar.projectBaseDir>
+ <sonar.exclusions>**/scripts/**/*,**.js</sonar.exclusions>
+ <sonar.test.exclusions>**/test/**/*,**/tests/**/*</sonar.test.exclusions>
+ <sonar.java.binaries>.</sonar.java.binaries>
+ </properties>
+
+ <!-- Specify the repositories here to avoid coordination of ~/.m2/settings.xml files
+ among all developers. Also use values (not properties) so oparent can be resolved.
+ -->
+ <repositories>
+ <repository>
+ <id>onap-releases</id>
+ <name>ONAP - Release Repository</name>
+ <url>https://nexus.onap.org/content/repositories/releases</url>
+ </repository>
+ <repository>
+ <id>onap-staging</id>
+ <name>ONAP - Staging Repository</name>
+ <url>https://nexus.onap.org/content/repositories/staging</url>
+ </repository>
+ <repository>
+ <id>onap-snapshots</id>
+ <name>ONAP - Snapshot Repository</name>
+ <url>https://nexus.onap.org/content/repositories/snapshots</url>
+ </repository>
+ <repository>
+ <id>onap-public</id>
+ <url>https://nexus.onap.org/content/groups/public</url>
+ </repository>
+ </repositories>
+
+ <!-- Specify the repositories here to avoid coordination of ~/.m2/settings.xml files
+ among all developers. -->
+ <pluginRepositories>
+ <pluginRepository>
+ <id>onap-plugin-release</id>
+ <url>https://nexus.onap.org/content/repositories/releases/</url>
+ </pluginRepository>
+ <pluginRepository>
+ <id>onap-plugin-staging</id>
+ <url>https://nexus.onap.org/content/repositories/staging/</url>
+ </pluginRepository>
+ <pluginRepository>
+ <id>onap-plugin-snapshots</id>
+ <url>https://nexus.onap.org/content/repositories/snapshots/</url>
+ </pluginRepository>
+ </pluginRepositories>
+
+ <profiles>
+ <!-- disable doclint, a new feature in Java 8, when generating javadoc -->
+ <profile>
+ <id>doclint-java8-disable</id>
+ <activation>
+ <jdk>[1.8,)</jdk>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>3.0.0-M1</version>
+ <configuration>
+ <additionalparam>-Xdoclint:none</additionalparam>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ </profiles>
+
<build>
<pluginManagement>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.1</version>
- <configuration>
- <source>1.8</source>
- <target>1.8</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.sonarsource.scanner.maven</groupId>
- <artifactId>sonar-maven-plugin</artifactId>
- <version>3.0.2</version>
- </plugin>
- </plugins>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.1</version>
+ <configuration>
+ <source>1.8</source>
+ <target>1.8</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.sonarsource.scanner.maven</groupId>
+ <artifactId>sonar-maven-plugin</artifactId>
+ <version>3.0.2</version>
+ </plugin>
+ </plugins>
</pluginManagement>
<plugins>
- <!-- No deployment step for this project -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-deploy-plugin</artifactId>
- <version>2.8</version>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.jacoco</groupId>
- <artifactId>jacoco-maven-plugin</artifactId>
- <version>0.7.6.201602180812</version>
- <inherited>True</inherited>
- <executions>
- <!-- Unit-Tests -->
- <execution>
- <id>prepare-agent</id>
- <goals>
- <goal>prepare-agent</goal>
- </goals>
- <configuration>
- <destFile>${sonar.jacoco.reportPath}</destFile>
- </configuration>
- </execution>
- <execution>
- <id>report</id>
- <goals>
- <goal>report</goal>
- </goals>
- <configuration>
- <dataFile>${sonar.jacoco.reportPath}</dataFile>
- <outputDirectory>${project.basedir}/target/site/jacoco</outputDirectory>
- </configuration>
- </execution>
- <!-- Integration Tests (Only report goal) -->
- <execution>
- <id>report-integration</id>
- <goals>
- <goal>report-integration</goal>
- </goals>
- <configuration>
- <dataFile>${sonar.jacoco.itReportPath}</dataFile>
- <outputDirectory>${project.basedir}/target/site/it-jacoco</outputDirectory>
- </configuration>
- </execution>
- <execution>
- <id>default-instrument</id>
- <goals>
- <goal>instrument</goal>
- </goals>
- <configuration>
- <skip>${skipTests}</skip>
- </configuration>
- </execution>
- <execution>
- <id>default-restore-instrumented-classes</id>
- <goals>
- <goal>restore-instrumented-classes</goal>
- </goals>
- <configuration>
- <skip>${skipTests}</skip>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
-</build>
- <dependencies>
- <dependency>
- <groupId>org.jacoco</groupId>
- <artifactId>jacoco-maven-plugin</artifactId>
- <version>0.7.6.201602180812</version>
- </dependency>
- </dependencies>
-</project>
\ No newline at end of file
+ <!-- No deployment step for this project -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>2.8</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <distributionManagement>
+ <site>
+ <id>ecomp-site</id>
+ <url>dav:https://nexus.onap.org/content/sites/site/org/onap/portal/${project.version}</url>
+ </site>
+ </distributionManagement>
+
+</project>
# because they are used in Jenkins, whose plug-in doesn't support
major=1
-minor=1
+minor=3
patch=0
base_version=${major}.${minor}.${patch}