We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
站点中的ProgramConstructureTest类 加了测试参数后的代码,编译会报错 @test public void test2(@mocked HelloJMockit helloJMockit /* 这是一个测试参数 */) { // 录制(Record) new Expectations() { { helloJMockit.sayHello();
// Error:(40, 17) java: 从内部类中访问本地变量helloJMockit; 需要被声明为最终类型
The text was updated successfully, but these errors were encountered:
@shjqk 啥意思? ProgramConstructureTest.java 编译会报错? 并不会呀。
Sorry, something went wrong.
new Expectations() { { { helloJMockit.sayHello(); } }
少两个大括弧,表示该匿名类的初始化代码块。
No branches or pull requests
站点中的ProgramConstructureTest类
加了测试参数后的代码,编译会报错
@test
public void test2(@mocked HelloJMockit helloJMockit /* 这是一个测试参数 */) {
// 录制(Record)
new Expectations() {
{
helloJMockit.sayHello();
// Error:(40, 17) java: 从内部类中访问本地变量helloJMockit; 需要被声明为最终类型
The text was updated successfully, but these errors were encountered: