• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openmrs / openmrs-module-webservices.rest / 15888493103

25 Jun 2025 10:27PM UTC coverage: 69.92% (+21.6%) from 48.289%
15888493103

push

github

web-flow
RESTWS-983: Build module against openmrs-core 2.4.x and make it the lowest supported version (#662)

* RESTWS-983 Build module against openmrs-core 2.4.x and make it the lowest supported version

* RESTWS-983 Move omod-2.3 and lower classes to omod-2.4

* RESTWS-983 Fixing tests

16 of 27 new or added lines in 13 files covered. (59.26%)

9 existing lines in 3 files now uncovered.

9835 of 14066 relevant lines covered (69.92%)

0.7 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/omod-common/src/main/java/org/openmrs/module/webservices/rest/OpenmrsPathMatcher.java
1
/**
2
 * This Source Code Form is subject to the terms of the Mozilla Public License,
3
 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
4
 * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
5
 * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
6
 *
7
 * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
8
 * graphic logo is a trademark of OpenMRS Inc.
9
 */
10
package org.openmrs.module.webservices.rest;
11

12
import java.util.Comparator;
13
import java.util.Map;
14

15
import org.springframework.util.AntPathMatcher;
16
import org.springframework.util.PathMatcher;
17

UNCOV
18
public class OpenmrsPathMatcher implements PathMatcher {
×
19
        
UNCOV
20
        private final AntPathMatcher delegate = new AntPathMatcher();
×
21
        
22
        @Override
23
        public boolean isPattern(String path) {
24
                return this.delegate.isPattern(path);
×
25
        }
26
        
27
        @Override
28
        public boolean match(String pattern, String path) {
29
                return this.delegate.match(pattern, path);
×
30
        }
31
        
32
        @Override
33
        public boolean matchStart(String pattern, String path) {
34
                return this.delegate.matchStart(pattern, path);
×
35
        }
36
        
37
        @Override
38
        public String extractPathWithinPattern(String pattern, String path) {
39
                return this.delegate.extractPathWithinPattern(pattern, path);
×
40
        }
41
        
42
        @Override
43
        public Map<String, String> extractUriTemplateVariables(String pattern, String path) {
44
                //see RESTWS-606
45
                if (path != null && pattern != null && path.startsWith("/rest/") && path.contains(".") && !path.endsWith("/")
×
46
                        && pattern.endsWith(".*")) {
×
47
                        //a pattern like /rest/v1/{resource}/{uuid}.* needs to be replaced with /rest/v1/{resource}/{uuid}
48
                        //in order to match a path like /rest/v1/systemsetting/concept.defaultConceptMapType
49
                        pattern = pattern.replace(".*", "");
×
50
                }
51
                return this.delegate.extractUriTemplateVariables(pattern, path);
×
52
        }
53
        
54
        @Override
55
        public Comparator<String> getPatternComparator(final String path) {
56
                return delegate.getPatternComparator(path);
×
57
        }
58
        
59
        @Override
60
        public String combine(String pattern1, String pattern2) {
61
                return this.delegate.combine(pattern1, pattern2);
×
62
        }
63
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc