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

相关文章
相关标签/搜索