import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
-import org.springframework.orm.hibernate4.HibernateTransactionManager;
-import org.springframework.orm.hibernate4.LocalSessionFactoryBean;
+import org.springframework.orm.hibernate5.HibernateTransactionManager;
+import org.springframework.orm.hibernate5.LocalSessionFactoryBean;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import com.mchange.v2.c3p0.ComboPooledDataSource;
import java.util.Map;
import org.hibernate.Criteria;
-import org.hibernate.Query;
-import org.hibernate.SQLQuery;
+import org.hibernate.query.Query;
+import org.hibernate.query.NativeQuery;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.Criterion;
@Test
public void getLookupListTest() {
Session mockedSession = Mockito.mock(Session.class);
- SQLQuery mockSQLQuery = Mockito.mock(SQLQuery.class);
+ NativeQuery mockSQLQuery = Mockito.mock(NativeQuery.class);
Mockito.when(sessionFactory.getCurrentSession()).thenReturn(mockedSession);
Mockito.when(mockedSession.createSQLQuery(Mockito.anyString())).thenReturn(mockSQLQuery);
Mockito.when(mockSQLQuery.list()).thenReturn(new ArrayList());
@Test
public void executeSQLQueryWithoutRangeTest() {
Session mockedSession = Mockito.mock(Session.class);
- SQLQuery mockSQLQuery = Mockito.mock(SQLQuery.class);
+ NativeQuery mockSQLQuery = Mockito.mock(NativeQuery.class);
Mockito.when(sessionFactory.getCurrentSession()).thenReturn(mockedSession);
Mockito.when(mockedSession.createSQLQuery(Mockito.anyString())).thenReturn(mockSQLQuery);
Mockito.when(mockSQLQuery.addEntity("org.onap.portalsdk.core.domain.support.domainvo", DomainVo.class))
@Test
public void executeSQLQueryTest() {
Session mockedSession = Mockito.mock(Session.class);
- SQLQuery mockSQLQuery = Mockito.mock(SQLQuery.class);
+ NativeQuery mockSQLQuery = Mockito.mock(NativeQuery.class);
Mockito.when(sessionFactory.getCurrentSession()).thenReturn(mockedSession);
Mockito.when(mockedSession.createSQLQuery(Mockito.anyString())).thenReturn(mockSQLQuery);
Mockito.when(mockSQLQuery.addEntity("org.onap.portalsdk.core.domain.support.domainvo", DomainVo.class))
<properties>
<encoding>UTF-8</encoding>
- <springframework.version>4.3.24.RELEASE</springframework.version>
- <hibernate.version>4.3.11.Final</hibernate.version>
+ <springframework.version>5.2.8.RELEASE</springframework.version>
+ <hibernate.version>5.4.3.Final</hibernate.version>
<skiptests>false</skiptests>
<nexusproxy>https://nexus.onap.org</nexusproxy>
<snapshotNexusPath>content/repositories/snapshots/</snapshotNexusPath>