-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #270 from OpenSRP/issue/269-syncprocessor-reproces…
…sing Added an intermediate state during sync of locally processed events
- Loading branch information
Showing
5 changed files
with
94 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
opensrp-app/src/test/java/org/smartregister/sync/ClientProcessorForJavaTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.smartregister.sync; | ||
|
||
import android.content.Context; | ||
|
||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.mockito.Mock; | ||
import org.mockito.Mockito; | ||
import org.mockito.MockitoAnnotations; | ||
import org.smartregister.BaseUnitTest; | ||
import org.smartregister.domain.db.Event; | ||
|
||
public class ClientProcessorForJavaTest extends BaseUnitTest { | ||
|
||
@Mock | ||
private Context context; | ||
|
||
|
||
@Before | ||
public void setUp() throws Exception { | ||
MockitoAnnotations.initMocks(this); | ||
} | ||
|
||
@Test | ||
public void testProcessEventMarksItSaved() throws Exception { | ||
ClientProcessorForJava clientProcessorForJava = Mockito.spy(new ClientProcessorForJava(context)); | ||
Event mockEvent = Mockito.mock(Event.class); | ||
clientProcessorForJava.processEvent(mockEvent, null, null); | ||
|
||
Mockito.verify(clientProcessorForJava).completeProcessing(mockEvent); | ||
} | ||
} |