Clarify three possible outcomes in CacheTests#testCachePollution
This commit is contained in:
parent
14a635fe4b
commit
5e2eb7d0de
|
@ -632,7 +632,7 @@ public class CacheTests extends ESTestCase {
|
||||||
first = random.nextBoolean();
|
first = random.nextBoolean();
|
||||||
second = random.nextBoolean();
|
second = random.nextBoolean();
|
||||||
} while (first && second);
|
} while (first && second);
|
||||||
if (first && !second) {
|
if (first) {
|
||||||
try {
|
try {
|
||||||
cache.computeIfAbsent(key, k -> {
|
cache.computeIfAbsent(key, k -> {
|
||||||
if (random.nextBoolean()) {
|
if (random.nextBoolean()) {
|
||||||
|
@ -646,9 +646,9 @@ public class CacheTests extends ESTestCase {
|
||||||
assertThat(e.getCause(), instanceOf(Exception.class));
|
assertThat(e.getCause(), instanceOf(Exception.class));
|
||||||
assertEquals(e.getCause().getMessage(), "testCachePollution");
|
assertEquals(e.getCause().getMessage(), "testCachePollution");
|
||||||
}
|
}
|
||||||
} else if (!first && second) {
|
} else if (second) {
|
||||||
cache.invalidate(key);
|
cache.invalidate(key);
|
||||||
} else if (!first && !second) {
|
} else {
|
||||||
cache.get(key);
|
cache.get(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue