Skip to main content

Posts

Showing posts from November, 2018

hamcrest and junit java.lang.NoSuchFieldError: NONE

Issue - When you using hemcrest with JUnit5 you may get  java.lang.NoSuchFieldError: NONE error. Solution - Add junit-vintage-engine to classpath           <dependency>             <groupId>org.junit.vintage</groupId>             <artifactId>junit-vintage-engine</artifactId>             <version>5.3.1</version>             <scope>test</scope>         </dependency>  Full Exception - java.lang.NoSuchFieldError: NONE at org.hamcrest.DiagnosingMatcher.matches(DiagnosingMatcher.java:12) at org.hamcrest.beans.SamePropertyValuesAs.hasMatchingValues(SamePropertyValuesAs.java:63) at org.hamcrest.beans.SamePropertyValuesAs.matchesSafely(SamePropertyValuesAs.java:31) at org.hamcrest.TypeSafeDiagnosingMatcher.matches(TypeSafeDiagnosingMatcher.java:55) at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:12) at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:8) at com.codegen.ShopTest.testExtern