Zoran,
I chose WireMock because of its recording feature. I would like to avoid
configuring mocked API manually.

With WireMock it is quite easy. You will just set you recorded URL [1] and
run test in record mode. Wiremock can do everything else for you.

Without recording feature it is much more complicated. You will have to
investigate which API endpoints are used by internal clients, collect
responses and configure Citrus accordingly.

As Willem noticed in case of API change, you can run recording against real
API again and your tests are updated.
[1]
https://github.com/bouskaJ/camel/blob/camel-wiremock/components/camel-jira/src/test/java/org/apache/camel/component/jira/it/JiraProducerItTest.java#L74

pá 11. 10. 2019 v 2:04 odesílatel Willem Jiang <willem.ji...@gmail.com>
napsal:

> yeah, it sounds good to me by recording the real services
> request/response to mock the online services
> I think it could still be part of the component level tests instead of
> real integration test, because of the real services API could be
> changed and we still need to record the services request and response
> again in that case.
>
> Willem Jiang
>
> Twitter: willemjiang
> Weibo: 姜宁willem
>
> On Fri, Oct 11, 2019 at 4:21 AM Onder SEZGIN <ondersez...@gmail.com>
> wrote:
> >
> > +1
> >
> > On Wed, Oct 9, 2019 at 10:46 AM Jan Bouška <bouska....@gmail.com> wrote:
> >
> > > Hi folks,
> > > Recently I was thinking about integration tests in Camel project. Of
> > > course, we have camel-testcontainers component [1] which can help with
> > > integration testing very much using docker containers. But what about
> > > services which does not have docker image? For example we can't have
> > > facebook-docker image.
> > >
> > > Most of this third party services are communicating through REST API.
> I am
> > > working on camel-wiremock-test component [2] [3] which is able to
> record
> > > REST API responses and playback during the test.
> > >
> > > Can you check my PoC with camel-jira [4]? What you think about this
> > > approach? Does it worth it?
> > >
> > > Thanks for your input.
> > >
> > > Have a nice day.
> > > Jan
> > >
> > > [1]
> > >
> https://github.com/apache/camel/tree/master/components/camel-testcontainers
> > > [2]
> > >
> > >
> https://github.com/bouskaJ/camel/tree/camel-wiremock/components/camel-wiremock-test
> > > [3] http://wiremock.org/
> > > [4]
> > >
> > >
> https://github.com/bouskaJ/camel/blob/camel-wiremock/components/camel-jira/src/test/java/org/apache/camel/component/jira/it/JiraProducerItTest.java
> > >
>

Reply via email to