How to use mockito for testing Database connection
问题 I am using Junit to test my jersey api. I want to test DAO without a database. I tried using Mockito but still not able to use mock object to test the DAO which contains Hibernate calls to DB. I want to write Junit for my Helper class which calls the DAO.Can anyone provide a solution with some sample code to mock the DB Connections in DAO. EDIT : Status.java @GET @Produces(MediaType.TEXT_PLAIN) public String getDBValue() throws SQLException { DatabaseConnectionDAO dbConnectiondao = new