https://tedvinke.wordpress.com/2013/12/17/mixing-junit-hamcrest-and-mockito-explaining-nosuchmethoderror/
This could be due to the fact that JUnit itself brings along its own version of Hamcrest as a transitive dependency. Now if you would be using JUnit 4.11 it would depending on Hamcrest 1.3 already – see here. Getting above error would be weird – since the describeMismatch method is present in org.hamcrest.Matcher interface. --Ted Vinke
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
testCompile ('junit:junit:4.11') { | |
exclude group: 'org.hamcrest', module: 'hamcrest-all' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java.lang.NoSuchMethodError: org/hamcrest/Matcher.describeMismatch(Ljava/lang/Object;Lorg/hamcrest/Description;)V | |
at org.hamcrest.collection.IsIterableContainingInOrder$MatchSeries.describeMismatch(IsIterableContainingInOrder.java:83) | |
at org.hamcrest.collection.IsIterableContainingInOrder$MatchSeries.isMatched(IsIterableContainingInOrder.java:66) | |
at org.hamcrest.collection.IsIterableContainingInOrder$MatchSeries.matches(IsIterableContainingInOrder.java:52) | |
at org.hamcrest.collection.IsIterableContainingInOrder.matchesSafely(IsIterableContainingInOrder.java:25) | |
at org.hamcrest.collection.IsIterableContainingInOrder.matchesSafely(IsIterableContainingInOrder.java:14) | |
at org.hamcrest.TypeSafeDiagnosingMatcher.matches(TypeSafeDiagnosingMatcher.java:55) | |
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:12) | |
at org.junit.Assert.assertThat(Assert.java:865) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ jar tf /Users/cgra12/.m2/repository/org/mockito/mockito-all/1.9.5/mockito-all-1.9.5.jar|grep hamcrest | |
org/hamcrest/ | |
org/hamcrest/core/ | |
org/hamcrest/internal/ | |
hamcrest-license.txt | |
org/hamcrest/BaseDescription.class | |
org/hamcrest/BaseDescription.java | |
org/hamcrest/BaseMatcher.class | |
org/hamcrest/BaseMatcher.java | |
org/hamcrest/CoreMatchers.class | |
org/hamcrest/CoreMatchers.java | |
org/hamcrest/Description.class | |
org/hamcrest/Description.java | |
org/hamcrest/Factory.class | |
org/hamcrest/Factory.java | |
org/hamcrest/Matcher.class | |
org/hamcrest/Matcher.java | |
org/hamcrest/SelfDescribing.class | |
org/hamcrest/SelfDescribing.java | |
org/hamcrest/StringDescription.class | |
org/hamcrest/StringDescription.java | |
org/hamcrest/core/AllOf.class | |
org/hamcrest/core/AllOf.java | |
org/hamcrest/core/AnyOf.class | |
org/hamcrest/core/AnyOf.java | |
org/hamcrest/core/DescribedAs.class | |
org/hamcrest/core/DescribedAs.java | |
org/hamcrest/core/Is.class | |
org/hamcrest/core/Is.java | |
org/hamcrest/core/IsAnything.class | |
org/hamcrest/core/IsAnything.java | |
org/hamcrest/core/IsEqual.class | |
org/hamcrest/core/IsEqual.java | |
org/hamcrest/core/IsInstanceOf.class | |
org/hamcrest/core/IsInstanceOf.java | |
org/hamcrest/core/IsNot.class | |
org/hamcrest/core/IsNot.java | |
org/hamcrest/core/IsNull.class | |
org/hamcrest/core/IsNull.java | |
org/hamcrest/core/IsSame.class | |
org/hamcrest/core/IsSame.java | |
org/hamcrest/core/package.html | |
org/hamcrest/internal/ArrayIterator.class | |
org/hamcrest/internal/ArrayIterator.java | |
org/hamcrest/internal/SelfDescribingValue.class | |
org/hamcrest/internal/SelfDescribingValue.java | |
org/hamcrest/internal/SelfDescribingValueIterator.class | |
org/hamcrest/internal/SelfDescribingValueIterator.java | |
org/hamcrest/package.html |
SHAME ON YOU
No comments:
Post a Comment