summaryrefslogtreecommitdiff
path: root/swingp/testSrc
diff options
context:
space:
mode:
authorChester Hsieh <dunno@google.com>2021-01-19 17:20:47 -0800
committerTreeHugger Robot <treehugger-gerrit@google.com>2021-01-20 17:14:30 +0000
commit59720d5f943ce2a37256513054ddbd8eaefbc3c9 (patch)
treefa178498f249f8d48cae15b0c3dfebe7ff02b5db /swingp/testSrc
parent3abd2204a9e25063e0ceb019b0416bf2343dc522 (diff)
downloadidea-59720d5f943ce2a37256513054ddbd8eaefbc3c9.tar.gz
Fix swingp test mock
Fixes: 175042290 Test: SwingpSerializationTest Change-Id: I3ffa4838e874bfe77e7f32b7aa21dc5ef4cea045
Diffstat (limited to 'swingp/testSrc')
-rw-r--r--swingp/testSrc/com/android/tools/swingp/json/SwingpSerializationTest.java4
1 files changed, 1 insertions, 3 deletions
diff --git a/swingp/testSrc/com/android/tools/swingp/json/SwingpSerializationTest.java b/swingp/testSrc/com/android/tools/swingp/json/SwingpSerializationTest.java
index acc4c556959..9e3627c21a6 100644
--- a/swingp/testSrc/com/android/tools/swingp/json/SwingpSerializationTest.java
+++ b/swingp/testSrc/com/android/tools/swingp/json/SwingpSerializationTest.java
@@ -244,7 +244,7 @@ public class SwingpSerializationTest {
Thread thread = mock(Thread.class);
when(thread.getId()).thenReturn((long)123);
- thread.setName("FakeThread");
+ when(thread.getName()).thenReturn("FakeThread");
ThreadStat stat = new ThreadStat(thread).setIsRecording(true);
stat.pushMethod(new MethodStat(new Object()) {
@@ -253,9 +253,7 @@ public class SwingpSerializationTest {
JsonObject statObj = gson.toJsonTree(stat).getAsJsonObject();
assertThat(statObj.getAsJsonPrimitive("classType").getAsString()).isEqualTo("ThreadStat");
-/* b/175042290
assertThat(statObj.getAsJsonPrimitive("threadName").getAsString()).isEqualTo("FakeThread");
-b/175042290 */
assertThat(statObj.getAsJsonPrimitive("threadId").getAsLong()).isEqualTo(123);
assertThat(statObj.getAsJsonArray("events")).isEmpty();