Claus Ibsen created CAMEL-27970:
-----------------------------------
Summary: camel-braintree: missing merchantId gives a
NullPointerException, stale methodName enums, addOn and discount APIs missing
from the catalog
Key: CAMEL-27970
URL: https://issues.apache.org/jira/browse/CAMEL-27970
Project: Camel
Issue Type: Bug
Components: camel-braintree
Reporter: Claus Ibsen
Fix For: 4.25.0
Found while improving the option descriptions of camel-braintree for
CAMEL-23832 (pull request https://github.com/apache/camel/pull/31200).
These are separate problems of the component; the descriptions change only
documents the current behavior.
h4. 1. No merchantId and no accessToken gives a NullPointerException
{{BraintreeComponent.getGateway}} calls ConcurrentHashMap.computeIfAbsent(null,
...) when neither accessToken nor merchantId is set, so the endpoint fails with
a bare NullPointerException instead of the library ConfigurationException
"merchantId needs to be set".
Proposed change: check the credentials in BraintreeConfiguration and throw an
IllegalArgumentException that names the options.
h4. 2. The methodName enums are stale
The methodName @UriPath enums miss adjustAuthorization, all, connectUrl,
createTokenFromCode, createTokenFromRefreshToken, packageTracking,
parseWithoutSignatureVerification, reverse, revokeAccessToken and
updateCustomFields, and still list holdInEscrow (not in SDK 3.55.1) and parse
(only on webhookNotification).
Proposed change: generate the enums from the API methods, or update the list.
h4. 3. Smaller issues
The addOn and discount APIs (method all() without parameters) are missing from
the apis section of the JSON and so from the doc page.
BraintreeComponent.createEndpoint assigns a private configuration field that
shadows AbstractApiComponent.configuration and is never read. environment only
accepts development, sandbox and production (the SDK also has qa). The
AuthenticationType enum is unused. The SDK keeps its logger in a static field,
so httpLogName, httpLogLevel and logHandlerEnabled apply to the whole JVM and
the gateway created last wins (the description now says so).
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)