我正在编写一个使用Camel侦听SQS队列的Spring Boot应用程序。路线定义:
from("aws-sqs://my-s3-notification-queue" +
"?amazonSQSClient=#sqsClient" +
"&deleteAfterRead=false")
.unmarshal().json(JsonLibrary.Jackson, S3EventNotification.class)
.bean(s3NotificationHandler);
sqsClient@Bean在@Configuration文件中定义为。
在运行测试时,我想模拟SQS终结点,以便实际上不连接到AWS。我该怎么做呢?我试过像这样写测试
@RunWith(CamelSpringBootRunner.class)
@SpringBootTest
@MockEndpoints
public class ApplicationTests {
@Test
public void contextLoads() {
}
}
如果我正确阅读了文档,这应该可以工作,但是它仍然尝试连接到AWS。我想念什么?
慕工程0101907
蛊毒传说
相关分类