创建一个类,一个方法,写上@Test注解在红色时 鼠标放在上面按Alt+Enter或者点击小灯泡 导入Junit4 to classPath就好了
主界面左上角点击 Project Structure
IDEA最上面一栏的菜单栏中,选File->Project Structure,弹出窗口左边有一个列表,选Module
右侧有一个带3个标签的窗口,选Dependencies标签
下面的列表框列出了项目的jar包,右侧有个绿色的'+'号,左键点击,在左键菜单里选第一个
选择JAR Or directories
在弹出的文件浏览窗口,选择"IDEA的安装目录\lib\junit4.jar" 选完后别忘了点击对号和OK
安装完毕后,可以用这段代码测试一下。idea里右键run就可以运行了
import org.junit.Test;
//单元测试
public class MyMathTest {
@Test
public void ok(){
System.out.println("asdasd");
}
}
回到安装时的目录 选File->Project Structure选Dependencies标签
在这里就可以看到安装的依赖了 右键remove就可以了
推荐阅读:
vue.js:634 [Vue warn]: Property or method "userName" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See:
状态码:415,发送HTTP请求返回415状态码的解决办法
SpringBoot 整合 webapp时 访问404的解决办法
Vue 打开页面时就加载方法,例如查询
SpringCloud怎么调用多个服务的信息
Spring整合Mybatis
SpringCloud 加入 thymleaf前端页面的方法
Controller之间的跳转
Spring AOP的实现原理
This may be the result of an unspecified view, due to default view name generation
行动消除疑虑