New issue
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
被测试类的方法没有被mock #323
Comments
输出的结果 日志: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
package cn.sunline.risk.management;
import com.alibaba.testable.core.annotation.MockMethod;
import org.junit.Assert;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.stereotype.Component;
@SpringBootTest(classes = Application.class)
public class DemoTest {
@Autowired
private DemoService1 demoService1;
/*
String a = "zhao";
Mockito.when(demoService1.test2(a)).thenReturn("zhaoxiaowei_v");
Mockito.when(demoService1.test3(a)).thenReturn("zhaoxiaowei_v");
*/
}
@component
class DemoService{
@Autowired
DemoService1 demoService1;
}
@component
class DemoService1{
}
The text was updated successfully, but these errors were encountered: