小编Sun*_*lai的帖子

IntelliJ IDEA:将shell脚本作为运行/调试配置运行

有没有办法从IntelliJ运行/调试配置调用shell脚本?

intellij-idea

105
推荐指数
4
解决办法
7万
查看次数

我们如何为涉及与DB连接的方法编写单元测试?

我一直在询问有关为Web方法编写单元测试的问题,这些方法实际上与数据库通信并返回一些值.

比方说,我有一个名为"StudentInfoService"的Web服务.该网络服务提供API"getStudentInfo(studentid)"

这是一些示例代码段

public class StudentInfoService
{
    public StudentInfo getStudentInfo(long studentId) {
            //Communicates with DB and creates
            // StudentInfo object with necessary information
            // and returns it to the caller.
    }
}
Run Code Online (Sandbox Code Playgroud)

我们如何为这个方法getStudentInfo实际编写单元测试?一般来说,我们如何为涉及与资源(数据库,文件,JNDI等)连接的方法编写单元测试?

java unit-testing

6
推荐指数
1
解决办法
1808
查看次数

标签 统计

intellij-idea ×1

java ×1

unit-testing ×1