java.lang.AssertionError

tip

Check your pattern declaration or check your assert declaration.


rafaelrafael

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • i'm using the current snapshot of hibernate validator v4. constellation: composite constraint + @ReportAsSingleViolation on part of the composition is: @Size(min = 1, max = 10) the message of the composite constraint: the following sometimes leads to a wrong text: String message() default "my msg -- min: {min} max: {max}"; >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> if i run the test-case multiple times (sometimes really really often) the following stacktrace shows up: java.lang.AssertionError: expected:<interface javax.validation.constraints.NotNull> but was:<interface javax.validation.constraints.Size> at org.junit.Assert.fail(Assert.java:58) at org.junit.Assert.failNotEquals(Assert.java:259) at org.junit.Assert.assertEquals(Assert.java:80) at org.junit.Assert.assertEquals(Assert.java:88) at test.CompositeConstraintTest.invalidNickName(CompositeConstraintTest.java:26) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99) at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81) at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75) at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45) at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71) at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35) at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42) at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52) at com.intellij.rt.junit4.Junit4ClassSuite.run(Junit4ClassSuite.java:99) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40) the bad thing is - i cannot always reproduce it - i run some junit test-cases - sometimes the interpolated message is ok and one test-run later (without source changes) it's something like that: my msg - min: my msg - min: {min} max: {max} max: my msg - min: {min} max: {max}
    via by Hardy Ferentschik,
  • i'm using the current snapshot of hibernate validator v4. constellation: composite constraint + @ReportAsSingleViolation on part of the composition is: @Size(min = 1, max = 10) the message of the composite constraint: the following sometimes leads to a wrong text: String message() default "my msg -- min: {min} max: {max}"; >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> if i run the test-case multiple times (sometimes really really often) the following stacktrace shows up: java.lang.AssertionError: expected:<interface javax.validation.constraints.NotNull> but was:<interface javax.validation.constraints.Size> at org.junit.Assert.fail(Assert.java:58) at org.junit.Assert.failNotEquals(Assert.java:259) at org.junit.Assert.assertEquals(Assert.java:80) at org.junit.Assert.assertEquals(Assert.java:88) at test.CompositeConstraintTest.invalidNickName(CompositeConstraintTest.java:26) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99) at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81) at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75) at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45) at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71) at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35) at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42) at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52) at com.intellij.rt.junit4.Junit4ClassSuite.run(Junit4ClassSuite.java:99) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40) the bad thing is - i cannot always reproduce it - i run some junit test-cases - sometimes the interpolated message is ok and one test-run later (without source changes) it's something like that: my msg - min: my msg - min: {min} max: {max} max: my msg - min: {min} max: {max}
    via by Hardy Ferentschik,
  • You have failing tests
    via GitHub by haggy
    ,
  • Unit tests fail for Eureka
    via GitHub by larry13767
    ,
  • RxRingBuffer test fails
    via GitHub by tomrozb
    ,
    • java.lang.AssertionError: expected:<interface javax.validation.constraints.NotNull> but was:<interface javax.validation.constraints.Size> at org.junit.Assert.fail(Assert.java:58) at org.junit.Assert.failNotEquals(Assert.java:259) at org.junit.Assert.assertEquals(Assert.java:80) at org.junit.Assert.assertEquals(Assert.java:88) at test.CompositeConstraintTest.invalidNickName(CompositeConstraintTest.java:26) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99) at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81) at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75) at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45) at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71) at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35) at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42) at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52) at com.intellij.rt.junit4.Junit4ClassSuite.run(Junit4ClassSuite.java:99) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)

    Users with the same issue

    jf-astjf-ast
    1 times, last one,
    AxeloAxelo
    3 times, last one,
    oddodd
    17 times, last one,
    rocdayrocday
    1 times, last one,
    andyglickandyglick
    2 times, last one,
    95 more bugmates