SpringBoot
JIUN-LIU
这个作者很懒,什么都没留下…
展开
-
SpringBoot 测试类 禁止执行队列监听 (mq,kafka)的方法
在使用SpringBoot 测试模块时,如果我们的程序中有关于 rabbitmq, kafka等的监听时,测试模块会直接将这些监听部分给启动起来。 有时候我们在测试的时候,并不像执行这些方法。以下就是关于这个的一个解决办法。 import org.springframework.boot.context.TypeExcludeFilter; import org.springframework.core.type.AnnotationMetadata; import org.springframework.原创 2020-06-17 11:22:16 · 1808 阅读 · 3 评论 -
SpringBoot MongoTemplate 去除 _class 字段
SpringBoot MongoTemplate 去除 _class 字段 在使用SpringBoot中使用MongoTemplate时,数据库中数据会有_class字段,虽说不影响使用,但是总是看着有些碍眼。 以下就是去除_class 字段的配置类,只需将代码复制即可直接使用。 import org.springframework.beans.factory.BeanFactory; ...原创 2018-08-09 17:28:11 · 1551 阅读 · 0 评论