-
Notifications
You must be signed in to change notification settings - Fork 18
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 #331 from OpenSRP/remove_deleted_vaccines
Remove deleted vaccines
- Loading branch information
Showing
5 changed files
with
53 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
31 changes: 31 additions & 0 deletions
31
opensrp-chw-core/src/test/java/org/smartregister/chw/core/sync/CoreClientProcessorTest.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,31 @@ | ||
package org.smartregister.chw.core.sync; | ||
|
||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.mockito.Mock; | ||
import org.mockito.Mockito; | ||
import org.mockito.MockitoAnnotations; | ||
import org.smartregister.chw.core.BaseUnitTest; | ||
import org.smartregister.immunization.domain.Vaccine; | ||
import org.smartregister.immunization.repository.VaccineRepository; | ||
|
||
public class CoreClientProcessorTest extends BaseUnitTest { | ||
|
||
@Mock | ||
private VaccineRepository vaccineRepository; | ||
|
||
@Before | ||
public void setUp() { | ||
MockitoAnnotations.initMocks(this); | ||
} | ||
|
||
@Test | ||
public void testAddVaccine() { | ||
Vaccine vaccine = new Vaccine(); | ||
vaccine.setName("MEASLES 1"); | ||
|
||
CoreClientProcessor.addVaccine(vaccineRepository, vaccine); | ||
Mockito.verify(vaccineRepository).add(vaccine); | ||
Mockito.verify(vaccineRepository).updateFtsSearch(Mockito.any()); | ||
} | ||
} |