【发布时间】:2018-05-08 23:36:56
【问题描述】:
我在使用 Hamcrest Matcher 库时遇到以下错误。
“Assert类型中的方法assertThat(T, Matcher)不适用于参数(List, AnyOf)”
我正在尝试的是 示例代码
List<String> poster_path_image2;
assertThat(poster_path_image2, anyOf(startsWith("https:"), startsWith("null")));
我需要检查一个 url 是否有效并且 null 值是否也可以接受。 我是这个库的新手,被这个错误难住了。
【问题讨论】:
-
poster_path_image2的类型是什么?
标签: java python unit-testing junit hamcrest