From b40ac12d6231f261581fb4281c905819530e934d Mon Sep 17 00:00:00 2001 From: whyclxw <http://whyclxw@118.89.139.230:10101/r/~whyclxw/IdeaTest.git> Date: 星期四, 15 四月 2021 15:40:03 +0800 Subject: [PATCH] 提交 --- src/test/java/com/example/lxw/MpperTest.java | 12 +++++------- 1 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/test/java/com/example/lxw/MpperTest.java b/src/test/java/com/example/lxw/MpperTest.java index a2f7248..e55c807 100644 --- a/src/test/java/com/example/lxw/MpperTest.java +++ b/src/test/java/com/example/lxw/MpperTest.java @@ -6,26 +6,24 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.SpringApplication; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.context.ConfigurableApplicationContext; import org.springframework.test.context.junit4.SpringRunner; -import javax.annotation.Resource; import java.util.List; /** * @author lxw * @create 2021-04-14 10:20 */ -@SpringBootTest +@RunWith(SpringRunner.class) +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) public class MpperTest { - @Resource - private User_InfMapper mapper; + @Autowired + private User_InfMapper user_infMapper; @Test public void searchAll(){ - List<User_inf> list= mapper.selectList(new QueryWrapper<>()); + List<User_inf> list= user_infMapper.selectList(new QueryWrapper<>()); list.forEach(uinf-> System.out.println(uinf.toString())); } @Test -- Gitblit v1.9.1