summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzhangab <zhanganbing@chinamobile.com>2018-03-28 21:42:52 +0800
committerzhangab <zhanganbing@chinamobile.com>2018-03-28 21:42:55 +0800
commitf9f939f486195c7fec36ccd6d20ac950b886f4de (patch)
treea39521e957b22a284a5e2f7c2d25394034a4338f
parent5e19edb862d836c545a84e6f2b0b6006fbd76cc4 (diff)
improve sonar coverage for uui-server
Change-Id: I734f068d6e6532e629f640d1e6537cdb7ed4d48c Issue-ID: USECASEUI-103 Signed-off-by: zhangab <zhanganbing@chinamobile.com>
-rwxr-xr-xserver/src/main/java/org/onap/usecaseui/server/service/impl/AlarmsHeaderServiceImpl.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/src/main/java/org/onap/usecaseui/server/service/impl/AlarmsHeaderServiceImpl.java b/server/src/main/java/org/onap/usecaseui/server/service/impl/AlarmsHeaderServiceImpl.java
index 37de24db..3b751452 100755
--- a/server/src/main/java/org/onap/usecaseui/server/service/impl/AlarmsHeaderServiceImpl.java
+++ b/server/src/main/java/org/onap/usecaseui/server/service/impl/AlarmsHeaderServiceImpl.java
@@ -47,9 +47,12 @@ public class AlarmsHeaderServiceImpl implements AlarmsHeaderService {
@Autowired
private SessionFactory sessionFactory;
+ private Session getSession() {
+ return sessionFactory.openSession();
+ }
public String saveAlarmsHeader(AlarmsHeader alarmsHeader) {
- try(Session session = sessionFactory.openSession();){
+ try(Session session = getSession()){
if (null == alarmsHeader) {
logger.error("AlarmsHeaderServiceImpl saveAlarmsHeader alarmsHeader is null!");
}