aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/shell/ToTruncatedStringTest.java
diff options
context:
space:
mode:
authorGravatar lberki <lberki@google.com>2017-05-30 12:35:33 +0200
committerGravatar László Csomor <laszlocsomor@google.com>2017-05-30 12:51:57 +0200
commitaea56b36af994b269800602e36000c293cabd00b (patch)
tree794f6b3b2528353cc39bd383730d408d4ff25233 /src/test/java/com/google/devtools/build/lib/shell/ToTruncatedStringTest.java
parent229f393bf460700594ae032a551879e026bd0b91 (diff)
Migrate Java tests to Truth.
RELNOTES: None. PiperOrigin-RevId: 157446717
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/shell/ToTruncatedStringTest.java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/shell/ToTruncatedStringTest.java15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/shell/ToTruncatedStringTest.java b/src/test/java/com/google/devtools/build/lib/shell/ToTruncatedStringTest.java
index a18819b679..ef19627816 100644
--- a/src/test/java/com/google/devtools/build/lib/shell/ToTruncatedStringTest.java
+++ b/src/test/java/com/google/devtools/build/lib/shell/ToTruncatedStringTest.java
@@ -14,19 +14,15 @@
package com.google.devtools.build.lib.shell;
import static com.google.common.truth.Truth.assertThat;
-import static org.junit.Assert.assertEquals;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Tests {@link LogUtil#toTruncatedString}.
- */
+/** Tests {@link LogUtil#toTruncatedString}. */
/*
* Note: The toTruncatedString method uses the platform encoding intentionally,
* so the unittest does to. Check out the comment in the implementation in
@@ -63,14 +59,13 @@ public class ToTruncatedStringTest {
"want to produce a useful log. A log is useful if it contains " +
"the interesting information (like what the c[... truncated. " +
"original size was 261 bytes.]";
- assertEquals(expectedOutput,
- LogUtil.toTruncatedString(sampleInput.getBytes()));
+ assertThat(LogUtil.toTruncatedString(sampleInput.getBytes())).isEqualTo(expectedOutput);
}
@Test
public void testTruncatingHelloWorldYieldsHelloWorld() {
String helloWorld = "Hello, world.";
- assertEquals(helloWorld, LogUtil.toTruncatedString(helloWorld.getBytes()));
+ assertThat(LogUtil.toTruncatedString(helloWorld.getBytes())).isEqualTo(helloWorld);
}
}