CAMEL-14074 -> Custom host header implementation. - #3403
Conversation
| import org.apache.camel.support.MessageHelper; | ||
| import org.apache.camel.support.ObjectHelper; | ||
| import org.apache.camel.support.SynchronizationAdapter; | ||
| import org.apache.camel.support.*; |
There was a problem hiding this comment.
To import all packages is not preferable, did you run camel build with source check in order to pick up these issues?
There was a problem hiding this comment.
Yup, it didn't complain. This is how my IDE is set, i can revert it if it's a problem.
There was a problem hiding this comment.
Pretty weird, it should complain. Can you please revert it?
| } | ||
|
|
||
| @Test | ||
| public void testHttpProducer_GivenCustomHostHeaderQuery_SetCustomHost() throws Exception { |
There was a problem hiding this comment.
Does the names of the test have to contain _ ?
There was a problem hiding this comment.
Of course it doesn't, i find it more readable this way.
There was a problem hiding this comment.
I would prefer if we don't use the underscore. Just to keep it consistent with what we have in the codebase
| import org.apache.http.entity.FileEntity; | ||
| import org.apache.http.entity.InputStreamEntity; | ||
| import org.apache.http.entity.StringEntity; | ||
| import org.apache.http.entity.*; |
There was a problem hiding this comment.
Same goes here and other places as well
| producer.process(exchange); | ||
| producer.stop(); | ||
|
|
||
| assertExchange(exchange); |
There was a problem hiding this comment.
If not mistaken, this is will not assert the custom headers, is that correct? (mind you I have no details info about this component)
There was a problem hiding this comment.
Check HeaderValidationHandler I set a Map with expected Headers and when component creates a request it will send request to local server defined in test and validate Host header there. Please correct me if I am wrong. :) Thanks for taking the time to check this PR.
There was a problem hiding this comment.
Ah now it makes sense. I wondered before where the header assert is happening and I didn't pay attention to this part. Thanks for clarification :)
note: this feature will work only with java >=12. Because that's when they enabled host overriding.