[TEST] use single line ternary over more verbose ifs
This commit is contained in:
parent
6873454f33
commit
c0a0100308
|
@ -30,12 +30,7 @@ public class OsInfoTests extends ESTestCase {
|
|||
public void testSerialization() throws IOException {
|
||||
int availableProcessors = randomIntBetween(1, 64);
|
||||
int allocatedProcessors = randomIntBetween(1, availableProcessors);
|
||||
long refreshInterval;
|
||||
if (randomBoolean()) {
|
||||
refreshInterval = -1;
|
||||
} else {
|
||||
refreshInterval = randomPositiveLong();
|
||||
}
|
||||
long refreshInterval = randomBoolean() ? -1 : randomPositiveLong();
|
||||
String name = randomAsciiOfLengthBetween(3, 10);
|
||||
String arch = randomAsciiOfLengthBetween(3, 10);
|
||||
String version = randomAsciiOfLengthBetween(3, 10);
|
||||
|
|
|
@ -36,12 +36,7 @@ public class OsProbeTests extends ESTestCase {
|
|||
|
||||
public void testOsInfo() {
|
||||
int allocatedProcessors = randomIntBetween(1, Runtime.getRuntime().availableProcessors());
|
||||
long refreshInterval;
|
||||
if (randomBoolean()) {
|
||||
refreshInterval = -1;
|
||||
} else {
|
||||
refreshInterval = randomPositiveLong();
|
||||
}
|
||||
long refreshInterval = randomBoolean() ? -1 : randomPositiveLong();
|
||||
OsInfo info = probe.osInfo(refreshInterval, allocatedProcessors);
|
||||
assertNotNull(info);
|
||||
assertEquals(refreshInterval, info.getRefreshInterval());
|
||||
|
|
Loading…
Reference in New Issue