UserDao implements GenericDao<UserDetail> { public List<UserDetail> getAll() { UserDetailRowMapper rowMapper = new UserDetailRowMapper(); return jdbcTemplate.query(GET_ALL_OBJECTS_QUERY, rowMapper); } UserDao(); UserDetail get(Long id); int save(UserDetail userDetail); int delete(UserDetail userDetail); int update(UserDetail userDetail); List<UserDetail> getAll(); JdbcTemplate getJdbcTemplate(); List<UserDetail> find(String query);  }
@Test public void testMethodBasedRecording() { System.out.println("Inside testMethodBasedRecording"); MethodMocktail methodMocktail = new MethodMocktail(); methodMocktail.setUp(this); List<UserDetail> userDetails = userDao.getAll(); assertThat(1, is(userDetails.size())); insertAnotherRow(); userDetails = userDao.getAll(); assertThat(2, is(userDetails.size())); methodMocktail.close(); }