44import org .database .demo .entity .Order ;
55import org .junit .jupiter .api .Test ;
66import org .junit .jupiter .api .extension .ExtendWith ;
7+ import org .mockito .internal .matchers .Or ;
78import org .mybatis .spring .annotation .MapperScan ;
89import org .springframework .beans .factory .annotation .Autowired ;
910import org .springframework .boot .test .context .SpringBootTest ;
1011import org .springframework .test .context .junit .jupiter .SpringExtension ;
1112
13+ import java .util .HashMap ;
14+ import java .util .List ;
15+
1216@ SpringBootTest
1317@ ExtendWith (SpringExtension .class )
1418@ MapperScan (basePackages = "org.database.demo.dao" )
@@ -19,7 +23,14 @@ public class OrderTest {
1923
2024 @ Test
2125 public void test (){
22- Order order = new Order (1 , 1 );
23- int num = orderDao .insertOne (order );
26+ // Order order = new Order(1, 2);
27+ // int num = orderDao.insertOne(order);
28+
29+ HashMap <String , Object > condition = new HashMap <>(1 );
30+ condition .put ("user_id" ,1 );
31+ List <HashMap <String , Object >> list = orderDao .query (condition );
32+ list .forEach (System .out ::println );
33+ Order order = new Order (1 , 3 );
34+ int num1 = orderDao .update (order );
2435 }
2536}
0 commit comments