diff --git a/build.gradle b/build.gradle index b3d976f2469..eb25cd69f9f 100644 --- a/build.gradle +++ b/build.gradle @@ -134,7 +134,6 @@ allprojects { 'JdkObsolete', 'LogSafePreconditionsMessageFormat', 'MathAbsoluteRandom', - 'MissingFail', 'MissingSummary', 'MixedMutabilityReturnType', 'MockitoInternalUsage', diff --git a/lock-impl/src/test/java/com/palantir/lock/impl/ClientAwareLockTest.java b/lock-impl/src/test/java/com/palantir/lock/impl/ClientAwareLockTest.java index c5e7efdadda..aef72b81809 100644 --- a/lock-impl/src/test/java/com/palantir/lock/impl/ClientAwareLockTest.java +++ b/lock-impl/src/test/java/com/palantir/lock/impl/ClientAwareLockTest.java @@ -176,11 +176,7 @@ public void testTimedTryLockCanFail() throws Exception { assertThat(anonymousReadLock.tryLock()).isNotNull(); anonymousReadLock.lock(); }); - try { - future2.get(10, TimeUnit.MILLISECONDS); - } catch (TimeoutException expected) { - /* Expected. */ - } + assertThatThrownBy(() -> future2.get(10, TimeUnit.MILLISECONDS)).isInstanceOf(TimeoutException.class); future1.get(200, TimeUnit.MILLISECONDS); future2.get(10, TimeUnit.MILLISECONDS); } diff --git a/lock-impl/src/test/java/com/palantir/lock/impl/ThreadPooledWrapperTest.java b/lock-impl/src/test/java/com/palantir/lock/impl/ThreadPooledWrapperTest.java index 5d414f4614c..5db21b87c53 100644 --- a/lock-impl/src/test/java/com/palantir/lock/impl/ThreadPooledWrapperTest.java +++ b/lock-impl/src/test/java/com/palantir/lock/impl/ThreadPooledWrapperTest.java @@ -197,8 +197,8 @@ private void assertBlockedThreadsAreDone(List futures, int numberBlocked assertThat(exceptions.get()).isEqualTo(numberBlocked); } - private void assertSuccessfulThreadsAreDone(List futures, int numberSuccessful) - throws InterruptedException, ExecutionException { + @SuppressWarnings("MissingFail") // This method *counts* successes and expects *some* to work + private void assertSuccessfulThreadsAreDone(List futures, int numberSuccessful) { AtomicInteger successes = new AtomicInteger(0); futures.forEach(future -> { try {