0
我正在使用JSONObject(madison.util.json.JSONObject)而不是標準org.json.JSONObject的自定義類,並試圖模擬構造函數(String)使用PowerMockito調用JSONObject.class。使用PowerMockito進行模擬時沒有找到構造函數JSONObject構造函數
PowerMockito.whenNew(JSONObject.class).withArguments(String.class).thenReturn(jsonStub);
我得到格蘭以下錯誤:
No constructor found in class 'madison.util.json.JSONObject' with parameter types: [ null ].
任何人能指教一下這裏的問題?
謝謝