diff options
Diffstat (limited to 'android/guava-tests/test/com/google/common/cache/PopulatedCachesTest.java')
-rw-r--r-- | android/guava-tests/test/com/google/common/cache/PopulatedCachesTest.java | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/android/guava-tests/test/com/google/common/cache/PopulatedCachesTest.java b/android/guava-tests/test/com/google/common/cache/PopulatedCachesTest.java index b02b8ac61..5518190a5 100644 --- a/android/guava-tests/test/com/google/common/cache/PopulatedCachesTest.java +++ b/android/guava-tests/test/com/google/common/cache/PopulatedCachesTest.java @@ -20,6 +20,7 @@ import static com.google.common.cache.TestingCacheLoaders.identityLoader; import static com.google.common.truth.Truth.assertThat; import static java.util.concurrent.TimeUnit.DAYS; import static java.util.concurrent.TimeUnit.SECONDS; +import static org.junit.Assert.assertThrows; import com.google.common.base.Function; import com.google.common.cache.CacheBuilderFactory.DurationSpec; @@ -279,11 +280,7 @@ public class PopulatedCachesTest extends TestCase { assertEquals(3, cache.getIfPresent(1)); checkValidState(cache); - try { - entry.setValue(null); - fail(); - } catch (NullPointerException expected) { - } + assertThrows(NullPointerException.class, () -> entry.setValue(null)); checkValidState(cache); } } |