org.apache.camel.FailedToCreateRouteException:创建路由失败:因为名称为静态方法:methodA() 在类中找不到:

问题描述 投票:0回答:0

我正在使用 mockito 和 camelTestSupport 编写骆驼路线测试,但测试失败并出现以下错误:

Caused by: org.apache.camel.component.bean.MethodNotFoundException: 静态方法名称: methodA not found on class: .service.impl.ServiceImpl 在 org.apache.camel.component.bean.DefaultBeanProcessorFactory.createBeanProcessor

The method is present in service impl, and is defined as below:
 public Object methodA(@Headers Map headers, @Body String payload) {
        return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
    }
routes mockito apache-camel spring-boot-test
© www.soinside.com 2019 - 2024. All rights reserved.