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();
|
||||
second = random.nextBoolean();
|
||||
} while (first && second);
|
||||
if (first && !second) {
|
||||
if (first) {
|
||||
try {
|
||||
cache.computeIfAbsent(key, k -> {
|
||||
if (random.nextBoolean()) {
|
||||
|
@ -646,9 +646,9 @@ public class CacheTests extends ESTestCase {
|
|||
assertThat(e.getCause(), instanceOf(Exception.class));
|
||||
assertEquals(e.getCause().getMessage(), "testCachePollution");
|
||||
}
|
||||
} else if (!first && second) {
|
||||
} else if (second) {
|
||||
cache.invalidate(key);
|
||||
} else if (!first && !second) {
|
||||
} else {
|
||||
cache.get(key);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue