NLIC-2515 Add DiscountService#61
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. Scanned FilesNone |
| if (isNotFound(e)) { | ||
| return null; | ||
| } |
There was a problem hiding this comment.
This belongs to the business logic. If null is a legitimate response, the REST interface should handle it gracefully as well. Otherwise, the contract diverges between the Java binding and the REST interface.
| * @throws NetLicensingException | ||
| * any non-not-found service error | ||
| */ | ||
| public static LicenseTemplate resolveDiscount(final Context context, final String productNumber, |
There was a problem hiding this comment.
Is this intended for direct use by vendors? Consider implementing similar to the other internal endpoints in shop/src/main/java/com/labs64/netlicensing/service, instead of exposing it in the public client.
There was a problem hiding this comment.
If this should not be exposed publicly, this client PR is no longer needed, so I’ll close it.
|
|
||
| private static boolean isNotFound(final ServiceException e) { | ||
| return (e.getStatusCode() == HTTP_STATUS_NOT_FOUND) | ||
| || StringUtils.startsWith(e.getMessage(), NOT_FOUND_EXCEPTION_PREFIX); |
There was a problem hiding this comment.
Deprecated method: StringUtils.startsWith
|
Closing this PR because the proposed endpoint is intended for internal shop use and should not be exposed through the public Java client. Without the public API changes, there is nothing left to include in this PR. |
No description provided.