我正在尝试测试由Spring定义的简单RestController。我创建了一个简单的测试文件,但正在获取java.lang.Exception:没有可运行的方法。
@RunWith(SpringJUnit4ClassRunner.class)
@WebMvcTest(MyController.class)
public class MyControllerTest{
@Autowired
private MockMvc mvc;
@MockBean
private MyService myservice;
@Test
public void myTest() throws Exception{
//test something
}
怎么了?为什么我不能运行测试?