@@ -52,7 +52,7 @@ final class SentryLogBatcherTests: XCTestCase {
5252 XCTAssertEqual ( testClient. captureLogsDataInvocations. count, 0 )
5353
5454 // Trigger flush manually
55- sut. flush ( )
55+ sut. captureLogs ( )
5656
5757 // Verify both logs are batched together
5858 XCTAssertEqual ( testClient. captureLogsDataInvocations. count, 1 )
@@ -140,9 +140,9 @@ final class SentryLogBatcherTests: XCTestCase {
140140 XCTAssertEqual ( 2 , items. count)
141141 }
142142
143- // MARK: - Manual Flush Tests
143+ // MARK: - Manual Capture Logs Tests
144144
145- func testManualFlush_FlushesImmediately ( ) throws {
145+ func testManualCaptureLogs_CapturesImmediately ( ) throws {
146146 // Given
147147 let log1 = createTestLog ( body: " Log 1 " )
148148 let log2 = createTestLog ( body: " Log 2 " )
@@ -152,7 +152,7 @@ final class SentryLogBatcherTests: XCTestCase {
152152 sut. add ( log2)
153153 XCTAssertEqual ( testClient. captureLogsDataInvocations. count, 0 )
154154
155- sut. flush ( )
155+ sut. captureLogs ( )
156156
157157 // Then
158158 XCTAssertEqual ( testClient. captureLogsDataInvocations. count, 1 )
@@ -163,7 +163,7 @@ final class SentryLogBatcherTests: XCTestCase {
163163 XCTAssertEqual ( 2 , items. count)
164164 }
165165
166- func testManualFlush_CancelsScheduledFlush ( ) throws {
166+ func testManualCaptureLogs_CancelsScheduledCapture ( ) throws {
167167 // Given
168168 let log = createTestLog ( )
169169
@@ -175,7 +175,7 @@ final class SentryLogBatcherTests: XCTestCase {
175175 let timerWorkItem = try XCTUnwrap ( testDispatchQueue. dispatchAfterWorkItemInvocations. first? . workItem)
176176
177177 // Manual flush immediately
178- sut. flush ( )
178+ sut. captureLogs ( )
179179 XCTAssertEqual ( testClient. captureLogsDataInvocations. count, 1 , " Manual flush should work " )
180180
181181 // Try to trigger the timer work item (should not flush again since timer was cancelled)
@@ -185,14 +185,14 @@ final class SentryLogBatcherTests: XCTestCase {
185185 XCTAssertEqual ( testClient. captureLogsDataInvocations. count, 1 , " Timer should be cancelled " )
186186 }
187187
188- func testFlushEmptyBuffer_DoesNothing ( ) {
188+ func testManualCaptureLogs_WithEmptyBuffer_DoesNothing ( ) {
189189 // When
190- sut. flush ( )
190+ sut. captureLogs ( )
191191
192192 // Then
193193 XCTAssertEqual ( testClient. captureLogsDataInvocations. count, 0 )
194194 }
195-
195+
196196 // MARK: - Edge Cases Tests
197197
198198 func testScheduledFlushAfterBufferAlreadyFlushed_DoesNothing( ) throws {
@@ -225,12 +225,12 @@ final class SentryLogBatcherTests: XCTestCase {
225225
226226 // When
227227 sut. add ( log1)
228- sut. flush ( )
228+ sut. captureLogs ( )
229229
230230 XCTAssertEqual ( testClient. captureLogsDataInvocations. count, 1 )
231231
232232 sut. add ( log2)
233- sut. flush ( )
233+ sut. captureLogs ( )
234234
235235 // Then - should have two separate flush calls
236236 XCTAssertEqual ( testClient. captureLogsDataInvocations. count, 2 )
@@ -268,14 +268,7 @@ final class SentryLogBatcherTests: XCTestCase {
268268 }
269269 wait ( for: [ expectation] , timeout: 1.0 )
270270
271- sutWithRealQueue. flush ( )
272-
273- // Need to wait a bit for flush to complete since this uses a real queue
274- let flushExpectation = self . expectation ( description: " Wait for flush " )
275- DispatchQueue . main. asyncAfter ( deadline: . now( ) + 0.1 ) {
276- flushExpectation. fulfill ( )
277- }
278- waitForExpectations ( timeout: 0.5 )
271+ sutWithRealQueue. captureLogs ( )
279272
280273 // Verify all 10 logs were included in the single batch
281274 let sentData = try XCTUnwrap ( testClient. captureLogsDataInvocations. first) . data
0 commit comments