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

Hibernate JIRA | Hardy Ferentschik | 7 years ago
  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 | 7 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 | 7 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 weeks 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

    ExtensionLibrariesTest failed to install module

    GitHub | 2 years ago | sammefford
    java.lang.AssertionError: number of modules installed expected:<0> but was:<1>
  6. 0

    QueryByExampleTest failing on -1 from getTotalSize()

    GitHub | 2 years ago | sammefford
    java.lang.AssertionError: No XML documents should have matched expected:<-1> but was:<0>

  1. davidvanlaatum 1 times, last 1 week ago
  2. andyglick 9 times, last 8 months ago
  3. WoodenDoors 3 times, last 8 months ago
  4. davidvanlaatum 103 times, last 9 months ago
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