1
1
package com .exceptionless .exceptionlessclient .queue ;
2
2
3
- import com .exceptionless .exceptionlessclient .TestFixtures ;
4
- import com .exceptionless .exceptionlessclient .configuration .Configuration ;
3
+ import com .exceptionless .exceptionlessclient .configuration .ValueProvider ;
5
4
import com .exceptionless .exceptionlessclient .models .Event ;
6
5
import com .exceptionless .exceptionlessclient .storage .InMemoryStorage ;
7
6
import com .exceptionless .exceptionlessclient .storage .InMemoryStorageProvider ;
@@ -33,9 +32,6 @@ public class DefaultEventQueueTest {
33
32
34
33
@ BeforeEach
35
34
public void setup () {
36
- Configuration configuration =
37
- TestFixtures .aDefaultConfiguration ().submissionBatchSize (1 ).build ();
38
-
39
35
storage = InMemoryStorage .<Event >builder ().build ();
40
36
doReturn (storage ).when (storageProvider ).getQueue ();
41
37
@@ -44,7 +40,7 @@ public void setup() {
44
40
DefaultEventQueue .builder ()
45
41
.storageProvider (storageProvider )
46
42
.submissionClient (submissionClient )
47
- .configuration ( configuration )
43
+ .submissionBatchSize ( ValueProvider . of ( 1 ) )
48
44
.processingIntervalInSecs (
49
45
3600 ) // We don't want the automatic timer to run in between tests by default
50
46
.build ();
@@ -260,13 +256,11 @@ public void itShouldSuspendProcessingByDefault() {
260
256
261
257
@ Test
262
258
public void itShouldReduceSubmissionBatchSizeIfRequestEntitiesAreTooLarge () {
263
- Configuration configuration =
264
- TestFixtures .aDefaultConfiguration ().submissionBatchSize (3 ).build ();
265
259
queue =
266
260
DefaultEventQueue .builder ()
267
261
.storageProvider (storageProvider )
268
262
.submissionClient (submissionClient )
269
- .configuration ( configuration )
263
+ .submissionBatchSize ( ValueProvider . of ( 3 ) )
270
264
.processingIntervalInSecs (
271
265
3600 ) // We don't want the automatic timer to run in between tests by default
272
266
.build ();
@@ -311,13 +305,11 @@ public void itShouldDiscardEventsIfItCantReduceSubmissionSizeAndRequestEntitiesA
311
305
312
306
@ Test
313
307
public void itShouldResetSubmissionBatchSizeOnNextSuccessfulResponse () {
314
- Configuration configuration =
315
- TestFixtures .aDefaultConfiguration ().submissionBatchSize (3 ).build ();
316
308
queue =
317
309
DefaultEventQueue .builder ()
318
310
.storageProvider (storageProvider )
319
311
.submissionClient (submissionClient )
320
- .configuration ( configuration )
312
+ .submissionBatchSize ( ValueProvider . of ( 3 ) )
321
313
.processingIntervalInSecs (
322
314
3600 ) // We don't want the automatic timer to run in between tests by default
323
315
.build ();
@@ -350,13 +342,11 @@ public void itShouldProcessEventsUsingTimer() throws InterruptedException {
350
342
SubmissionResponse .builder ().body ("test-message" ).code (200 ).build ();
351
343
doReturn (response ).when (submissionClient ).postEvents (List .of (event ));
352
344
353
- Configuration configuration =
354
- TestFixtures .aDefaultConfiguration ().submissionBatchSize (1 ).build ();
355
345
queue =
356
346
DefaultEventQueue .builder ()
357
347
.storageProvider (storageProvider )
358
348
.submissionClient (submissionClient )
359
- .configuration ( configuration )
349
+ .submissionBatchSize ( ValueProvider . of ( 1 ) )
360
350
.processingIntervalInSecs (1 )
361
351
.build ();
362
352
queue .onEventsPosted (testHandler );
0 commit comments