11package com .exceptionless .exceptionlessclient .queue ;
22
3- import com .exceptionless .exceptionlessclient .TestFixtures ;
4- import com .exceptionless .exceptionlessclient .configuration .Configuration ;
3+ import com .exceptionless .exceptionlessclient .configuration .ValueProvider ;
54import com .exceptionless .exceptionlessclient .models .Event ;
65import com .exceptionless .exceptionlessclient .storage .InMemoryStorage ;
76import com .exceptionless .exceptionlessclient .storage .InMemoryStorageProvider ;
@@ -33,9 +32,6 @@ public class DefaultEventQueueTest {
3332
3433 @ BeforeEach
3534 public void setup () {
36- Configuration configuration =
37- TestFixtures .aDefaultConfiguration ().submissionBatchSize (1 ).build ();
38-
3935 storage = InMemoryStorage .<Event >builder ().build ();
4036 doReturn (storage ).when (storageProvider ).getQueue ();
4137
@@ -44,7 +40,7 @@ public void setup() {
4440 DefaultEventQueue .builder ()
4541 .storageProvider (storageProvider )
4642 .submissionClient (submissionClient )
47- .configuration ( configuration )
43+ .submissionBatchSize ( ValueProvider . of ( 1 ) )
4844 .processingIntervalInSecs (
4945 3600 ) // We don't want the automatic timer to run in between tests by default
5046 .build ();
@@ -260,13 +256,11 @@ public void itShouldSuspendProcessingByDefault() {
260256
261257 @ Test
262258 public void itShouldReduceSubmissionBatchSizeIfRequestEntitiesAreTooLarge () {
263- Configuration configuration =
264- TestFixtures .aDefaultConfiguration ().submissionBatchSize (3 ).build ();
265259 queue =
266260 DefaultEventQueue .builder ()
267261 .storageProvider (storageProvider )
268262 .submissionClient (submissionClient )
269- .configuration ( configuration )
263+ .submissionBatchSize ( ValueProvider . of ( 3 ) )
270264 .processingIntervalInSecs (
271265 3600 ) // We don't want the automatic timer to run in between tests by default
272266 .build ();
@@ -311,13 +305,11 @@ public void itShouldDiscardEventsIfItCantReduceSubmissionSizeAndRequestEntitiesA
311305
312306 @ Test
313307 public void itShouldResetSubmissionBatchSizeOnNextSuccessfulResponse () {
314- Configuration configuration =
315- TestFixtures .aDefaultConfiguration ().submissionBatchSize (3 ).build ();
316308 queue =
317309 DefaultEventQueue .builder ()
318310 .storageProvider (storageProvider )
319311 .submissionClient (submissionClient )
320- .configuration ( configuration )
312+ .submissionBatchSize ( ValueProvider . of ( 3 ) )
321313 .processingIntervalInSecs (
322314 3600 ) // We don't want the automatic timer to run in between tests by default
323315 .build ();
@@ -350,13 +342,11 @@ public void itShouldProcessEventsUsingTimer() throws InterruptedException {
350342 SubmissionResponse .builder ().body ("test-message" ).code (200 ).build ();
351343 doReturn (response ).when (submissionClient ).postEvents (List .of (event ));
352344
353- Configuration configuration =
354- TestFixtures .aDefaultConfiguration ().submissionBatchSize (1 ).build ();
355345 queue =
356346 DefaultEventQueue .builder ()
357347 .storageProvider (storageProvider )
358348 .submissionClient (submissionClient )
359- .configuration ( configuration )
349+ .submissionBatchSize ( ValueProvider . of ( 1 ) )
360350 .processingIntervalInSecs (1 )
361351 .build ();
362352 queue .onEventsPosted (testHandler );
0 commit comments