java.lang.AssertionError: Expected :Entity of type org.springframework.data.jpa.example.auditing.AuditableUser with id: 1 Actual :null <Click to see difference>

Spring JIRA | Michael Ottati | 3 years ago
  1. 0

    Building the spring-data-jpa-example from a clean git clone results in the following error If I add the @Ignore annotation to this test, the rest of the project builds cleanly. {quote} 09:42:02,111 DEBUG data.repository.config.RepositoryComponentProvider: 264 - Identified candidate component class: file [/Users/michael.ottati/Code/spring-data-jpa-examples/spring-data-jpa-example/target/classes/org/springframework/data/jpa/example/repository/simple/SimpleUserRepository.class] 09:42:02,126 DEBUG a.repository.config.RepositoryBeanDefinitionParser: 113 - Registering repository: simpleUserRepository - Interface: org.springframework.data.jpa.example.repository.simple.SimpleUserRepository - Factory: org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean 09:42:03,781 DEBUG framework.data.jpa.repository.query.SimpleJpaQuery: 134 - Looking up query for method findByFirstname 09:42:03,796 WARN org.hibernate.hql.internal.ast.HqlSqlWalker: 929 - [DEPRECATION] Encountered positional parameter near line 1, column 86. Positional parameter are considered deprecated; use named parameters or JPA-style positional parameters instead. 09:42:03,805 DEBUG framework.data.jpa.repository.query.SimpleJpaQuery: 134 - Looking up query for method findByTheUsersName 09:42:03,807 DEBUG ringframework.data.jpa.repository.query.NamedQuery: 108 - Looking up named query User.findByTheUsersName 09:42:03,808 DEBUG ringframework.data.jpa.repository.query.NamedQuery: 93 - Did not find named query User.findByTheUsersName.count 09:42:03,808 DEBUG ringframework.data.jpa.repository.query.NamedQuery: 112 - Found named query User.findByTheUsersName! 09:42:03,811 DEBUG framework.data.jpa.repository.query.SimpleJpaQuery: 134 - Looking up query for method findByFirstnameOrLastname 09:42:03,816 DEBUG framework.data.jpa.repository.query.SimpleJpaQuery: 134 - Looking up query for method findByLastname 09:42:03,818 DEBUG ringframework.data.jpa.repository.query.NamedQuery: 108 - Looking up named query User.findByLastname 09:42:03,877 DEBUG ocessor$CustomAnnotationTransactionAttributeSource: 286 - Adding transactional method 'save' with attribute: PROPAGATION_REQUIRED,ISOLATION_DEFAULT; '' java.lang.AssertionError: Expected :Entity of type org.springframework.data.jpa.example.auditing.AuditableUser with id: 1 Actual :null <Click to see difference> at org.junit.Assert.fail(Assert.java:88) at org.junit.Assert.failNotEquals(Assert.java:743) at org.junit.Assert.assertEquals(Assert.java:118) at org.junit.Assert.assertEquals(Assert.java:144) at org.springframework.data.jpa.example.repository.AuditableUserSample.testname(AuditableUserSample.java:48) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74) at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83) at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:88) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174) at org.junit.runner.JUnitCore.run(JUnitCore.java:160) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:77) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) {quote}

    Spring JIRA | 3 years ago | Michael Ottati
    java.lang.AssertionError: Expected :Entity of type org.springframework.data.jpa.example.auditing.AuditableUser with id: 1 Actual :null <Click to see difference>
  2. 0

    Building the spring-data-jpa-example from a clean git clone results in the following error If I add the @Ignore annotation to this test, the rest of the project builds cleanly. {quote} 09:42:02,111 DEBUG data.repository.config.RepositoryComponentProvider: 264 - Identified candidate component class: file [/Users/michael.ottati/Code/spring-data-jpa-examples/spring-data-jpa-example/target/classes/org/springframework/data/jpa/example/repository/simple/SimpleUserRepository.class] 09:42:02,126 DEBUG a.repository.config.RepositoryBeanDefinitionParser: 113 - Registering repository: simpleUserRepository - Interface: org.springframework.data.jpa.example.repository.simple.SimpleUserRepository - Factory: org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean 09:42:03,781 DEBUG framework.data.jpa.repository.query.SimpleJpaQuery: 134 - Looking up query for method findByFirstname 09:42:03,796 WARN org.hibernate.hql.internal.ast.HqlSqlWalker: 929 - [DEPRECATION] Encountered positional parameter near line 1, column 86. Positional parameter are considered deprecated; use named parameters or JPA-style positional parameters instead. 09:42:03,805 DEBUG framework.data.jpa.repository.query.SimpleJpaQuery: 134 - Looking up query for method findByTheUsersName 09:42:03,807 DEBUG ringframework.data.jpa.repository.query.NamedQuery: 108 - Looking up named query User.findByTheUsersName 09:42:03,808 DEBUG ringframework.data.jpa.repository.query.NamedQuery: 93 - Did not find named query User.findByTheUsersName.count 09:42:03,808 DEBUG ringframework.data.jpa.repository.query.NamedQuery: 112 - Found named query User.findByTheUsersName! 09:42:03,811 DEBUG framework.data.jpa.repository.query.SimpleJpaQuery: 134 - Looking up query for method findByFirstnameOrLastname 09:42:03,816 DEBUG framework.data.jpa.repository.query.SimpleJpaQuery: 134 - Looking up query for method findByLastname 09:42:03,818 DEBUG ringframework.data.jpa.repository.query.NamedQuery: 108 - Looking up named query User.findByLastname 09:42:03,877 DEBUG ocessor$CustomAnnotationTransactionAttributeSource: 286 - Adding transactional method 'save' with attribute: PROPAGATION_REQUIRED,ISOLATION_DEFAULT; '' java.lang.AssertionError: Expected :Entity of type org.springframework.data.jpa.example.auditing.AuditableUser with id: 1 Actual :null <Click to see difference> at org.junit.Assert.fail(Assert.java:88) at org.junit.Assert.failNotEquals(Assert.java:743) at org.junit.Assert.assertEquals(Assert.java:118) at org.junit.Assert.assertEquals(Assert.java:144) at org.springframework.data.jpa.example.repository.AuditableUserSample.testname(AuditableUserSample.java:48) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74) at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83) at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:88) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174) at org.junit.runner.JUnitCore.run(JUnitCore.java:160) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:77) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) {quote}

    Spring JIRA | 3 years ago | Michael Ottati
    java.lang.AssertionError: Expected :Entity of type org.springframework.data.jpa.example.auditing.AuditableUser with id: 1 Actual :null <Click to see difference>
  3. 0

    Unit tests fail for Eureka

    GitHub | 2 years ago | larry13767
    java.lang.AssertionError: expected:<200> but was:<500>
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    SpdyConnectionTest.pushPromiseStream is flaky

    GitHub | 3 years ago | swankjesse
    java.lang.AssertionError: expected:<[:method: GET, :scheme: https, :authority: squareup.com, :path: /cached]> but was:<[:status: 200]>
  6. 0

    WebSocketCallTest.serverMessage is flaky

    GitHub | 2 years ago | JakeWharton
    java.lang.AssertionError: expected:<Message[TEXT Buffer[size=18 md5=be471905fcbe7f881ceb7fa60775ab5e]]> but was:<null>

  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 :Entity of type org.springframework.data.jpa.example.auditing.AuditableUser with id: 1 Actual :null <Click to see difference>

    at org.junit.Assert.fail()
  2. JUnit
    Assert.assertEquals
    1. org.junit.Assert.fail(Assert.java:88)
    2. org.junit.Assert.failNotEquals(Assert.java:743)
    3. org.junit.Assert.assertEquals(Assert.java:118)
    4. org.junit.Assert.assertEquals(Assert.java:144)
    4 frames
  3. org.springframework.data
    AuditableUserSample.testname
    1. org.springframework.data.jpa.example.repository.AuditableUserSample.testname(AuditableUserSample.java:48)
    1 frame
  4. Java RT
    DelegatingMethodAccessorImpl.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    3 frames
  5. JUnit
    InvokeMethod.evaluate
    1. org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    2. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    3. org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    4. org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    4 frames
  6. Spring TestContext
    SpringJUnit4ClassRunner.runChild
    1. org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
    2. org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)
    3. org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
    4. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
    5. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:88)
    5 frames
  7. JUnit
    ParentRunner$2.evaluate
    1. org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
    2. org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
    3. org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
    4. org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
    5. org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
    5 frames
  8. Spring TestContext
    RunAfterTestClassCallbacks.evaluate
    1. org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
    2. org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
    2 frames
  9. JUnit
    ParentRunner.run
    1. org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    1 frame
  10. Spring TestContext
    SpringJUnit4ClassRunner.run
    1. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)
    1 frame
  11. JUnit
    JUnitCore.run
    1. org.junit.runner.JUnitCore.run(JUnitCore.java:160)
    1 frame
  12. IntelliJ junit4 module
    JUnit4IdeaTestRunner.startRunnerWithArgs
    1. com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:77)
    1 frame
  13. IDEA
    JUnitStarter.main
    1. com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
    2. com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
    2 frames
  14. Java RT
    NativeMethodAccessorImpl.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    2 frames
  15. IDEA
    AppMain.main
    1. com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
    1 frame