You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Component
public class CandyHelper{
@Autowired
private List<CandyFilter> candyFilterList;
}
测试类
public class CandyHelperTest {
@Tested
private CandyHelper testInstance;
@Injectable
private List<CandyFilter> candyFilterList;
}
问题
使用Injectable时,会提示java.lang.IllegalArgumentException: java.util.List is not mockable;
不使用Injectable时会提示java.lang.IllegalStateException: Missing @Injectable for field "java.util.List candyFilterList" in CandyHelper
请问这种情况应该如何mock?
The text was updated successfully, but these errors were encountered:
代码:
测试类
问题
使用Injectable时,会提示java.lang.IllegalArgumentException: java.util.List is not mockable;
不使用Injectable时会提示java.lang.IllegalStateException: Missing @Injectable for field "java.util.List candyFilterList" in CandyHelper
请问这种情况应该如何mock?
The text was updated successfully, but these errors were encountered: