X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=POLICY-SDK-APP%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2FdaoImp%2FSystemLogDbDaoImplTest.java;h=44f034c20e675e93235d50e308bed8b0e0531d32;hb=refs%2Fchanges%2F39%2F100439%2F2;hp=5675d3fc9f573ae9a524e7a004d670c6c23de4b8;hpb=c8856ab39a6d8376e6ad700b6acabdc7736c714f;p=policy%2Fengine.git diff --git a/POLICY-SDK-APP/src/test/java/org/onap/policy/daoImp/SystemLogDbDaoImplTest.java b/POLICY-SDK-APP/src/test/java/org/onap/policy/daoImp/SystemLogDbDaoImplTest.java index 5675d3fc9..44f034c20 100644 --- a/POLICY-SDK-APP/src/test/java/org/onap/policy/daoImp/SystemLogDbDaoImplTest.java +++ b/POLICY-SDK-APP/src/test/java/org/onap/policy/daoImp/SystemLogDbDaoImplTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP Policy Engine * ================================================================================ - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2019-2020 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. @@ -25,6 +25,8 @@ import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.when; import java.util.List; + +import org.hibernate.HibernateException; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; @@ -50,8 +52,8 @@ public class SystemLogDbDaoImplTest { when(sfMock.openSession()).thenReturn(mockSession); when(mockSession.beginTransaction()).thenReturn(mockTransaction); - doThrow(Exception.class).when(mockTransaction).commit(); - when(mockSession.close()).thenThrow(Exception.class); + doThrow(HibernateException.class).when(mockTransaction).commit(); + when(mockSession.close()).thenThrow(HibernateException.class); PolicyController.setjUnit(true); }