java.lang.AssertionError: expected:<interface javax.validation.constraints.NotNull> but was:<interface javax.validation.constraints.Size>

Hibernate JIRA | Hardy Ferentschik | 8 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    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}

    Hibernate JIRA | 8 years ago | Hardy Ferentschik
    java.lang.AssertionError: expected:<interface javax.validation.constraints.NotNull> but was:<interface javax.validation.constraints.Size>
  2. 0

    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}

    Hibernate JIRA | 8 years ago | Hardy Ferentschik
    java.lang.AssertionError: expected:<interface javax.validation.constraints.NotNull> but was:<interface javax.validation.constraints.Size>
  3. 0

    You have failing tests

    GitHub | 4 months ago | haggy
    java.lang.AssertionError: expected:<19> but was:<18>
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Unit tests fail for Eureka

    GitHub | 2 years ago | larry13767
    java.lang.AssertionError: expected:<200> but was:<500>
  6. 0

    RxRingBuffer test fails

    GitHub | 3 years ago | tomrozb
    java.lang.AssertionError: expected:<94390> but was:<94389>

  1. jf-ast 3 times, last 2 weeks ago
  2. treefolk 3 times, last 3 weeks ago
  3. kjhdofjosvs 1 times, last 2 months ago
  4. MoYapro 3 times, last 2 months ago
  5. andyglick 1 times, last 2 months ago
5 more registered users
32 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.AssertionError

    expected:<interface javax.validation.constraints.NotNull> but was:<interface javax.validation.constraints.Size>

    at org.junit.Assert.fail()
  2. JUnit
    Assert.assertEquals
    1. org.junit.Assert.fail(Assert.java:58)
    2. org.junit.Assert.failNotEquals(Assert.java:259)
    3. org.junit.Assert.assertEquals(Assert.java:80)
    4. org.junit.Assert.assertEquals(Assert.java:88)
    4 frames
  3. test
    CompositeConstraintTest.invalidNickName
    1. test.CompositeConstraintTest.invalidNickName(CompositeConstraintTest.java:26)
    1 frame
  4. Java RT
    DelegatingMethodAccessorImpl.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    3 frames
  5. JUnit
    TestClassRunner.run
    1. org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
    2. org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
    3. org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
    4. org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
    5. org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
    6. org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
    7. org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
    8. org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
    9. org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
    10. org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
    10 frames
  6. com.intellij.rt
    Junit4ClassSuite.run
    1. com.intellij.rt.junit4.Junit4ClassSuite.run(Junit4ClassSuite.java:99)
    1 frame
  7. IDEA
    JUnitStarter.main
    1. com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
    1 frame