TEST: Use non-zero number for #testCompareUnits

In `ByteSizeValueTests#testCompareUnits`, we expect non-zero for the
variable `number` however `randomNonNegativeLong` can return zero.

CI: https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+6.2+oracle-java10-periodic/147/console
This commit is contained in:
Nhat Nguyen 2018-03-10 22:56:22 -05:00
parent 4ba80a7952
commit 4f644d04a3
1 changed files with 1 additions and 1 deletions

View File

@ -168,7 +168,7 @@ public class ByteSizeValueTests extends AbstractWireSerializingTestCase<ByteSize
}
public void testCompareUnits() {
long number = randomNonNegativeLong() / ByteSizeUnit.PB.toBytes(1);
long number = randomLongBetween(1, Long.MAX_VALUE/ ByteSizeUnit.PB.toBytes(1));
ByteSizeUnit randomUnit = randomValueOtherThan(ByteSizeUnit.PB, ()->randomFrom(ByteSizeUnit.values()));
ByteSizeValue firstByteValue = new ByteSizeValue(number, randomUnit);
ByteSizeValue secondByteValue = new ByteSizeValue(number, ByteSizeUnit.PB);