summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-os
diff options
context:
space:
mode:
authorHima Elisetty <hbindu@research.att.com>2018-01-12 10:36:42 -0500
committerHima Elisetty <hbindu@research.att.com>2018-01-17 12:08:18 -0500
commit1298fd26f37cd451cbf1adbea68b98151662e796 (patch)
treeca09e0586c1d0d401841fc6e12228e4dbc7f2f6f /ecomp-sdk/epsdk-app-os
parent304033445a8333cd088910fc3e43ca9222237816 (diff)
Introduce JUNIT Plumbing
Issue-ID: PORTAL-161, PORTAL-160, PORTAL-159 Includes Change in encryption and decryption algorithm Change-Id: I5f379d6d9ac25536744152ac1d61223a52f1ce7f Signed-off-by: Hima Elisetty <hbindu@research.att.com>
Diffstat (limited to 'ecomp-sdk/epsdk-app-os')
-rw-r--r--ecomp-sdk/epsdk-app-os/README.md8
-rw-r--r--ecomp-sdk/epsdk-app-os/db-scripts/EcompSdkDMLMySql_2_1_OS.sql12
-rw-r--r--ecomp-sdk/epsdk-app-os/pom.xml73
-rw-r--r--ecomp-sdk/epsdk-app-os/src/main/java/org/onap/portalapp/login/LoginStrategyImpl.java2
-rw-r--r--ecomp-sdk/epsdk-app-os/src/main/webapp/WEB-INF/fusion/jsp/ds2/left-menu.jsp9
5 files changed, 85 insertions, 19 deletions
diff --git a/ecomp-sdk/epsdk-app-os/README.md b/ecomp-sdk/epsdk-app-os/README.md
index daf03237..f74d043f 100644
--- a/ecomp-sdk/epsdk-app-os/README.md
+++ b/ecomp-sdk/epsdk-app-os/README.md
@@ -13,7 +13,13 @@ https://www.eclipse.org/m2e-wtp/
## Release Notes
-Version 1.4.0, <?day> <?month> 2017
+Version 2.1.0
+- PORTAL 161 Refer epsdk-app-common
+- PORTAL 160 Refer epsdk-app-common
+- PORTAL 159 Refer epsdk-app-common
+- PORTAL 136 Junits for SDK
+
+Version 1.4.0
- PORTAL-19 Rename Java package base to org.onap
- PORTAL-42 Use OParent as parent POM
- PORTAL-72 Address Sonar Scan code issues
diff --git a/ecomp-sdk/epsdk-app-os/db-scripts/EcompSdkDMLMySql_2_1_OS.sql b/ecomp-sdk/epsdk-app-os/db-scripts/EcompSdkDMLMySql_2_1_OS.sql
index 91402fb0..cb4a3085 100644
--- a/ecomp-sdk/epsdk-app-os/db-scripts/EcompSdkDMLMySql_2_1_OS.sql
+++ b/ecomp-sdk/epsdk-app-os/db-scripts/EcompSdkDMLMySql_2_1_OS.sql
@@ -36,16 +36,4 @@ Insert into fn_app (APP_ID,APP_NAME,APP_IMAGE_URL,APP_DESCRIPTION,APP_NOTES,APP_
-- fn_user_role
Insert into fn_user_role (USER_ID,ROLE_ID,PRIORITY,APP_ID) values (1,1,null,1);
--- fn_restricted_url
-insert into fn_restricted_url values('admin','menu_admin');
-insert into fn_restricted_url values('get_role','menu_admin');
-insert into fn_restricted_url values('get_role_functions','menu_admin');
-insert into fn_restricted_url values('role_list/*','menu_admin');
-insert into fn_restricted_url values('role_function_list/*','menu_admin');
-insert into fn_restricted_url values('addRole','menu_admin');
-insert into fn_restricted_url values('addRoleFunction','menu_admin');
-insert into fn_restricted_url values('removeRole','menu_admin');
-insert into fn_restricted_url values('removeRoleFunction','menu_admin');
-insert into fn_restricted_url values('profile/*','menu_admin');
-
commit;
diff --git a/ecomp-sdk/epsdk-app-os/pom.xml b/ecomp-sdk/epsdk-app-os/pom.xml
index db0a455f..de941b35 100644
--- a/ecomp-sdk/epsdk-app-os/pom.xml
+++ b/ecomp-sdk/epsdk-app-os/pom.xml
@@ -26,7 +26,8 @@
<!-- Skip assembling the zip; assemble via mvn -Dskipassembly=false .. -->
<skipassembly>true</skipassembly>
<!-- Tests usually require some setup that maven cannot do, so skip. -->
- <skiptests>true</skiptests>
+ <skiptests>false</skiptests>
+ <jacoco.version>0.7.9</jacoco.version>
<!-- Version number gets stored only here -->
<tomcat.download.path>http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.37/bin</tomcat.download.path>
<tomcat.download.name>apache-tomcat-8.0.37</tomcat.download.name>
@@ -60,7 +61,68 @@
</systemPropertyVariables>
</configuration>
</plugin>
-
+
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <!-- version managed by oparent ${jacocoVersion}</version> -->
+ <executions>
+ <!-- disable jacoco executions from oparent -->
+ <execution>
+ <id>pre-unit-test</id>
+ <phase>none</phase>
+ </execution>
+ <execution>
+ <id>post-unit-test</id>
+ <phase>none</phase>
+ </execution>
+ <execution>
+ <id>pre-integration-test</id>
+ <phase>none</phase>
+ </execution>
+ <execution>
+ <id>post-integration-test</id>
+ <phase>none</phase>
+ </execution>
+ <!-- Order matters -->
+ <execution>
+ <id>portal-prepare-agent</id>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ <configuration>
+ <destFile>${sonar.jacoco.reportPath}</destFile>
+ </configuration>
+ </execution>
+ <!-- offline instrumentation for PowerMock -->
+ <execution>
+ <id>portal-offline-instrument</id>
+ <goals>
+ <goal>instrument</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>portal-restore-instrumented-classes</id>
+ <phase>test</phase>
+ <goals>
+ <goal>restore-instrumented-classes</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>portal-post-unit-test</id>
+ <phase>test</phase>
+ <goals>
+ <goal>report</goal>
+ </goals>
+ <configuration>
+ <dataFile>${sonar.jacoco.reportPath}</dataFile>
+ <outputDirectory>${project.basedir}/target/site/jacoco</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+
<!-- add version number to manifest -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -293,5 +355,12 @@
<artifactId>spring-webmvc</artifactId>
<version>${springframework.version}</version>
</dependency>
+ <!-- Jacoco for offline instrumentation -->
+ <dependency>
+ <groupId>org.jacoco</groupId>
+ <artifactId>org.jacoco.agent</artifactId>
+ <version>${jacoco.version}</version>
+ <classifier>runtime</classifier>
+ </dependency>
</dependencies>
</project>
diff --git a/ecomp-sdk/epsdk-app-os/src/main/java/org/onap/portalapp/login/LoginStrategyImpl.java b/ecomp-sdk/epsdk-app-os/src/main/java/org/onap/portalapp/login/LoginStrategyImpl.java
index 729cfd1f..b0826f68 100644
--- a/ecomp-sdk/epsdk-app-os/src/main/java/org/onap/portalapp/login/LoginStrategyImpl.java
+++ b/ecomp-sdk/epsdk-app-os/src/main/java/org/onap/portalapp/login/LoginStrategyImpl.java
@@ -103,7 +103,7 @@ public class LoginStrategyImpl extends LoginStrategy {
if (!SystemProperties.containsProperty(SystemProperties.Decryption_Key))
throw new IllegalStateException("Failed to find property " + SystemProperties.Decryption_Key);
final String decryptionKey = SystemProperties.getProperty(SystemProperties.Decryption_Key);
- userId = CipherUtil.decrypt(cookieValue, decryptionKey);
+ userId = CipherUtil.decryptPKC(cookieValue, decryptionKey);
logger.debug(EELFLoggerDelegate.debugLogger, "getUserIdFromCookie: decrypted as {}", userId);
}
return userId;
diff --git a/ecomp-sdk/epsdk-app-os/src/main/webapp/WEB-INF/fusion/jsp/ds2/left-menu.jsp b/ecomp-sdk/epsdk-app-os/src/main/webapp/WEB-INF/fusion/jsp/ds2/left-menu.jsp
index c0e1b6e3..5cafe15c 100644
--- a/ecomp-sdk/epsdk-app-os/src/main/webapp/WEB-INF/fusion/jsp/ds2/left-menu.jsp
+++ b/ecomp-sdk/epsdk-app-os/src/main/webapp/WEB-INF/fusion/jsp/ds2/left-menu.jsp
@@ -298,8 +298,11 @@
$scope.getUserNameFromSession = function(){
UserInfoService.getFunctionalMenuStaticDetailSession()
.then(function (res) {
- $scope.userProfile.firstName = res.firstName;
- $scope.redirectUrl = res.portalUrl;
+ $scope.userProfile.firstName = res.firstName;
+ $scope.userProfile.lastName = res.lastName;
+ $scope.userProfile.email = res.email;
+ $scope.userProfile.fullName = res.userName;
+ $scope.redirectUrl = res.portalUrl;
});
}
$scope.getTopMenuStaticInfo=function() {
@@ -389,7 +392,7 @@
console.log('getAppName failed', error);
});
- $scope.getTopMenuStaticInfo();
+ $scope.getUserNameFromSession();
$scope.getMenu=function() {
$http({