Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TRUNK-3586 Update unit testing environment to use mocks #334

Merged
merged 5 commits into from Jun 17, 2013

Conversation

rkorytkowski
Copy link
Member

Simplifies mocking services accessed through Context.get...Service().

@@ -249,7 +249,7 @@ public static UserContext getUserContext() {
*
* @return the current ServiceContext
*/
private static ServiceContext getServiceContext() {
static ServiceContext getServiceContext() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this expose Context to being insecurely impacted by modules directly, or is that not a big deal (or even a feature)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's a big deal since the field has only package visibility. Actually, ServiceContext is a Spring bean and can be easily accessed even without this change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UserContext would be the one to worry about security on. Although as Rafal said, spring lets you get around almost anything.

rkorytkowski added a commit that referenced this pull request Jun 17, 2013
TRUNK-3586 Update unit testing environment to use mocks
@rkorytkowski rkorytkowski merged commit 97464e2 into openmrs:master Jun 17, 2013
RandilaP pushed a commit to RandilaP/openmrs-core that referenced this pull request Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants