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

openmrs / openmrs-module-webservices.rest / 22095623804

17 Feb 2026 10:52AM UTC coverage: 68.572% (+0.03%) from 68.541%
22095623804

push

github

web-flow
RESTWS-1014: Implemented ConceptTreeResource and DrugsByConceptSearch… (#695)

* RESTWS-1014: Implemented ConceptTreeResource and DrugsByConceptSearchHandler

* RESTWS-1014: Added tests

* RESTWS1014: Throwing exception when concept param is not passed

* RESTWS-1014: Applied new identation, code improvements

* RESTWS-1014: Code review

44 of 53 new or added lines in 2 files covered. (83.02%)

99 existing lines in 4 files now uncovered.

9731 of 14191 relevant lines covered (68.57%)

0.69 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/validation/ValidationException.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.validation;
11

12
import org.openmrs.api.APIException;
13
import org.springframework.validation.Errors;
14

15
/**
16
 * Exception that represents a Spring validation error. Includes the Spring Errors object associated
17
 * This is just a copy of the ValidationException class in 1.10.x, with the Spring Errors object
18
 * added. The Spring Errors object will be also added to the ValidationException in core as part of
19
 * TRUNK-4296 Once REST-WS only supports versions of core that have this change, this class (and
20
 * ValidateUtil) can be removed, and we will not have to explicitly call the "validate" within the
21
 * DelegatingCrudResource, as we can rely on the underlying API validation to do the right thing,
22
 * and return a ValidationException with Errors which we can trap in the BaseRestController
23
 * 
24
 * @deprecated since 3.2.0, use {@link org.openmrs.api.ValidationException} instead  
25
 * Remove this when this ticket is done: https://openmrs.atlassian.net/browse/RESTWS-1016
26
 */
27
@Deprecated
28
public class ValidationException extends APIException {
29
        
30
        public static final long serialVersionUID = 1L;
31
        
32
        private Errors errors;
33
        
34
        /**
35
         * Default empty constructor. If at all possible, don't use this one, but use the
36
         */
UNCOV
37
        public ValidationException() {
×
UNCOV
38
        }
×
39
        
40
        /**
41
         * General constructor to give the end user a helpful message that relates to why this error
42
         * occurred.
43
         * 
44
         * @param message helpful message string for the end user
45
         */
46
        public ValidationException(String message) {
UNCOV
47
                super(message);
×
UNCOV
48
        }
×
49
        
50
        /**
51
         * Constructor used to associate an Spring Errors object with a ValidationException
52
         * 
53
         * @param errors
54
         */
UNCOV
55
        public ValidationException(Errors errors) {
×
UNCOV
56
                this.errors = errors;
×
UNCOV
57
        }
×
58
        
59
        /**
60
         * Constructor to give the end user a helpful message and to associate an Spring Errors object
61
         * with a ValidationException
62
         * 
63
         * @param errors
64
         */
65
        public ValidationException(String message, Errors errors) {
UNCOV
66
                super(message);
×
UNCOV
67
                this.errors = errors;
×
UNCOV
68
        }
×
69
        
70
        /**
71
         * General constructor to give the end user a helpful message and to also propagate the parent
72
         * error exception message.
73
         * 
74
         * @param message helpful message string for the end user
75
         * @param cause the parent exception cause that this ValidationException is wrapping around
76
         */
77
        public ValidationException(String message, Throwable cause) {
UNCOV
78
                super(message, cause);
×
UNCOV
79
        }
×
80
        
81
        /**
82
         * Constructor used to simply chain a parent exception cause to an ValidationException.
83
         * 
84
         * @param cause the parent exception cause that this ValidationException is wrapping around
85
         */
86
        public ValidationException(Throwable cause) {
UNCOV
87
                super(cause);
×
UNCOV
88
        }
×
89
        
90
        public Errors getErrors() {
91
                return errors;
×
92
        }
93
        
94
        public void setErrors(Errors errors) {
UNCOV
95
                this.errors = errors;
×
UNCOV
96
        }
×
97
}
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