我必须编写两个组件之间的集成测试。我需要断言,如果我的组件无法执行其工作,则它不会将jms消息发送到下一个组件。
组件是独立的Spring Boot应用程序
public void test() throws JMSException {
//Given
createBrokenZip(BROKEN_ZIPPED_FILE_NAME);
//When
List<String> filesToProcess = new ArrayList<>();
filesToProcess.add(BROKEN_ZIPPED_FILE_NAME);
Start start = Start.builder().uuid(uuid).filesToProcess(filesToProcess).build();
jmsTemplate.convertAndSend(myComponentStartQueue, start);
//Then
Message message = jmsTemplate.receive(nextComponentStartQueue);
//assert that message was not received
}