テストクラスを動作していない:私はきれいなコマンドをインストールMavenを使用して上記のコードを実行すると
class StudentServiceSpec extends Specification{
@Shared def studentDao
@Shared def studentService
def setupSpec(){
studentDao = Mock(StudentDao)
studentService = new StudentService(studentDao)
}
def "Get Student Details Based on StudentId"(){
setup:
1*studentDao.getStudent(67) >> new Student()
when:
Response response = studentService.getStudent("67")
println "** Response "+response
println "** Response "+response.getEntity()
then:
response != null
}
}
、私は取得しています次のエラー。
エラー:
1*studentDao.getStudent(67) >>> new Student() (0 invocations)
私はresponse.getEntity()
を取得しています0*studentDao.getStudent(67) >>> new Student()
を使用した場合
null
自分の答え – kazanaki
うわー、あなたは私の夜を保存しました:) thx – radio