springboot 下測試 service中的方法

@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = AccountPlatApplication.class) //AccountPlatApplication 爲啓動類 code

public class NCTest2 {
@Autowired
private NcService ncService; //注入調用方法所在的類 blog

@Test
public void test1() { //執行方法
ncService.enterAccount();
}
}it

相關文章
相關標籤/搜索