Details
-
Bug
-
Resolution: Fixed
-
Minor
-
4.3.7
-
None
Description
API doc for RotatingVirtualURIMapping says: "An extension of RegexpVirtualURIMapping that allows a rotation between different destination urls. In order to rotate toURI must contain the * that will be replaced by a random number between start (default is 1) and end (default is 3)."
The code does not return random integers between start and end. It returns integers between one and "end minus start".
int randomNumber = RandomUtils.nextInt(end - start) + 1;
| start | end | RandomUtils.nextInt(end - start) + 1 |
|---|---|---|
| 0 | 3 | 1...3 |
| 1 | 3 | 1...2 |
| 1 | 4 | 1...3 |
| 2 | 5 | 1...3 |
| 3 | 7 | 1...4 |
| 4 | 9 | 1...5 |
Kindly revise the code to return integers between start and end. This is potentially quite useful.
Checklists
Acceptance criteria