@@ -75,8 +75,7 @@ public void setApplicationContext_initializeGaugeMetadataManager()
75
75
throws ExecutionException , InterruptedException {
76
76
when (mockPerfSession .isVerbose ()).thenReturn (true );
77
77
InOrder inOrder = Mockito .inOrder (mockGaugeManager );
78
- SessionManager testSessionManager =
79
- new SessionManager (mockGaugeManager , mockPerfSession , mockAppStateMonitor );
78
+ SessionManager testSessionManager = new SessionManager (mockGaugeManager , mockPerfSession );
80
79
testSessionManager .setApplicationContext (mockApplicationContext );
81
80
82
81
inOrder .verify (mockGaugeManager ).initializeGaugeMetadataManager (any ());
@@ -90,8 +89,7 @@ public void setApplicationContext_initializeGaugeMetadataManager()
90
89
public void testUpdatePerfSessionMakesGaugeManagerStopCollectingGaugesIfSessionIsNonVerbose () {
91
90
forceNonVerboseSession ();
92
91
93
- SessionManager testSessionManager =
94
- new SessionManager (mockGaugeManager , mockPerfSession , mockAppStateMonitor );
92
+ SessionManager testSessionManager = new SessionManager (mockGaugeManager , mockPerfSession );
95
93
testSessionManager .updatePerfSession (createTestSession (1 ));
96
94
97
95
verify (mockGaugeManager ).stopCollectingGauges ();
@@ -101,8 +99,7 @@ public void testUpdatePerfSessionMakesGaugeManagerStopCollectingGaugesIfSessionI
101
99
public void testUpdatePerfSessionMakesGaugeManagerStopCollectingGaugesWhenSessionsDisabled () {
102
100
forceSessionsFeatureDisabled ();
103
101
104
- SessionManager testSessionManager =
105
- new SessionManager (mockGaugeManager , createTestSession (1 ), mockAppStateMonitor );
102
+ SessionManager testSessionManager = new SessionManager (mockGaugeManager , createTestSession (1 ));
106
103
testSessionManager .updatePerfSession (createTestSession (2 ));
107
104
108
105
verify (mockGaugeManager ).stopCollectingGauges ();
@@ -114,8 +111,7 @@ public void testSessionIdDoesNotUpdateIfPerfSessionRunsTooLong() {
114
111
when (mockClock .getTime ()).thenReturn (mockTimer );
115
112
116
113
PerfSession session = new PerfSession (testSessionId (1 ), mockClock );
117
- SessionManager testSessionManager =
118
- new SessionManager (mockGaugeManager , session , mockAppStateMonitor );
114
+ SessionManager testSessionManager = new SessionManager (mockGaugeManager , session );
119
115
120
116
assertThat (session .isSessionRunningTooLong ()).isFalse ();
121
117
@@ -138,8 +134,7 @@ public void testUpdatePerfSessionStartsCollectingGaugesIfSessionIsVerbose() {
138
134
PerfSession newSession = createTestSession (2 );
139
135
newSession .setGaugeAndEventCollectionEnabled (true );
140
136
141
- SessionManager testSessionManager =
142
- new SessionManager (mockGaugeManager , previousSession , mockAppStateMonitor );
137
+ SessionManager testSessionManager = new SessionManager (mockGaugeManager , previousSession );
143
138
testSessionManager .updatePerfSession (newSession );
144
139
testSessionManager .setApplicationContext (mockApplicationContext );
145
140
@@ -149,8 +144,7 @@ public void testUpdatePerfSessionStartsCollectingGaugesIfSessionIsVerbose() {
149
144
150
145
@ Test
151
146
public void testPerfSession_sessionAwareObjects_doesntNotifyIfNotRegistered () {
152
- SessionManager testSessionManager =
153
- new SessionManager (mockGaugeManager , mockPerfSession , mockAppStateMonitor );
147
+ SessionManager testSessionManager = new SessionManager (mockGaugeManager , mockPerfSession );
154
148
155
149
FakeSessionAwareObject spySessionAwareObjectOne = spy (new FakeSessionAwareObject ());
156
150
FakeSessionAwareObject spySessionAwareObjectTwo = spy (new FakeSessionAwareObject ());
@@ -165,8 +159,7 @@ public void testPerfSession_sessionAwareObjects_doesntNotifyIfNotRegistered() {
165
159
166
160
@ Test
167
161
public void testPerfSession_sessionAwareObjects_NotifiesIfRegistered () {
168
- SessionManager testSessionManager =
169
- new SessionManager (mockGaugeManager , mockPerfSession , mockAppStateMonitor );
162
+ SessionManager testSessionManager = new SessionManager (mockGaugeManager , mockPerfSession );
170
163
171
164
FakeSessionAwareObject spySessionAwareObjectOne = spy (new FakeSessionAwareObject ());
172
165
FakeSessionAwareObject spySessionAwareObjectTwo = spy (new FakeSessionAwareObject ());
@@ -185,8 +178,7 @@ public void testPerfSession_sessionAwareObjects_NotifiesIfRegistered() {
185
178
186
179
@ Test
187
180
public void testPerfSession_sessionAwareObjects_DoesNotNotifyIfUnregistered () {
188
- SessionManager testSessionManager =
189
- new SessionManager (mockGaugeManager , mockPerfSession , mockAppStateMonitor );
181
+ SessionManager testSessionManager = new SessionManager (mockGaugeManager , mockPerfSession );
190
182
191
183
FakeSessionAwareObject spySessionAwareObjectOne = spy (new FakeSessionAwareObject ());
192
184
FakeSessionAwareObject spySessionAwareObjectTwo = spy (new FakeSessionAwareObject ());
0 commit comments