Skip to content

Commit 306a9fb

Browse files
committed
correct global property value for encounter resource, and cleaned up integration test
1 parent d7582fe commit 306a9fb

File tree

3 files changed

+9
-57
lines changed

3 files changed

+9
-57
lines changed

openmrs-atomfeed-api/src/main/java/org/openmrs/module/atomfeed/advisor/EmrEncouterServiceAdvisor.java

-27
This file was deleted.

openmrs-atomfeed-api/src/main/resources/liquibase.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<comment>Adding global property for encounter feed publish url</comment>
5151
<insert tableName="global_property">
5252
<column name="property" value="encounter.feed.publish.url"/>
53-
<column name="property_value" value="/openmrs/ws/rest/emrapi/encounter/%s?includeAll=true"/>
53+
<column name="property_value" value="/openmrs/ws/rest/v1/encounter/%s?v=full"/>
5454
<column name="uuid" valueComputed="UUID()"/>
5555
<column name="description" value="Url to be published on encounter save."/>
5656
</insert>

openmrs-atomfeed-omod/src/test/java/org/openmrs/module/atomfeed/SpikeTest.java openmrs-atomfeed-omod/src/test/java/org/openmrs/module/atomfeed/IntegrationTest.java

+8-29
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package org.openmrs.module.atomfeed;
22

3+
import static org.hamcrest.core.Is.is;
4+
import static org.junit.Assert.assertThat;
35
import static org.mockito.Mockito.mock;
46
import static org.mockito.Mockito.when;
57

@@ -30,7 +32,7 @@
3032
import liquibase.exception.LiquibaseException;
3133
import liquibase.resource.ClassLoaderResourceAccessor;
3234

33-
public class SpikeTest extends BaseModuleWebContextSensitiveTest {
35+
public class IntegrationTest extends BaseModuleWebContextSensitiveTest {
3436

3537
@Autowired
3638
EncounterService encounterService;
@@ -41,21 +43,6 @@ public class SpikeTest extends BaseModuleWebContextSensitiveTest {
4143
@Autowired
4244
AtomFeedController atomFeedController;
4345

44-
// @Before
45-
// public void setUp() throws Exception {
46-
// Connection connection = getConnection();
47-
// Database liqubaseConnection = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(
48-
// new JdbcConnection(connection));
49-
// liqubaseConnection.setDatabaseChangeLogTableName("LIQUIBASECHANGELOG");
50-
// liqubaseConnection.setDatabaseChangeLogLockTableName("LIQUIBASECHANGELOGLOCK");
51-
//
52-
// Liquibase liquibase = new Liquibase("liquibase.xml", new ClassLoaderResourceAccessor(getClass()
53-
// .getClassLoader()), liqubaseConnection);
54-
// liquibase.update(null);
55-
//
56-
// connection.commit();
57-
// }
58-
5946
@Before
6047
public void setUp() throws Exception {
6148
Context.getAdministrationService().executeSQL("CREATE TABLE event_records_offset_marker (\n"
@@ -108,6 +95,9 @@ public void setUp() throws Exception {
10895

10996
@Test
11097
public void testEverything() throws Exception {
98+
List<List<Object>> rows = Context.getAdministrationService().executeSQL("select * from event_records_queue", true);
99+
assertThat(rows.size(), is(0));
100+
111101
Encounter encounter = encounterService.getEncounter(5);
112102
encounter.setEncounterDatetime(new Date());
113103
encounterService.saveEncounter(encounter);
@@ -121,19 +111,8 @@ public void testEverything() throws Exception {
121111
HttpServletRequest request = mock(HttpServletRequest.class);
122112
when(request.getRequestURL()).thenReturn(url);
123113

124-
List<List<Object>> rows = Context.getAdministrationService().executeSQL("select * from event_records_queue", true);
125-
for (List<Object> row : rows) {
126-
for (Object o : row) {
127-
System.out.print(o);
128-
System.out.print("\t");
129-
}
130-
131-
System.out.println("");
132-
}
133-
134-
// String feed = atomFeedController.getRecentEventFeedForCategory(request, "Patient");
135-
// System.out.println("Feed:");
136-
// System.out.println(feed);
114+
rows = Context.getAdministrationService().executeSQL("select * from event_records_queue", true);
115+
assertThat(rows.size(), is(2));
137116
}
138117

139118
}

0 commit comments

Comments
 (0)