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

If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.
tip

Check your pattern declaration or check your assert declaration.


rafael

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

  • 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}
    via by Michael Ottati,
  • 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}
    via by Michael Ottati,
  • Unit tests fail for Eureka
    via GitHub by larry13767
    ,
  • jcublas tests fail
    via GitHub by snovak7
    ,
    • 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)

    Users with the same issue

    osvzs
    osvzs3 times, last one,
    bernardpaulus
    bernardpaulus2 times, last one,
    jf-ast
    jf-ast7 times, last one,
    odd
    odd1 times, last one,
    Unknown visitor1 times, last one,
    94 more bugmates