Any idea why the following mocking code does not work?
org.hibernate.SessionFactory sessionFactory = Mockito.mock(SessionFactory.class);
org.hibernate.Session session = Mockito.mock(Session.class);
Mockito.when(sessionFactory.getCurrentSession()).thenReturn(session);
The thenReturn statement does not compile. "The method thenReturn(Session) in the type OngoingStubbing is not applicable for the arguments (Session)" But, why is it not applicable? I think I have the imports figured out correctly.