ranger
ranger copied to clipboard
RANGER-5397: IllegalArgumentException in RangerRESTClient when no ran…
What changes were proposed in this pull request?
RangerBasePlugin initialization fails with an IllegalArgumentException when the ranger.plugin.<serviceType>.policy.rest.url property is not set. The issue occurs because getConfiguredURLs() returns an empty list, causing Random.nextInt(0) to throw an exception.
How was this patch tested?
wrote a new test TestRangerRESTClient.testPluginInit_WithNoUrl_DoesNotCrash() this will fail without fix and pass with fix.