[jira] [Updated] (CAMEL-19828) camel-twilio: conversion to PhoneNumber, .. fails after recent general converter change

2023-11-12 Thread Claus Ibsen (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-19828?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen updated CAMEL-19828:

Fix Version/s: 4.3.0

> camel-twilio: conversion to PhoneNumber, .. fails after recent general 
> converter change
> ---
>
> Key: CAMEL-19828
> URL: https://issues.apache.org/jira/browse/CAMEL-19828
> Project: Camel
>  Issue Type: Bug
>  Components: camel-core, camel-twilio
>Affects Versions: 4.x
>Reporter: Jiri Ondrusek
>Assignee: Jiri Ondrusek
>Priority: Minor
> Fix For: 4.3.0
>
>
> When adopting the latest Camel into camel-quarkus I noticed an error.
> {code:java}
> NoTypeConversionAvailableException: No type converter available to convert 
> from type: java.lang.String to the required type: com.twilio.type.Endpoint
> {code}
> Problem is caused by this change: 
> [https://github.com/apache/camel/pull/11225/commits/e4007f2b1dfc982e5ea6a45427cbec8835ea58a5]
> As you can see 
> [here|https://github.com/apache/camel/blob/main/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioConverter.java],
>  2 converters are registered (i.e. String -> PhoneNumber). Unfortunately the 
> Twilio API uses common interface `com.twilio.type.Endpoint`. See this 
> [line|https://github.com/apache/camel/blob/main/components/camel-twilio/src/generated/java/org/apache/camel/component/twilio/CallEndpointConfiguration.java#L27].
> Therefore the mechanism for selection converters is not able to find 
> converter `String -> Endpoint`.
> The behavior could be simply tested by following code added into 
> `TwilioEndpointTest`:
> {code:java}
> te = context.getEndpoint(
> 
> "twilio://call/create?from=RAW(+15005550006)=RAW(+14108675310)=http://demo.twilio.com/docs/voice.xml;,
> TwilioEndpoint.class);
> Assertions.assertTrue(te.getConfiguration() instanceof 
> CallEndpointConfiguration);
> CallEndpointConfiguration cee = (CallEndpointConfiguration) 
> te.getConfiguration();
> Assertions.assertEquals("+15005550006", cee.getFrom().getEndpoint());
> Assertions.assertEquals("+14108675310", cee.getTo().getEndpoint());
> {code}
> I'm not sure how it was possible, but the test wold succeed before the change 
> introduced by e4007f2b1dfc982e5ea6a45427cbec8835ea58a5.
> I think that the conversion before the change might not be correct in this 
> twilio case (the conversion was probably possible because of the fallback 
> conversion and was depending on the order of the registered converters - I 
> don't see a way how to decide which conversion should be used `PhoneNumber` 
> or `Sip` from the registered converters from the link above)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (CAMEL-19828) camel-twilio: conversion to PhoneNumber, .. fails after recent general converter change

2023-10-10 Thread Claus Ibsen (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-19828?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen updated CAMEL-19828:

Priority: Minor  (was: Major)

> camel-twilio: conversion to PhoneNumber, .. fails after recent general 
> converter change
> ---
>
> Key: CAMEL-19828
> URL: https://issues.apache.org/jira/browse/CAMEL-19828
> Project: Camel
>  Issue Type: Bug
>  Components: camel-core, camel-twilio
>Affects Versions: 4.x
>Reporter: Jiri Ondrusek
>Assignee: Jiri Ondrusek
>Priority: Minor
>
> When adopting the latest Camel into camel-quarkus I noticed an error.
> {code:java}
> NoTypeConversionAvailableException: No type converter available to convert 
> from type: java.lang.String to the required type: com.twilio.type.Endpoint
> {code}
> Problem is caused by this change: 
> [https://github.com/apache/camel/pull/11225/commits/e4007f2b1dfc982e5ea6a45427cbec8835ea58a5]
> As you can see 
> [here|https://github.com/apache/camel/blob/main/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioConverter.java],
>  2 converters are registered (i.e. String -> PhoneNumber). Unfortunately the 
> Twilio API uses common interface `com.twilio.type.Endpoint`. See this 
> [line|https://github.com/apache/camel/blob/main/components/camel-twilio/src/generated/java/org/apache/camel/component/twilio/CallEndpointConfiguration.java#L27].
> Therefore the mechanism for selection converters is not able to find 
> converter `String -> Endpoint`.
> The behavior could be simply tested by following code added into 
> `TwilioEndpointTest`:
> {code:java}
> te = context.getEndpoint(
> 
> "twilio://call/create?from=RAW(+15005550006)=RAW(+14108675310)=http://demo.twilio.com/docs/voice.xml;,
> TwilioEndpoint.class);
> Assertions.assertTrue(te.getConfiguration() instanceof 
> CallEndpointConfiguration);
> CallEndpointConfiguration cee = (CallEndpointConfiguration) 
> te.getConfiguration();
> Assertions.assertEquals("+15005550006", cee.getFrom().getEndpoint());
> Assertions.assertEquals("+14108675310", cee.getTo().getEndpoint());
> {code}
> I'm not sure how it was possible, but the test wold succeed before the change 
> introduced by e4007f2b1dfc982e5ea6a45427cbec8835ea58a5.
> I think that the conversion before the change might not be correct in this 
> twilio case (the conversion was probably possible because of the fallback 
> conversion and was depending on the order of the registered converters - I 
> don't see a way how to decide which conversion should be used `PhoneNumber` 
> or `Sip` from the registered converters from the link above)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (CAMEL-19828) camel-twilio: conversion to PhoneNumber, .. fails after recent general converter change

2023-09-04 Thread Jiri Ondrusek (Jira)


 [ 
https://issues.apache.org/jira/browse/CAMEL-19828?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jiri Ondrusek updated CAMEL-19828:
--
Affects Version/s: 4.x
   (was: 4.1.0)

> camel-twilio: conversion to PhoneNumber, .. fails after recent general 
> converter change
> ---
>
> Key: CAMEL-19828
> URL: https://issues.apache.org/jira/browse/CAMEL-19828
> Project: Camel
>  Issue Type: Bug
>  Components: camel-core, camel-twilio
>Affects Versions: 4.x
>Reporter: Jiri Ondrusek
>Priority: Major
>
> When adopting the latest Camel into camel-quarkus I noticed an error.
> {code:java}
> NoTypeConversionAvailableException: No type converter available to convert 
> from type: java.lang.String to the required type: com.twilio.type.Endpoint
> {code}
> Problem is caused by this change: 
> [https://github.com/apache/camel/pull/11225/commits/e4007f2b1dfc982e5ea6a45427cbec8835ea58a5]
> As you can see 
> [here|https://github.com/apache/camel/blob/main/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioConverter.java],
>  2 converters are registered (i.e. String -> PhoneNumber). Unfortunately the 
> Twilio API uses common interface `com.twilio.type.Endpoint`. See this 
> [line|https://github.com/apache/camel/blob/main/components/camel-twilio/src/generated/java/org/apache/camel/component/twilio/CallEndpointConfiguration.java#L27].
> Therefore the mechanism for selection converters is not able to find 
> converter `String -> Endpoint`.
> The behavior could be simply tested by following code added into 
> `TwilioEndpointTest`:
> {code:java}
> te = context.getEndpoint(
> 
> "twilio://call/create?from=RAW(+15005550006)=RAW(+14108675310)=http://demo.twilio.com/docs/voice.xml;,
> TwilioEndpoint.class);
> Assertions.assertTrue(te.getConfiguration() instanceof 
> CallEndpointConfiguration);
> CallEndpointConfiguration cee = (CallEndpointConfiguration) 
> te.getConfiguration();
> Assertions.assertEquals("+15005550006", cee.getFrom().getEndpoint());
> Assertions.assertEquals("+14108675310", cee.getTo().getEndpoint());
> {code}
> I'm not sure how it was possible, but the test wold succeed before the change 
> introduced by e4007f2b1dfc982e5ea6a45427cbec8835ea58a5.
> I think that the conversion before the change might not be correct in this 
> twilio case (the conversion was probably possible because of the fallback 
> conversion and was depending on the order of the registered converters - I 
> don't see a way how to decide which conversion should be used `PhoneNumber` 
> or `Sip` from the registered converters from the link above)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)