Uploaded image for project: 'odlparent'
  1. odlparent
  2. ODLPARENT-59

mockito-all is dangerous substance abuse, must always use mockito-core, everywhere; ODL parent could enforce?

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Medium
    • Resolution: Done
    • None
    • None
    • General
    • None
    • Operating System: All
      Platform: All

    Description

      Just discovered (more remembered actually, had hit this in a past life) that mockito-all is dangerous substance abuse, must always use mockito-core, everywhere; ODL parent could enforce?

      One can find various posts re. this problem online; incl. e.g. https://github.com/mockito/mockito/issues/324)

      This is the root cause of the following sudden post merge build failure of https://git.opendaylight.org/gerrit/#/c/44000/ e.g. on https://jenkins.opendaylight.org/releng/job/netvirt-verify-carbon-mvn33-openjdk8/2584/console :

      08:15:01 addElanInterface(org.opendaylight.netvirt.elanmanager.tests.ElanServiceTest) Time elapsed: 3.258 sec <<< ERROR!
      08:15:01 java.util.concurrent.ExecutionException: java.lang.NoSuchMethodError: org.hamcrest.Matcher.describeMismatch(Ljava/lang/Object;Lorg/hamcrest/Description;)V
      08:15:01 at java.util.concurrent.FutureTask.report(FutureTask.java:122)
      08:15:01 at java.util.concurrent.FutureTask.get(FutureTask.java:206)
      08:15:01 at org.awaitility.core.ConditionAwaiter$1.run(ConditionAwaiter.java:160)
      08:15:01 at java.lang.Thread.run(Thread.java:745)
      08:15:01 Caused by: java.lang.NoSuchMethodError: org.hamcrest.Matcher.describeMismatch(Ljava/lang/Object;Lorg/hamcrest/Description;)V
      08:15:01 at org.awaitility.core.AbstractHamcrestCondition.getMismatchMessage(AbstractHamcrestCondition.java:77)
      08:15:01 at org.awaitility.core.AbstractHamcrestCondition.access$300(AbstractHamcrestCondition.java:25)
      08:15:01 at org.awaitility.core.AbstractHamcrestCondition$1.eval(AbstractHamcrestCondition.java:55)
      08:15:01 at org.awaitility.core.ConditionAwaiter$ConditionPoller.run(ConditionAwaiter.java:215)
      08:15:01 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      08:15:01 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      08:15:01 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      08:15:01 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      08:15:01 ... 1 more

      I can fix this short term, but I'm opening this issue to track a number of changes I'm going to be pushing related to this.

      I'd also like to investigate whether it may be possible to use a maven enforcer rule to completely block usage of mockito-all anywhere in ODL (and switch all current uses of it over to mockito-core).

      I'd also like to see if it may be possible to run duplicate class entry validation during all ODL builds.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vorburger Michael Vorburger
            vorburger Michael Vorburger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: