@@ -71,39 +71,42 @@ public void setUp() {
7171 Leanplum .setApplicationContext (context );
7272 }
7373
74- /**
75- * Test that read writes happened sequentially when calling sendNow().
76- */
74+ /** Test that read writes happened sequentially when calling sendNow(). */
7775 @ Test
7876 public void shouldWriteRequestAndSendInSequence () throws InterruptedException {
7977 // Given a request.
8078 Map <String , Object > params = new HashMap <>();
8179 params .put ("data1" , "value1" );
8280 params .put ("data2" , "value2" );
83- final ThreadRequestSequenceRecorder threadRequestSequenceRecorder = new ThreadRequestSequenceRecorder ();
84- Request request = new Request (POST , Constants .Methods .START , params , threadRequestSequenceRecorder );
81+ final ThreadRequestSequenceRecorder threadRequestSequenceRecorder =
82+ new ThreadRequestSequenceRecorder ();
83+ Request request =
84+ new Request (POST , Constants .Methods .START , params , threadRequestSequenceRecorder );
8585 request .setAppId ("fskadfshdbfa" , "wee5w4waer422323" );
8686
87- new Thread (new Runnable () {
88- @ Override
89- public void run () {
90- try {
91- Thread .sleep (100 );
92- } catch (InterruptedException e ) {
93- throw new RuntimeException (e );
94- }
95- threadRequestSequenceRecorder .writeSemaphore .release (1 );
96- }
97- }).start ();
87+ new Thread (
88+ new Runnable () {
89+ @ Override
90+ public void run () {
91+ try {
92+ Thread .sleep (100 );
93+ } catch (InterruptedException e ) {
94+ throw new RuntimeException (e );
95+ }
96+ threadRequestSequenceRecorder .writeSemaphore .release (1 );
97+ }
98+ })
99+ .start ();
98100
99- // Then the request is written to the local db first, and then read and sent.
101+ // When the request is sent.
100102 request .sendIfConnected ();
101103
102104 threadRequestSequenceRecorder .testThreadSemaphore .tryAcquire (5000 , TimeUnit .MILLISECONDS );
103105
104- // When the request is sent.
106+ // Then the request is written to the local db first, and then read and sent.
105107 threadRequestSequenceRecorder .assertCallSequence ();
106108 }
109+
107110 /**
108111 * Tests the testRemoveIrrelevantBackgroundStartRequests method.
109112 * <p>
0 commit comments