Comments (3)
1 什么错,install的时候勾选 skip Tests 试一下;
2 两个没有什么关系吧,除非自己写一个?没必要啊
from blog-vue-springboot.
deleteTest(com.shimh.service.UserServiceTest) Time elapsed: 0.008 sec <<< ERROR!
org.springframework.dao.EmptyResultDataAccessException: No class com.shimh.entity.User entity with id 3 exists!
at org.springframework.data.jpa.repository.support.SimpleJpaRepository.delete(SimpleJpaRepository.java:154)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:520)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:505)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:477)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:56)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:133)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:57)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
at com.sun.proxy.$Proxy118.delete(Unknown Source)
at com.shimh.service.impl.UserServiceImpl.deleteUserById(UserServiceImpl.java:69)
at com.shimh.service.UserServiceTest.deleteTest(UserServiceTest.java:71)
2018-03-02 16:57:00.695 INFO org.springframework.context.support.AbstractApplicationContext 984 doClose - Closing org.springframework.web.context.support.GenericWebApplicationContext@61e94def: startup date [Fri Mar 02 16:56:06 CST 2018]; root of context hierarchy
Results :
Failed tests:
UserControllerTest.deleteTest:98 Status expected:<200> but was:<500>
UserControllerTest.saveUserTest:50 Status expected:<200> but was:<500>
UserControllerTest.updateUserTest:87 Status expected:<200> but was:<500>
Tests in error:
RedisManagerTest.deleteTest:32 » RedisConnectionFailure Cannot get Jedis conne...
RedisManagerTest.getTest:25 » RedisConnectionFailure Cannot get Jedis connecti...
UserServiceTest.deleteTest:71 » EmptyResultDataAccess No class com.shimh.entit...
UserServiceTest.saveUserTest:42 » DataIntegrityViolation could not execute sta...
UserServiceTest.updateUserTest:65 » NullPointer
Tests run: 33, Failures: 3, Errors: 5, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
Skip Test之后就正常了。
from blog-vue-springboot.
TestCase不规范,哈哈
from blog-vue-springboot.
Related Issues (20)
- 你好,请问下这个博客项目的评论功能是只有用户个人能进行还是用户之间可以互相评论呢 HOT 1
- 请问登陆用户名和密码是多少呢 HOT 2
- 服务器是不是挂了 HOT 1
- blog-data.sql 记录与数据库字段不匹配 HOT 4
- 后端程序bug HOT 2
- 更改主题 HOT 1
- 咨询 HOT 1
- 咨询 HOT 2
- 咨询 HOT 2
- 请问适配手机吗? HOT 1
- 请问项目在没登录的时候展示文章展示的是哪个用户的文章呢?在哪里设置 HOT 1
- 各组件依赖webpack版本不一 HOT 1
- 现在的登录用户名和密码是多少呢?
- 模拟数据 HOT 1
- jdk HOT 1
- 刚启动-类型转换异常 HOT 1
- 打包后用live server运行dist/index.html显示空白
- 后台管理系统有无
- SQL导入 HOT 2
- 前端显示 连接超时 怎么办?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blog-vue-springboot.