java.lang.NoSuchMethodError: com.google.common.base.Objects.toStringHelper (Ljava / lang / Class;) Lcom / google / common / base / Objects $ ToStringHelper; - PullRequest
0 голосов
/ 08 октября 2019

Я использую Google Guava 21.x и AssertJ 3.8 для запуска теста, но он жалуется ниже:

[junit] Testcase: testModule took 7.062 sec
    [junit]     Caused an ERROR
    [junit] com.google.common.base.Objects.toStringHelper(Ljava/lang/Class;)Lcom/google/common/base/Objects$ToStringHelper;
    [junit] java.lang.NoSuchMethodError: com.google.common.base.Objects.toStringHelper(Ljava/lang/Class;)Lcom/google/common/base/Objects$ToStringHelper;
    [junit]     at com.google.inject.internal.FactoryProxy.toString(FactoryProxy.java:63)
    [junit]     at com.google.inject.internal.InjectorImpl$2.toString(InjectorImpl.java:1030)
    [junit]     at org.assertj.core.presentation.StandardRepresentation.toStringOf(StandardRepresentation.java:170)
    [junit]     at org.assertj.core.presentation.StandardRepresentation.format(StandardRepresentation.java:436)
    [junit]     at org.assertj.core.presentation.StandardRepresentation.singleLineFormat(StandardRepresentation.java:450)
    [junit]     at org.assertj.core.presentation.StandardRepresentation.smartFormat(StandardRepresentation.java:464)
    [junit]     at org.assertj.core.presentation.StandardRepresentation.toStringOf(StandardRepresentation.java:166)
    [junit]     at org.assertj.core.error.MessageFormatter.asText(MessageFormatter.java:77)
    [junit]     at org.assertj.core.error.MessageFormatter.format(MessageFormatter.java:68)
    [junit]     at org.assertj.core.error.MessageFormatter.format(MessageFormatter.java:61)
    [junit]     at org.assertj.core.error.BasicErrorMessageFactory.create(BasicErrorMessageFactory.java:110)
    [junit]     at org.assertj.core.internal.Failures.failure(Failures.java:116)
    [junit]     at org.assertj.core.internal.CommonValidations.checkSizes(CommonValidations.java:119)
    [junit]     at org.assertj.core.internal.Iterables.assertHasSize(Iterables.java:185)
    [junit]     at org.assertj.core.api.AbstractIterableAssert.hasSize(AbstractIterableAssert.java:170)
    [junit]     at com.fishercoder.worker.WorkersModuleTest.testModule(WorkersModuleTest.java:31)
    [junit]
    [junit] Test com.fishercoder.worker.WorkersModuleTest FAILED

Я провел некоторое исследование и обнаружил, что этот метод считается устаревшим: https://guava.dev/releases/20.0/api/docs/deprecated-list.html но это весь код зависимости, вызывающий Google Guava, любая оценка того, как это можно исправить, будет принята с благодарностью?

...