springboot单元测试mapper时报CONDITIONS EVALUATION REPORT,Positive matches:错误

9 篇文章 0 订阅
7 篇文章 0 订阅

报错信息

Positive matches:

AopAutoConfiguration matched:

  • @ConditionalOnProperty (spring.aop.auto=true) matched (OnPropertyCondition)

AopAutoConfiguration.ClassProxyingConfiguration matched:

  • @ConditionalOnMissingClass did not find unwanted class ‘org.aspectj.weaver.Advice’ (OnClassCondition)
    @ConditionalOnProperty (spring.aop.proxy-target-class=true) matched (OnPropertyCondition)

DataSourceAutoConfiguration matched:
- @ConditionalOnClass found required classes ‘javax.sql.DataSource’, ‘org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType’ (OnClassCondition)
- @ConditionalOnMissingBean (types: io.r2dbc.spi.ConnectionFactory; SearchStrategy: all) did not find any beans (OnBeanCondition)

DataSourceAutoConfiguration.PooledDataSourceConfiguration matched:
- AnyNestedCondition 2 matched 0 did not; NestedCondition on DataSourceAutoConfiguration.PooledDataSourceCondition.PooledDataSourceAvailable PooledDataSource found supported DataSource; NestedCondition on DataSourceAutoConfiguration.PooledDataSourceCondition.ExplicitType @ConditionalOnProperty (spring.datasource.type) matched (DataSourceAutoConfiguration.PooledDataSourceCondition)
- @ConditionalOnMissingBean (types: javax.sql.DataSource,javax.sql.XADataSource; SearchStrategy: all) did not find any beans (OnBeanCondition)

DataSourceConfiguration.Generic matched:

  • @ConditionalOnProperty (spring.datasource.type) matched (OnPropertyCondition)
    @ConditionalOnMissingBean (types: javax.sql.DataSource; SearchStrategy: all) did not find any beans (OnBeanCondition)

image-20240806104658584

image-20240806104642351

解决方法

测试的mapper上添加注解@Mapper,要么在测试注解下加入包扫描

image-20240806105036167

 @MapperScan( "com.example.mapper")

image-20240806105102658

成功变绿

  • 12
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值