Skip to content

Commit e925a53

Browse files
committed
Unit test build failures
1 parent f6e6803 commit e925a53

File tree

3 files changed

+10
-18
lines changed

3 files changed

+10
-18
lines changed

firebase-perf/src/test/java/com/google/firebase/perf/metrics/NetworkRequestMetricBuilderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ public void testSessionIdNotAddedIfPerfSessionIsNull() {
242242

243243
int numberOfSessionIds = metricBuilder.getSessions().size();
244244

245-
new SessionManager(mock(GaugeManager.class), null, mock(AppStateMonitor.class));
245+
new SessionManager(mock(GaugeManager.class), null);
246246

247247
assertThat(metricBuilder.getSessions()).hasSize(numberOfSessionIds);
248248
}

firebase-perf/src/test/java/com/google/firebase/perf/metrics/TraceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1032,7 +1032,7 @@ public void testSessionIdNotAddedIfPerfSessionIsNull() {
10321032

10331033
int numberOfSessionIds = trace.getSessions().size();
10341034

1035-
new SessionManager(mock(GaugeManager.class), null, mock(AppStateMonitor.class));
1035+
new SessionManager(mock(GaugeManager.class), null);
10361036

10371037
assertThat(trace.getSessions()).hasSize(numberOfSessionIds);
10381038

firebase-perf/src/test/java/com/google/firebase/perf/session/SessionManagerTest.java

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ public void setApplicationContext_initializeGaugeMetadataManager()
7575
throws ExecutionException, InterruptedException {
7676
when(mockPerfSession.isVerbose()).thenReturn(true);
7777
InOrder inOrder = Mockito.inOrder(mockGaugeManager);
78-
SessionManager testSessionManager =
79-
new SessionManager(mockGaugeManager, mockPerfSession, mockAppStateMonitor);
78+
SessionManager testSessionManager = new SessionManager(mockGaugeManager, mockPerfSession);
8079
testSessionManager.setApplicationContext(mockApplicationContext);
8180

8281
inOrder.verify(mockGaugeManager).initializeGaugeMetadataManager(any());
@@ -90,8 +89,7 @@ public void setApplicationContext_initializeGaugeMetadataManager()
9089
public void testUpdatePerfSessionMakesGaugeManagerStopCollectingGaugesIfSessionIsNonVerbose() {
9190
forceNonVerboseSession();
9291

93-
SessionManager testSessionManager =
94-
new SessionManager(mockGaugeManager, mockPerfSession, mockAppStateMonitor);
92+
SessionManager testSessionManager = new SessionManager(mockGaugeManager, mockPerfSession);
9593
testSessionManager.updatePerfSession(createTestSession(1));
9694

9795
verify(mockGaugeManager).stopCollectingGauges();
@@ -101,8 +99,7 @@ public void testUpdatePerfSessionMakesGaugeManagerStopCollectingGaugesIfSessionI
10199
public void testUpdatePerfSessionMakesGaugeManagerStopCollectingGaugesWhenSessionsDisabled() {
102100
forceSessionsFeatureDisabled();
103101

104-
SessionManager testSessionManager =
105-
new SessionManager(mockGaugeManager, createTestSession(1), mockAppStateMonitor);
102+
SessionManager testSessionManager = new SessionManager(mockGaugeManager, createTestSession(1));
106103
testSessionManager.updatePerfSession(createTestSession(2));
107104

108105
verify(mockGaugeManager).stopCollectingGauges();
@@ -114,8 +111,7 @@ public void testSessionIdDoesNotUpdateIfPerfSessionRunsTooLong() {
114111
when(mockClock.getTime()).thenReturn(mockTimer);
115112

116113
PerfSession session = new PerfSession(testSessionId(1), mockClock);
117-
SessionManager testSessionManager =
118-
new SessionManager(mockGaugeManager, session, mockAppStateMonitor);
114+
SessionManager testSessionManager = new SessionManager(mockGaugeManager, session);
119115

120116
assertThat(session.isSessionRunningTooLong()).isFalse();
121117

@@ -138,8 +134,7 @@ public void testUpdatePerfSessionStartsCollectingGaugesIfSessionIsVerbose() {
138134
PerfSession newSession = createTestSession(2);
139135
newSession.setGaugeAndEventCollectionEnabled(true);
140136

141-
SessionManager testSessionManager =
142-
new SessionManager(mockGaugeManager, previousSession, mockAppStateMonitor);
137+
SessionManager testSessionManager = new SessionManager(mockGaugeManager, previousSession);
143138
testSessionManager.updatePerfSession(newSession);
144139
testSessionManager.setApplicationContext(mockApplicationContext);
145140

@@ -149,8 +144,7 @@ public void testUpdatePerfSessionStartsCollectingGaugesIfSessionIsVerbose() {
149144

150145
@Test
151146
public void testPerfSession_sessionAwareObjects_doesntNotifyIfNotRegistered() {
152-
SessionManager testSessionManager =
153-
new SessionManager(mockGaugeManager, mockPerfSession, mockAppStateMonitor);
147+
SessionManager testSessionManager = new SessionManager(mockGaugeManager, mockPerfSession);
154148

155149
FakeSessionAwareObject spySessionAwareObjectOne = spy(new FakeSessionAwareObject());
156150
FakeSessionAwareObject spySessionAwareObjectTwo = spy(new FakeSessionAwareObject());
@@ -165,8 +159,7 @@ public void testPerfSession_sessionAwareObjects_doesntNotifyIfNotRegistered() {
165159

166160
@Test
167161
public void testPerfSession_sessionAwareObjects_NotifiesIfRegistered() {
168-
SessionManager testSessionManager =
169-
new SessionManager(mockGaugeManager, mockPerfSession, mockAppStateMonitor);
162+
SessionManager testSessionManager = new SessionManager(mockGaugeManager, mockPerfSession);
170163

171164
FakeSessionAwareObject spySessionAwareObjectOne = spy(new FakeSessionAwareObject());
172165
FakeSessionAwareObject spySessionAwareObjectTwo = spy(new FakeSessionAwareObject());
@@ -185,8 +178,7 @@ public void testPerfSession_sessionAwareObjects_NotifiesIfRegistered() {
185178

186179
@Test
187180
public void testPerfSession_sessionAwareObjects_DoesNotNotifyIfUnregistered() {
188-
SessionManager testSessionManager =
189-
new SessionManager(mockGaugeManager, mockPerfSession, mockAppStateMonitor);
181+
SessionManager testSessionManager = new SessionManager(mockGaugeManager, mockPerfSession);
190182

191183
FakeSessionAwareObject spySessionAwareObjectOne = spy(new FakeSessionAwareObject());
192184
FakeSessionAwareObject spySessionAwareObjectTwo = spy(new FakeSessionAwareObject());

0 commit comments

Comments
 (0)