相关疑难解决方法(0)

Hamcrest比较收藏品

我想比较2个列表:

assertThat(actual.getList(), is(Matchers.containsInAnyOrder(expectedList)));
Run Code Online (Sandbox Code Playgroud)

但想法

java: no suitable method found for assertThat(java.util.List<Agent>,org.hamcrest.Matcher<java.lang.Iterable<? extends model.Agents>>)
method org.junit.Assert.<T>assertThat(T,org.hamcrest.Matcher<T>) is not applicable
  (no instance(s) of type variable(s) T exist so that argument type org.hamcrest.Matcher<java.lang.Iterable<? extends model.Agents>> conforms to formal parameter type org.hamcrest.Matcher<T>)
method org.junit.Assert.<T>assertThat(java.lang.String,T,org.hamcrest.Matcher<T>) is not applicable
  (cannot instantiate from arguments because actual and formal argument lists differ in length)
Run Code Online (Sandbox Code Playgroud)

我该怎么写呢?

java junit hamcrest

100
推荐指数
5
解决办法
11万
查看次数

标签 统计

hamcrest ×1

java ×1

junit ×1