Skip to content

Commit

Permalink
Fix SyncSenderHandlerTest coverage not reflecting
Browse files Browse the repository at this point in the history
  • Loading branch information
ekigamba committed Jun 20, 2019
1 parent 0cab846 commit 2560f28
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 24 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.smartregister.p2p.model.dao.SenderTransferDao;
import org.smartregister.p2p.shadows.ShadowAppDatabase;
import org.smartregister.p2p.shadows.ShadowPayload;
import org.smartregister.p2p.shadows.ShadowSyncSenderHandler;
import org.smartregister.p2p.shadows.ShadowTasker;
import org.smartregister.p2p.sync.data.JsonData;
import org.smartregister.p2p.sync.data.MultiMediaData;
Expand All @@ -53,13 +52,13 @@
*/

@RunWith(RobolectricTestRunner.class)
@Config(shadows = {ShadowAppDatabase.class, ShadowTasker.class, ShadowSyncSenderHandler.class, ShadowPayload.class})
@Config(shadows = {ShadowAppDatabase.class, ShadowTasker.class, ShadowPayload.class})
public class SyncSenderHandlerTest {

@Rule
public MockitoRule mockitoRule = MockitoJUnit.rule();

private SyncSenderHandler syncSenderHandler;
private TestSyncSenderHandler syncSenderHandler;
@Mock
private P2pModeSelectContract.SenderPresenter senderPresenter;

Expand All @@ -86,7 +85,7 @@ public void setUp() throws Exception {
dataSyncOrder.add(client);
dataSyncOrder.add(event);

syncSenderHandler = Mockito.spy(new SyncSenderHandler(senderPresenter, dataSyncOrder, null));
syncSenderHandler = Mockito.spy(new TestSyncSenderHandler(senderPresenter, dataSyncOrder, null));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package org.smartregister.p2p.sync.handler;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import org.smartregister.p2p.contract.P2pModeSelectContract;
import org.smartregister.p2p.model.DataType;
import org.smartregister.p2p.model.P2pReceivedHistory;

import java.util.List;
import java.util.TreeSet;

/**
* Created by Ephraim Kigamba - [email protected] on 2019-06-12
*/

public class TestSyncSenderHandler extends SyncSenderHandler{

public TestSyncSenderHandler(@NonNull P2pModeSelectContract.SenderPresenter presenter, @NonNull TreeSet<DataType> dataSyncOrder, @Nullable List<P2pReceivedHistory> receivedHistory) {
super(presenter, dataSyncOrder, receivedHistory);
}

@Override
public void startNewThread(@NonNull Runnable runnable) {
runnable.run();
}
}

0 comments on commit 2560f28

Please sign in to comment.