@@ -33,7 +33,6 @@ void test() {
33
33
try (SqlSession sqlSession = sqlSessionFactory .openSession ()){
34
34
UserDao mapper = sqlSession .getMapper (UserDao .class );
35
35
List <User > users = mapper .flindAll ();
36
- System .out .println (users );
37
36
Assertions .assertNotNull (users , "users must not be null" );
38
37
Assertions .assertEquals (4 , users .size (), "should return 4 results" );
39
38
Assertions .assertEquals (2 , users .get (0 ).getRoles ().size (), "should have 2 roles" );
@@ -45,11 +44,22 @@ void test2() {
45
44
try (SqlSession sqlSession = sqlSessionFactory .openSession ()){
46
45
UserDao mapper = sqlSession .getMapper (UserDao .class );
47
46
List <User > users = mapper .flindAll2 ();
48
- System .out .println (users );
49
47
Assertions .assertNotNull (users , "users must not be null" );
50
48
Assertions .assertEquals (4 , users .size (), "should return 4 results" );
51
49
Assertions .assertEquals (2 , users .get (0 ).getRoles ().size (), "should have 2 roles" );
52
50
}
53
51
}
54
52
53
+ @ Test
54
+ void test3 () {
55
+ try (SqlSession sqlSession = sqlSessionFactory .openSession ()){
56
+ UserDao mapper = sqlSession .getMapper (UserDao .class );
57
+ List <User > users = mapper .flindAll3 ();
58
+ Assertions .assertNotNull (users , "users must not be null" );
59
+ Assertions .assertEquals (2 , users .size (), "should return 2 results" );
60
+ Assertions .assertEquals (1 , users .get (0 ).getRoles ().size (), "should have 1 roles" );
61
+ Assertions .assertEquals ("老师" , users .get (0 ).getRoles ().get (0 ).getRoleName (), "should have 1 roles" );
62
+ }
63
+ }
64
+
55
65
}
0 commit comments