aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzhangab <zhanganbing@chinamobile.com>2018-03-27 16:47:51 +0800
committerzhangab <zhanganbing@chinamobile.com>2018-03-27 16:48:00 +0800
commit3d9adc3b8665af8e704a6bcd1a2d1c27aae6d9d2 (patch)
treea962945199b32d5d7cc50a0c872d55350fcc6dae
parent1263b3ed40c97fd0fb6af16086b49a5dd7fc3c4b (diff)
improve sonar coverage for uui-server
Change-Id: I9dc4f1659d3868967625a1cd5f47f770a178e9b3 Issue-ID: USECASEUI-103 Signed-off-by: zhangab <zhanganbing@chinamobile.com>
-rw-r--r--server/src/test/java/org/onap/usecaseui/server/service/impl/AlarmsHeaderServiceImplTest.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/server/src/test/java/org/onap/usecaseui/server/service/impl/AlarmsHeaderServiceImplTest.java b/server/src/test/java/org/onap/usecaseui/server/service/impl/AlarmsHeaderServiceImplTest.java
index 9016200f..cc267548 100644
--- a/server/src/test/java/org/onap/usecaseui/server/service/impl/AlarmsHeaderServiceImplTest.java
+++ b/server/src/test/java/org/onap/usecaseui/server/service/impl/AlarmsHeaderServiceImplTest.java
@@ -31,7 +31,8 @@ import org.springframework.test.context.web.WebAppConfiguration;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;
-import org.hibernate.SessionFactory;
+import org.hibernate.*;
+import org.hibernate.cfg.*;
/**
* AlarmsHeaderServiceImpl Tester.
@@ -42,15 +43,16 @@ import org.hibernate.SessionFactory;
*/
public class AlarmsHeaderServiceImplTest {
- @Autowired
- private SessionFactory sessionFactory;
+ private static SessionFactory sessionFactory;
@Before
public void before() throws Exception {
+ sessionFactory = new Configuration().configure().buildSessionFactory();
}
@After
-public void after() throws Exception {
+public void after() throws Exception {
+ sessionFactory.close();
}
/**