@Test public void getAllAuthorsCount() throws Exception { Assert.assertEquals(true, authorService.getAllAuthorsCount() > 0); }
@Override public int getAllAuthorsCount() { SqlSession sqlSession = null; try { sqlSession = MybatisUtil.getSqlSession(); AuthorMapper authorMapper = sqlSession.getMapper(AuthorMapper.class); return authorMapper.getAllAuthorsCount(); } finally { if (sqlSession != null) { sqlSession.close(); } } }
AuthorServiceImpl implements AuthorService { @Override public int getAllAuthorsCount() { SqlSession sqlSession = null; try { sqlSession = MybatisUtil.getSqlSession(); AuthorMapper authorMapper = sqlSession.getMapper(AuthorMapper.class); return authorMapper.getAllAuthorsCount(); } finally { if (sqlSession != null) { sqlSession.close(); } } } }
AuthorServiceImpl implements AuthorService { @Override public int getAllAuthorsCount() { SqlSession sqlSession = null; try { sqlSession = MybatisUtil.getSqlSession(); AuthorMapper authorMapper = sqlSession.getMapper(AuthorMapper.class); return authorMapper.getAllAuthorsCount(); } finally { if (sqlSession != null) { sqlSession.close(); } } }  }
AuthorServiceImpl implements AuthorService { @Override public int getAllAuthorsCount() { SqlSession sqlSession = null; try { sqlSession = MybatisUtil.getSqlSession(); AuthorMapper authorMapper = sqlSession.getMapper(AuthorMapper.class); return authorMapper.getAllAuthorsCount(); } finally { if (sqlSession != null) { sqlSession.close(); } } }  @Override int addAuthor(Author author); @Override int deleteAuthor(int authorId); @Override int updateAuthor(Author author); @Override List<Author> getAllAuthors(); @Override int getAllAuthorsCount(); }
AuthorServiceImpl implements AuthorService { @Override public int getAllAuthorsCount() { SqlSession sqlSession = null; try { sqlSession = MybatisUtil.getSqlSession(); AuthorMapper authorMapper = sqlSession.getMapper(AuthorMapper.class); return authorMapper.getAllAuthorsCount(); } finally { if (sqlSession != null) { sqlSession.close(); } } }  @Override int addAuthor(Author author); @Override int deleteAuthor(int authorId); @Override int updateAuthor(Author author); @Override List<Author> getAllAuthors(); @Override int getAllAuthorsCount();  }