It's actually the MockEndpoint that complains. You cannot use any parameters on 
any kind of endpoint.

You shouldn't alias the smtp component (and hence force using the mock 
component instead). You might want to use the properties component [1] though 
and parameterize the whole url.

I hope this helps
Hadrian

[1] http://camel.apache.org/properties.html


On Mar 17, 2011, at 2:43 PM, Barry Kaplan wrote:

> I'm trying to test a component that sends email via smtp. But I'm not able to
> configure mock endpoint because it contains parameters that don't get
> resolved.
> 
> ccontext.addComponent("smtp", new MockComponent)
> val uri = "smtp://host:9999?username=smtpusername&password=smtppassword"
> ccontext.getEndpoint(uri,
> classOf[MockEndpoint]).expectedBodiesReceived(...)
> 
> The getEndpoint fails complaining about ?username and &password paremeters. 
> 
> I would expect that mock endpoints would not care about parameters.
> Hopefully there must some way to test this that I must be aware of... ?
> 
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Mock-endpoints-and-parameters-tp3894208p3894208.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to