In this case you may need to put the properties file (myprop.properties) into the test src resource directory to override it.
<bean id="properties" class="org.apache.camel.component.properties.PropertiesComponent"> <property name="location" value="classpath:com/mycompany/myprop.properties"/> </bean> -- Willem Jiang Red Hat, Inc. Web: http://www.redhat.com Blog: http://willemjiang.blogspot.com (English) http://jnn.iteye.com (Chinese) Twitter: willemjiang Weibo: 姜宁willem On October 29, 2014 at 12:24:50 AM, ychawla (premiergenerat...@gmail.com) wrote: > Hi, > I gave this a try but since I am using the plain spring configuration > rather than extending a class with Camel Spring Support there isn't a > method to override. > > My class signature looks like this: > > @RunWith(CamelSpringJUnit4ClassRunner.class) > > @ContextConfiguration(locations={ > "classpath:META-INF/spring/camel-context.xml"}) > > public class MyClass { > > Any ideas? > > Thanks, > Yogesh > > > > On Tue, Oct 28, 2014 at 2:39 AM, Charles Moulliard-2 [via Camel] < > ml-node+s465427n5758199...@n5.nabble.com> wrote: > > > Hi, > > > > Have you overrided the method as described in the doc of apache camel ( > > http://camel.apache.org/properties.html) ? > > > > @Override > > protected Properties useOverridePropertiesWithPropertiesComponent() { > > Properties extra = new Properties(); > > extra.put("destination", "mock:extra"); > > extra.put("greeting", "Bye"); > > return extra; > > } > > > > Regards, > > > > On Mon, Oct 27, 2014 at 3:40 PM, ychawla <[hidden email] > > > > > wrote: > > > > > Hi Claus, > > > I am using plain spring testing and annotating my custom class like > > this: > > > > > > @RunWith(SpringJUnit4ClassRunner.class) > > > @ContextConfiguration > > > public class MyCamelTest { > > > > > > I don't think I am able to use > > useOverridePropertiesWithPropertiesComponent > > > in this scenario. Is there a similar technique I can use with this > > testing > > > methodology? > > > > > > Thanks, > > > Yogesh > > > > > > > > > > > > -- > > > View this message in context: > > > > > http://camel.465427.n5.nabble.com/Change-property-in-unit-test-tp5758017p5758098.html > > > > > Sent from the Camel - Users mailing list archive at Nabble.com. > > > > > > > > > > > -- > > Charles Moulliard > > Apache Committer / Architect @RedHat > > Twitter : @cmoulliard | Blog : http://cmoulliard.github.io > > > > > > ------------------------------ > > If you reply to this email, your message will be added to the discussion > > below: > > > > http://camel.465427.n5.nabble.com/Change-property-in-unit-test-tp5758017p5758199.html > > > > To unsubscribe from Change property in unit test, click here > > > > . > > NAML > > > > > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Change-property-in-unit-test-tp5758017p5758236.html > > Sent from the Camel - Users mailing list archive at Nabble.com.