aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcpovirk <cpovirk@google.com>2019-04-24 05:28:52 -0700
committerRon Shapiro <shapiro.rd@gmail.com>2019-04-29 11:35:05 -0400
commit3eadff747a3afa7b498030f420d2d04ce700534a (patch)
treeacf4a6973c009e258f76b32becc53aa803741cc3
parent18797670c458d8a31fba943e0c23d911dae00d15 (diff)
downloadjimfs-3eadff747a3afa7b498030f420d2d04ce700534a.tar.gz
Migrate from assertThat(foo).named("foo") to assertWithMessage("foo").that(foo).
(The exact change is slightly different in some cases, like when using custom subjects or check(), but it's always a migration from named(...) to [assert]WithMessage(...).) named(...) is being removed. This CL may slightly modify the failure messages produced, but all the old information will still be present. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=245027649
-rw-r--r--jimfs/src/test/java/com/google/common/jimfs/JimfsFileChannelTest.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/jimfs/src/test/java/com/google/common/jimfs/JimfsFileChannelTest.java b/jimfs/src/test/java/com/google/common/jimfs/JimfsFileChannelTest.java
index 27ae34d..c525ef1 100644
--- a/jimfs/src/test/java/com/google/common/jimfs/JimfsFileChannelTest.java
+++ b/jimfs/src/test/java/com/google/common/jimfs/JimfsFileChannelTest.java
@@ -20,7 +20,7 @@ import static com.google.common.jimfs.TestUtils.assertNotEquals;
import static com.google.common.jimfs.TestUtils.buffer;
import static com.google.common.jimfs.TestUtils.bytes;
import static com.google.common.jimfs.TestUtils.regularFile;
-import static com.google.common.truth.Truth.assertThat;
+import static com.google.common.truth.Truth.assertWithMessage;
import static java.nio.file.StandardOpenOption.APPEND;
import static java.nio.file.StandardOpenOption.READ;
import static java.nio.file.StandardOpenOption.WRITE;
@@ -695,8 +695,8 @@ public class JimfsFileChannelTest {
future.get();
fail();
} catch (ExecutionException expected) {
- assertThat(expected.getCause())
- .named("blocking thread exception")
+ assertWithMessage("blocking thread exception")
+ .that(expected.getCause())
.isInstanceOf(AsynchronousCloseException.class);
}
}
@@ -754,8 +754,8 @@ public class JimfsFileChannelTest {
thread.interrupt();
// get the exception that caused the interrupted operation to terminate
- assertThat(interruptException.get(200, MILLISECONDS))
- .named("interrupted thread exception")
+ assertWithMessage("interrupted thread exception")
+ .that(interruptException.get(200, MILLISECONDS))
.isInstanceOf(ClosedByInterruptException.class);
// check that each other thread got AsynchronousCloseException (since the interrupt, on a
@@ -765,8 +765,8 @@ public class JimfsFileChannelTest {
future.get();
fail();
} catch (ExecutionException expected) {
- assertThat(expected.getCause())
- .named("blocking thread exception")
+ assertWithMessage("blocking thread exception")
+ .that(expected.getCause())
.isInstanceOf(AsynchronousCloseException.class);
}
}