Created
June 9, 2021 06:08
-
-
Save lburgazzoli/6a86cd312055549ea267863fd759f05e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def "kamelet (filter with flow)"() { | |
setup: | |
setFlowMode(YamlDeserializationMode.FLOW) | |
addTemplate('simple-filter') { | |
from('kamelet:source') | |
.filter().simple('${header.foo} == "a"') | |
.to("kamelet:sink") | |
} | |
loadRoutes ''' | |
- from: | |
uri: "direct:route" | |
steps: | |
- kamelet: | |
name: "simple-filter" | |
- to: | |
uri: "mock:result" | |
''' | |
withMock('mock:result') { | |
expectedBodiesReceived '1', '3' | |
} | |
when: | |
withTemplate { | |
to('direct:route').withBody('1').withHeader('foo', 'a').send() | |
to('direct:route').withBody('2').withHeader('foo', 'b').send() | |
to('direct:route').withBody('3').withHeader('foo', 'a').send() | |
to('direct:route').withBody('4').withHeader('foo', 'c').send() | |
} | |
then: | |
MockEndpoint.assertIsSatisfied(context) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment