-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Parvathy, Rahul] | Fix. MockMvc Import Issue
- Loading branch information
1 parent
21158ac
commit f9802e2
Showing
10 changed files
with
301 additions
and
289 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
...-atomfeed-service/src/test/java/org/bahmni/feed/openerp/client/OpenERPCustomerFeedIT.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
162 changes: 81 additions & 81 deletions
162
...src/test/java/org/bahmni/feed/openerp/domain/labOrderType/encounter/MapERPOrdersTest.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 |
---|---|---|
@@ -1,81 +1,81 @@ | ||
// package org.bahmni.feed.openerp.domain.labOrderType.encounter; | ||
|
||
// import org.bahmni.feed.openerp.ObjectMapperRepository; | ||
// import org.bahmni.feed.openerp.domain.encounter.MapERPOrders; | ||
// import org.bahmni.feed.openerp.domain.encounter.OpenMRSEncounter; | ||
// import org.bahmni.feed.openerp.domain.visit.OpenMRSVisit; | ||
// import org.bahmni.feed.openerp.testhelper.FileConverter; | ||
// import org.bahmni.openerp.web.request.builder.Parameter; | ||
// import org.junit.Assert; | ||
// import org.junit.Before; | ||
// import org.junit.Test; | ||
// import org.junit.runner.RunWith; | ||
// import org.mockito.Mock; | ||
// import org.mockito.runners.MockitoJUnitRunner; | ||
|
||
// import java.io.IOException; | ||
// import java.util.List; | ||
|
||
// import static org.mockito.Mockito.when; | ||
|
||
// @RunWith(MockitoJUnitRunner.class) | ||
// public class MapERPOrdersTest { | ||
|
||
// private MapERPOrders mapERPOrders; | ||
|
||
// @Mock | ||
// private OpenMRSEncounter openMRSEncounter; | ||
|
||
// @Mock | ||
// private OpenMRSVisit openMRSVisit; | ||
|
||
// @Before | ||
// public void setUp() { | ||
// mapERPOrders = new MapERPOrders(openMRSEncounter, openMRSVisit); | ||
// } | ||
|
||
// @Test | ||
// public void shouldMapOpenERPOrders() throws IOException { | ||
// when(openMRSEncounter.getPatientId()).thenReturn("12345"); | ||
// when(openMRSEncounter.getEncounterUuid()).thenReturn("r5d6789uyt32"); | ||
// when(openMRSEncounter.getLocationName()).thenReturn("Ganyari"); | ||
// List<Parameter> parameterList = mapERPOrders.getParameters("102", "something", "somethingelse"); | ||
|
||
// Assert.assertEquals(8, parameterList.size()); | ||
// Assert.assertEquals("create.sale.order", parameterList.get(0).getValue()); | ||
// Assert.assertEquals("12345", parameterList.get(1).getValue()); | ||
// Assert.assertEquals("r5d6789uyt32", parameterList.get(2).getValue()); | ||
// Assert.assertEquals("Ganyari", parameterList.get(7).getValue()); | ||
// } | ||
|
||
// @Test | ||
// public void shouldMapEncountersWithObsCodedUnRelatedToOrders() throws Exception { | ||
// String orderEncounter = FileConverter.convertToString("orderWithEncObsWithCodedConceptUnRelatedToOrder.json"); | ||
// OpenMRSEncounter encounter = ObjectMapperRepository.objectMapper.readValue(orderEncounter, OpenMRSEncounter.class); | ||
// MapERPOrders mapERPOrders = new MapERPOrders(encounter, openMRSVisit); | ||
// List<Parameter> parameters = mapERPOrders.getParameters("102", "something", "somethingelse"); | ||
// Assert.assertEquals(8, parameters.size()); | ||
// } | ||
|
||
// @Test | ||
// public void shouldMapEncountersWithObsNumericUnRelatedToOrders() throws Exception { | ||
// String orderEncounter = FileConverter.convertToString("orderWithEncObsOfNumericUnRelatedOrder.json"); | ||
// OpenMRSEncounter encounter = ObjectMapperRepository.objectMapper.readValue(orderEncounter, OpenMRSEncounter.class); | ||
// MapERPOrders mapERPOrders = new MapERPOrders(encounter, openMRSVisit); | ||
// List<Parameter> parameters = mapERPOrders.getParameters("102", "something", "somethingelse"); | ||
// Assert.assertEquals(8, parameters.size()); | ||
// } | ||
|
||
// @Test | ||
// public void shouldMapEncountersWithObsDispensedRelatedToOrders() throws Exception { | ||
// String orderEncounter = FileConverter.convertToString("orderWithEncObsCodedWithDispensedRelatedToOrder.json"); | ||
// OpenMRSEncounter encounter = ObjectMapperRepository.objectMapper.readValue(orderEncounter, OpenMRSEncounter.class); | ||
// MapERPOrders mapERPOrders = new MapERPOrders(encounter, openMRSVisit); | ||
// List<Parameter> parameters = mapERPOrders.getParameters("102", "something", "somethingelse"); | ||
// Assert.assertEquals(8, parameters.size()); | ||
// } | ||
|
||
|
||
|
||
|
||
// } | ||
package org.bahmni.feed.openerp.domain.labOrderType.encounter; | ||
|
||
import org.bahmni.feed.openerp.ObjectMapperRepository; | ||
import org.bahmni.feed.openerp.domain.encounter.MapERPOrders; | ||
import org.bahmni.feed.openerp.domain.encounter.OpenMRSEncounter; | ||
import org.bahmni.feed.openerp.domain.visit.OpenMRSVisit; | ||
import org.bahmni.feed.openerp.testhelper.FileConverter; | ||
import org.bahmni.openerp.web.request.builder.Parameter; | ||
import org.junit.Assert; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.mockito.Mock; | ||
import org.mockito.junit.MockitoJUnitRunner; | ||
|
||
import java.io.IOException; | ||
import java.util.List; | ||
|
||
import static org.mockito.Mockito.when; | ||
|
||
@RunWith(MockitoJUnitRunner.class) | ||
public class MapERPOrdersTest { | ||
|
||
private MapERPOrders mapERPOrders; | ||
|
||
@Mock | ||
private OpenMRSEncounter openMRSEncounter; | ||
|
||
@Mock | ||
private OpenMRSVisit openMRSVisit; | ||
|
||
@Before | ||
public void setUp() { | ||
mapERPOrders = new MapERPOrders(openMRSEncounter, openMRSVisit); | ||
} | ||
|
||
@Test | ||
public void shouldMapOpenERPOrders() throws IOException { | ||
when(openMRSEncounter.getPatientId()).thenReturn("12345"); | ||
when(openMRSEncounter.getEncounterUuid()).thenReturn("r5d6789uyt32"); | ||
when(openMRSEncounter.getLocationName()).thenReturn("Ganyari"); | ||
List<Parameter> parameterList = mapERPOrders.getParameters("102", "something", "somethingelse"); | ||
|
||
Assert.assertEquals(8, parameterList.size()); | ||
Assert.assertEquals("create.sale.order", parameterList.get(0).getValue()); | ||
Assert.assertEquals("12345", parameterList.get(1).getValue()); | ||
Assert.assertEquals("r5d6789uyt32", parameterList.get(2).getValue()); | ||
Assert.assertEquals("Ganyari", parameterList.get(7).getValue()); | ||
} | ||
|
||
@Test | ||
public void shouldMapEncountersWithObsCodedUnRelatedToOrders() throws Exception { | ||
String orderEncounter = FileConverter.convertToString("orderWithEncObsWithCodedConceptUnRelatedToOrder.json"); | ||
OpenMRSEncounter encounter = ObjectMapperRepository.objectMapper.readValue(orderEncounter, OpenMRSEncounter.class); | ||
MapERPOrders mapERPOrders = new MapERPOrders(encounter, openMRSVisit); | ||
List<Parameter> parameters = mapERPOrders.getParameters("102", "something", "somethingelse"); | ||
Assert.assertEquals(8, parameters.size()); | ||
} | ||
|
||
@Test | ||
public void shouldMapEncountersWithObsNumericUnRelatedToOrders() throws Exception { | ||
String orderEncounter = FileConverter.convertToString("orderWithEncObsOfNumericUnRelatedOrder.json"); | ||
OpenMRSEncounter encounter = ObjectMapperRepository.objectMapper.readValue(orderEncounter, OpenMRSEncounter.class); | ||
MapERPOrders mapERPOrders = new MapERPOrders(encounter, openMRSVisit); | ||
List<Parameter> parameters = mapERPOrders.getParameters("102", "something", "somethingelse"); | ||
Assert.assertEquals(8, parameters.size()); | ||
} | ||
|
||
@Test | ||
public void shouldMapEncountersWithObsDispensedRelatedToOrders() throws Exception { | ||
String orderEncounter = FileConverter.convertToString("orderWithEncObsCodedWithDispensedRelatedToOrder.json"); | ||
OpenMRSEncounter encounter = ObjectMapperRepository.objectMapper.readValue(orderEncounter, OpenMRSEncounter.class); | ||
MapERPOrders mapERPOrders = new MapERPOrders(encounter, openMRSVisit); | ||
List<Parameter> parameters = mapERPOrders.getParameters("102", "something", "somethingelse"); | ||
Assert.assertEquals(8, parameters.size()); | ||
} | ||
|
||
|
||
|
||
|
||
} |
Oops, something went wrong.