我有這樣的測試: test "invalid signup" do
get signup_path
assert_no_difference 'User.count' do
post users_path, user: {
name: '', email: '', password: '',
password_confirmation:''
我的問題與Mockito: Mock private field initialization相同,但是適用於Google Mock框架。簡而言之: class Target {
private:
Person person = new Person();
public:
void testMethod() {
person.someMethod();
我有一個任務要做: 這個控制器應該有自己的單元測試來驗證,@RequestMapping設置爲/ api/report/article_pairs。 @RestController
@RequestMapping("/api/report/article_pairs")
public class ArticlePairsController extends ReportController<A