aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzhangab <zhanganbing@chinamobile.com>2018-03-28 14:48:31 +0800
committerzhangab <zhanganbing@chinamobile.com>2018-03-28 14:48:34 +0800
commit407ed4524b1799c8c911935085b91b0f889d3f3c (patch)
tree1615654faf283020d61aae4db5e2382febbcac4f
parent24615aba39a7dcb0f45141553d625ec2a62a811c (diff)
improve sonar coverage for uui-sonar
Change-Id: I0a02cc7a7e6703bcdf3bf636d0cb19aca6fbcc88 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.java8
1 files changed, 3 insertions, 5 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 75c996ee..70b2bad0 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
@@ -52,6 +52,7 @@ public class AlarmsHeaderServiceImplTest {
public void after() throws Exception {
}
+ private Session session;
/**
*
* Method: saveAlarmsHeader(AlarmsHeader alarmsHeader)
@@ -88,13 +89,10 @@ public void testSaveAlarmsHeader() throws Exception {
a.setUpdateTime(DateUtils.now());
a.setVersion("va2");
- MockUp<Session> mockedSession = new MockUp<Session>() {
- };
-
new MockUp<SessionFactory>() {
@Mock
- private Session openSession() {
- return mockedSession.getMockInstance();
+ public Session openSession() {
+ return session;
}
};