2015-11-07 2 views
-2

Я стараюсь, чтобы запустить этот тест JUnit, который, наконец, утверждающий:Почему у меня есть «фактические и формальные списки аргументов различаются по длине» при сравнении элементов, а не списков?

ResponseExample responseExample = new ResponseExample(); 
responseExample.value = 4; 

assertThat(comparisonResult.latencyDelta.best.get(0),equalTo(responseExample)); 

где

public List<ResponseExample> best; 

почему я получаю сообщение об ошибке для equalTo()?

первый пункт в лучшем случае типа ResponseExample

Error:(62, 9) java: no suitable method found for assertThat(com.w.routing.automation.dataModel.examples.ResponseExample,com.google.common.base.Predicate<com.w.routing.automation.dataModel.examples.ResponseExample>) 
    method org.junit.Assert.<T>assertThat(java.lang.String,T,org.hamcrest.Matcher<? super T>) is not applicable 
     (cannot infer type-variable(s) T 
     (actual and formal argument lists differ in length)) 
    method org.junit.Assert.<T>assertThat(T,org.hamcrest.Matcher<? super T>) is not applicable 
     (no instance(s) of type variable(s) T exist so that com.google.common.base.Predicate<T> conforms to org.hamcrest.Matcher<? super T>) 

ответ

0

Я импортировал «CoreMatchers», и я должен был импортирован «Искателя»

Смежные вопросы