git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Integration tests with Spring annotations


Thanks for you reply!

Here its a sample of my test configuration: https://pastebin.com/7C82BLGT

but I always get the exception:
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException:
No qualifying bean of type
'com.camel.database.repositories.WorkflowRepository' available: expected at
least 1 bean which qualifies as autowire candidate. Dependency annotations:
{@org.springframework.beans.factory.annotation.Autowired(required=true)}


Le lun. 1 oct. 2018 à 09:59, Valdis Andersons <valdis.andersons@xxxxxx> a
écrit :

> Hi Damien,
>
> We use Spring annotations in our integrations quite a lot and it's working
> rather well for us. In order to invoke the RouteBuilder instance we just
> provide a class name for it in the ApplicationContext of the test
> createApplicationContext method and then use a test configuration file to
> specify the endpoints for it. Then we send various messages to the
> endpoints and assert the results when consuming from the output endpoints.
> What is you test setup, maybe you can provide a small sample to illustrate
> the issue you're facing?
>
> Regards,
> Valdis
>
> -----Original Message-----
> From: Damien Nicolas [mailto:dmn.nicolas@xxxxxxxxx]
> Sent: 30 September 2018 19:15
> To: users@xxxxxxxxxxxxxxxx
> Subject: Integration tests with Spring annotations
>
> Hello,
>
> I am using CamelSpringTestSupport for an integration test with Springboot,
> but I cannot use the annotation as mentionned here <
> http://scanmail.trustwave.com/?c=6600&d=wpKx28y48A_K6fOlX1flmR5QYQuyrMqdTgUBzkgEdw&s=33&u=http%3a%2f%2fcamel%2eapache%2eorg%2fspring-testing%2ehtml>.
> I need to use "@Autowired"
> cause I am generating routes dynamically from a database.
> Is there a way to use Spring annotations but with the advantages of
> CamelSpringTestSupport (by using createRouteBuilder())?
>
>
> --
> Damien NICOLAS
>
> Vhi Group DAC (Vhi) is a holding company for insurance and healthcare
> services, which include Vhi Healthcare DAC, Vhi Insurance DAC, Vhi Health
> Services DAC and Vhi Investments DAC. Vhi Healthcare DAC trading as Vhi
> Healthcare and Vhi Insurance DAC trading as Vhi Insurance are regulated by
> the Central Bank of Ireland. Vhi Healthcare is tied to Vhi Insurance DAC
> for health insurance in Ireland which is underwritten by Vhi Insurance DAC.
> Vhi Healthcare is tied to Zurich Life Assurance plc for Vhi Life Term
> Insurance and Vhi Mortgage Protection which is underwritten by Zurich Life
> Assurance plc. Vhi Healthcare is tied to Collinson Insurance Services
> Limited for MultiTrip Travel Insurance, Backpacker Travel Insurance and Vhi
> Dental Insurance which are underwritten by Great Lakes Insurance SE, UK
> branch and for Vhi Canada Cover and Vhi International Health Insurance
> which are underwritten by Astrenska Insurance Limited. For more information
> about the Vhi Group please go to: https://www.vhi.ie/about-vhi.
>
>
> Tá Vhi Group DAC (Vhi) ina chuideachta sealbhaíochta le haghaidh seirbhísí
> árachais agus seirbhísí cúram sláinte, lena n-áirítear Vhi Healthcare DAC,
> Vhi Insurance DAC, Vhi Health Services DAC agus Vhi Investments DAC.
> Déanann Banc Ceannais na hÉireann rialáil ar Vhi Healthcare DAC, ag trádáil
> dó mar Vhi Healthcare, agus ar Vhi Insurance DAC, ag trádáil dó mar Vhi
> Insurance. Tá Vhi Healthcare ceangailte le Vhi Insurance DAC le haghaidh
> árachas sláinte in Éirinn, rud atá frithgheallta ag Vhi Insurance DAC. Tá
> Vhi Healthcare ceangailte le Zurich Life Assurance plc le haghaidh Árachais
> Saoil de chuid Vhi agus Árachas Cosanta Morgáiste de chuid Vhi atá
> frithgheallta ag Zurich Life Assurance plc. Tá Vhi Healthcare ceangailte le
> Collinson Insurance Services Limited le haghaidh Árachas Taistil Ilturais
> agus Turasóirí Mála Droma agus Árachas Fiaclóireachta de chuid Vhi atá
> frithgheallta ag Great Lakes Insurance SE, UK branch agus le haghaidh
> Clúdach Cheanada de chuid Vhi agus Árachas Sláinte Idirnáisiúnta de chuid
> Vhi atá frithgheallta ag Astrenska Insurance Limited. Chun tuilleadh
> faisnéise a fháil faoi Ghrúpa Vhi, tabhair cuairt ar:
> https://www.vhi.ie/about-vhi.
>
> This e-mail and any files transmitted with it contain information which
> may be confidential and which may also be privileged and is intended solely
> for the use of the individual or entity to whom it is addressed. Unless you
> are the intended recipient you may not copy or use it, or disclose it to
> anyone else. Any opinions expressed are that of the individual and not
> necessarily that of the Vhi Group. If you have received this e-mail in
> error please notify the sender by return.
>
>
>
>
>
>
>

-- 
Damien NICOLAS