Skip to content

Commit

Permalink
Follow up to clean up javadocs and add one more unit test - TRUNK-4214
Browse files Browse the repository at this point in the history
  • Loading branch information
wluyima committed Feb 25, 2014
1 parent 3a9e948 commit 4fac51c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
3 changes: 2 additions & 1 deletion api/src/main/java/org/openmrs/api/OrderService.java
Expand Up @@ -320,8 +320,9 @@ public <Ord extends Order> List<Ord> getActiveOrders(Patient patient, Class<Ord>
* not
* @return List<OrderFrequency>
* @since 1.10
* @should get non retired frequencies with names matching the search phrase
* @should get non retired frequencies with names matching the phrase if includeRetired is false
* @should include retired frequencies if includeRetired is set to true
* @should get frequencies with names that match the phrase and locales if exact locale is false
* @should get frequencies with names that match the phrase and locale if exact locale is true
* @should return unique frequencies
* @should reject a null search phrase
Expand Down
2 changes: 0 additions & 2 deletions api/src/main/java/org/openmrs/api/impl/OrderServiceImpl.java
Expand Up @@ -389,7 +389,6 @@ public OrderFrequency getOrderFrequencyByUuid(String uuid) {

/**
* @see OrderService#getOrderFrequencies(boolean)
* @param includeRetired
*/
@Override
public List<OrderFrequency> getOrderFrequencies(boolean includeRetired) {
Expand All @@ -398,7 +397,6 @@ public List<OrderFrequency> getOrderFrequencies(boolean includeRetired) {

/**
* @see OrderService#getOrderFrequencies(String, java.util.Locale, boolean, boolean)
* @param includeRetired
*/
@Override
public List<OrderFrequency> getOrderFrequencies(String searchPhrase, Locale locale, boolean exactLocale,
Expand Down
22 changes: 20 additions & 2 deletions api/src/test/java/org/openmrs/api/OrderServiceTest.java
Expand Up @@ -873,11 +873,13 @@ public void saveOrder_shouldSaveARevisedOrder() throws Exception {
}

/**
* @verifies get non retired frequencies with names matching the search phrase
* @verifies get non retired frequencies with names matching the phrase if includeRetired is
* false
* @see OrderService#getOrderFrequencies(String, java.util.Locale, boolean, boolean)
*/
@Test
public void getOrderFrequencies_shouldGetNonRetiredFrequenciesWithNamesMatchingTheSearchPhrase() throws Exception {
public void getOrderFrequencies_shouldGetNonRetiredFrequenciesWithNamesMatchingThePhraseIfIncludeRetiredIsFalse()
throws Exception {
executeDataSet("org/openmrs/api/include/OrderServiceTest-otherOrderFrequencies.xml");
List<OrderFrequency> orderFrequencies = orderService.getOrderFrequencies("once", Locale.US, false, false);
assertEquals(2, orderFrequencies.size());
Expand Down Expand Up @@ -906,6 +908,22 @@ public void getOrderFrequencies_shouldIncludeRetiredFrequenciesIfIncludeRetiredI
assertTrue(containsId(orderFrequencies, 103));
}

/**
* @verifies get frequencies with names that match the phrase and locales if exact locale is
* false
* @see OrderService#getOrderFrequencies(String, java.util.Locale, boolean, boolean)
*/
@Test
public void getOrderFrequencies_shouldGetFrequenciesWithNamesThatMatchThePhraseAndLocalesIfExactLocaleIsFalse()
throws Exception {
executeDataSet("org/openmrs/api/include/OrderServiceTest-otherOrderFrequencies.xml");
List<OrderFrequency> orderFrequencies = orderService.getOrderFrequencies("ce", Locale.US, false, false);
assertEquals(3, orderFrequencies.size());
assertTrue(containsId(orderFrequencies, 100));
assertTrue(containsId(orderFrequencies, 101));
assertTrue(containsId(orderFrequencies, 102));
}

/**
* @verifies get frequencies with names that match the phrase and locale if exact locale is true
* @see OrderService#getOrderFrequencies(String, java.util.Locale, boolean, boolean)
Expand Down

0 comments on commit 4fac51c

Please sign in to comment.