|
40 | 40 | import com.google.firebase.perf.metrics.Trace;
|
41 | 41 | import com.google.firebase.perf.transport.TransportManager;
|
42 | 42 | import com.google.firebase.perf.util.Clock;
|
43 |
| -import com.google.firebase.perf.util.Constants; |
| 43 | +import com.google.firebase.perf.util.Constants.CounterNames; |
44 | 44 | import com.google.firebase.perf.util.Optional;
|
45 | 45 | import com.google.firebase.perf.util.Timer;
|
46 | 46 | import com.google.firebase.perf.v1.ApplicationProcessState;
|
47 | 47 | import com.google.firebase.perf.v1.TraceMetric;
|
48 | 48 | import java.util.WeakHashMap;
|
49 |
| -import org.junit.Assert; |
50 | 49 | import org.junit.Before;
|
51 | 50 | import org.junit.Test;
|
52 | 51 | import org.junit.runner.RunWith;
|
@@ -116,8 +115,8 @@ public void fragmentTraceName_validFragment_validFragmentScreenTraceNameGenerate
|
116 | 115 | FragmentStateMonitor monitor =
|
117 | 116 | new FragmentStateMonitor(clock, mockTransportManager, appStateMonitor, recorder);
|
118 | 117 | Fragment testFragment = new FragmentMonitorMockFragment();
|
119 |
| - Assert.assertEquals( |
120 |
| - "_st_FragmentMonitorMockFragment", monitor.getFragmentScreenTraceName(testFragment)); |
| 118 | + assertThat(monitor.getFragmentScreenTraceName(testFragment)) |
| 119 | + .isEqualTo("_st_FragmentMonitorMockFragment"); |
121 | 120 | }
|
122 | 121 |
|
123 | 122 | @Test
|
@@ -180,15 +179,12 @@ public void lifecycleCallbacks_onPausedCalledBeforeOnResume_doesNotLogFragmentSc
|
180 | 179 | verify(mockTransportManager, times(1))
|
181 | 180 | .log(argTraceMetric.capture(), nullable(ApplicationProcessState.class));
|
182 | 181 | TraceMetric metric = argTraceMetric.getValue();
|
183 |
| - Assert.assertEquals( |
184 |
| - frameCounts1.getTotalFrames(), |
185 |
| - (long) metric.getCountersMap().get(Constants.CounterNames.FRAMES_TOTAL.toString())); |
186 |
| - Assert.assertEquals( |
187 |
| - frameCounts1.getSlowFrames(), |
188 |
| - (long) metric.getCountersMap().get(Constants.CounterNames.FRAMES_SLOW.toString())); |
189 |
| - Assert.assertEquals( |
190 |
| - frameCounts1.getFrozenFrames(), |
191 |
| - (long) metric.getCountersMap().get(Constants.CounterNames.FRAMES_FROZEN.toString())); |
| 182 | + assertThat((long) metric.getCountersMap().get(CounterNames.FRAMES_TOTAL.toString())) |
| 183 | + .isEqualTo(frameCounts1.getTotalFrames()); |
| 184 | + assertThat((long) metric.getCountersMap().get(CounterNames.FRAMES_SLOW.toString())) |
| 185 | + .isEqualTo(frameCounts1.getSlowFrames()); |
| 186 | + assertThat((long) metric.getCountersMap().get(CounterNames.FRAMES_FROZEN.toString())) |
| 187 | + .isEqualTo(frameCounts1.getFrozenFrames()); |
192 | 188 | }
|
193 | 189 |
|
194 | 190 | /** Simulate call order of activity + fragment lifecycle events */
|
|
0 commit comments