現(xiàn)象:
@RunWith(SpringRunner.class)
//@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = SmartcardApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class ApiTest1ControllerTest {
@Autowired
private TSeedBaseService tSeedBaseService;
@Test
public void helloWorld() {
TSeedBase tSeedBase = tSeedBaseService.selectByPrimaryKey(123);
System.out.println("tSeedBase="+tSeedBase);
System.out.println("456");
}
}
運(yùn)行報(bào)錯(cuò):
image.png
image.png
原因:
原來(lái)是pom.xml中只寫(xiě)了<version>RELEASE</version>,而maven庫(kù)中各種版本枷邪,導(dǎo)致找不到對(duì)應(yīng)的jar包
image.png