Controller测试类 /** * Created by zhiqi.shao on 2017/5/12. */ @RunWith(SpringJUnit4ClassRunner.class) @SpringBootTest(classes =MelonApplication.class) @WebAppConfiguration //启动一个真实web服务,然后调用Controller的Rest API,待单元测试完成之后再将web服务停掉 public class TestUserCon
22.编写一个类A,该类创建的对象可以调用方法showA输出小写的英文字母表.然后再编写一个A类的子类B,子类B创建的对象不仅可以调用方法showA输出小写的英文字母表,而且可以调用子类新增的方法showB输出大写的英文字母表.最后编写主类C,在主类的main方法 中测试类A与类B. package jicheng; public class A { public void showA() { System.out.println("asdfsdf"); } } package jic
报错 java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test ...... ...... ...... ...... ...... ...... ...... 我当时运行SpringBoot测试类的时候踩这个坑,当时的解决办法就是,原