Skip to content

Commit fb3ea1f

Browse files
committed
Use assertThat instead of plain asserts in MemoryCircuitBreakerTests
1 parent 411739f commit fb3ea1f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/test/java/org/elasticsearch/common/breaker/MemoryCircuitBreakerTests.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void run() {
5454
if (tripped.get()) {
5555
assertThat("tripped too many times", true, equalTo(false));
5656
} else {
57-
assert tripped.compareAndSet(false, true);
57+
assertThat(tripped.compareAndSet(false, true), equalTo(true));
5858
}
5959
} catch (Throwable e2) {
6060
lastException.set(e2);
@@ -86,7 +86,6 @@ public void testConstantFactor() throws Exception {
8686
breaker.addEstimateBytesAndMaybeBreak(3);
8787
fail("should never reach this");
8888
} catch (CircuitBreakingException cbe) {
89-
assert true;
9089
}
9190

9291
// shouldn't throw an exception
@@ -102,7 +101,6 @@ public void testConstantFactor() throws Exception {
102101
breaker.addEstimateBytesAndMaybeBreak(0);
103102
fail("should never reach this");
104103
} catch (CircuitBreakingException cbe) {
105-
assert true;
106104
}
107105
}
108106
}

0 commit comments

Comments
 (0)