Claus Ibsen created CAMEL-27947:
-----------------------------------
Summary: camel-clickup: events not trimmed, missing events gives
NullPointerException, webhook API errors not checked
Key: CAMEL-27947
URL: https://issues.apache.org/jira/browse/CAMEL-27947
Project: Camel
Issue Type: Bug
Components: camel-clickup
Reporter: Claus Ibsen
Fix For: 4.25.0
Found while improving the option descriptions of camel-clickup for CAMEL-23832
(pull request https://github.com/apache/camel/pull/31192).
These are separate problems of the component; the descriptions change only
documents the current behavior.
h4. 1. events is not trimmed, and a missing events gives a NullPointerException
{{ClickUpConfiguration.getEvents}} splits on "," without trimming, so events=a,
b is rejected as unsupported; without events, Events.areAllEventsSupported in
ClickUpComponent.createEndpoint throws a NullPointerException.
Proposed change: trim, drop empty items, and fail with IllegalArgumentException
when events is not set.
h4. 2. Webhook API responses are not checked
{{ClickUpServiceApiImpl}} checks no HTTP status: getWebhooks() on an error
response returns null and ClickUpWebhookService.registerWebhook then fails with
a NullPointerException; deleteWebhook() ignores the response.
Proposed change: check the status code and fail with the err/ECODE text; treat
null webhooks as empty.
h4. 3. unregisterWebhook fails or deletes a webhook Camel did not create
{{ClickUpEndpoint.unregisterWebhook}} throws a NullPointerException when
registerWebhook() failed; when registration reused an existing webhook
(OAUTH_171), stopping the route deletes that webhook.
Proposed change: null check, and only delete a webhook that Camel created.
h4. 4. Smaller issues
authorizationToken is required=false in the metadata but createEndpoint
requires it (also with webhookAutoRegister=false, where it is not used); events
is required and validated with webhookAutoRegister=false, where it is not used.
baseUrl has no defaultValue (https://api.clickup.com/api/v2). The pom
firstVersion 4.24.0-SNAPSHOT differs from @UriEndpoint firstVersion 4.9.0.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)