use of org.apache.ibatis.domain.blog.DraftPost in project mybatis-3 by mybatis.
the class BindingTest method shouldSelectDraftTypedPostsWithResultMap.
@Test
void shouldSelectDraftTypedPostsWithResultMap() {
try (SqlSession session = sqlSessionFactory.openSession()) {
BoundBlogMapper mapper = session.getMapper(BoundBlogMapper.class);
List<Post> posts = mapper.selectPostsWithResultMap();
assertEquals(5, posts.size());
assertTrue(posts.get(0) instanceof DraftPost);
assertFalse(posts.get(1) instanceof DraftPost);
assertTrue(posts.get(2) instanceof DraftPost);
assertFalse(posts.get(3) instanceof DraftPost);
assertFalse(posts.get(4) instanceof DraftPost);
}
}
use of org.apache.ibatis.domain.blog.DraftPost in project mybatis-3 by mybatis.
the class BindingTest method shouldSelectDraftTypedPosts.
@Test
void shouldSelectDraftTypedPosts() {
try (SqlSession session = sqlSessionFactory.openSession()) {
BoundBlogMapper mapper = session.getMapper(BoundBlogMapper.class);
List<Post> posts = mapper.selectPosts();
assertEquals(5, posts.size());
assertTrue(posts.get(0) instanceof DraftPost);
assertFalse(posts.get(1) instanceof DraftPost);
assertTrue(posts.get(2) instanceof DraftPost);
assertFalse(posts.get(3) instanceof DraftPost);
assertFalse(posts.get(4) instanceof DraftPost);
}
}
Aggregations