Skip to content

Instantly share code, notes, and snippets.

@lburgazzoli
Created June 9, 2021 06:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lburgazzoli/6a86cd312055549ea267863fd759f05e to your computer and use it in GitHub Desktop.
Save lburgazzoli/6a86cd312055549ea267863fd759f05e to your computer and use it in GitHub Desktop.
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