-
Notifications
You must be signed in to change notification settings - Fork 245
REPORT-912: Update to OpenMRS platform 2.7.3 and Support Java 21 #261
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
58cbd32
Update to Platform 2.7.0 and Support Java 21
wikumChamith a77e050
Merge branch 'master' into REPORT-912
wikumChamith 0973e96
Migrate to org.openmrs.test.jupiter.BaseModuleContextSensitiveTest
wikumChamith 7a99af6
Merge branch 'master' into REPORT-912
wikumChamith ca8eb8d
Add the EvaluationProfilerTest24On
wikumChamith File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,15 +14,12 @@ | |
|
|
||
| import org.junit.Before; | ||
| import org.junit.Test; | ||
| import org.junit.runner.RunWith; | ||
| import org.openmrs.api.context.Context; | ||
| import org.powermock.api.mockito.PowerMockito; | ||
| import org.powermock.core.classloader.annotations.PrepareForTest; | ||
| import org.powermock.modules.junit4.PowerMockRunner; | ||
| import org.openmrs.test.BaseModuleContextSensitiveTest; | ||
| import org.openmrs.test.SkipBaseSetup; | ||
|
|
||
| @RunWith(PowerMockRunner.class) | ||
| @PrepareForTest(Context.class) | ||
| public class PrivilegedDataConverterTest { | ||
| @SkipBaseSetup | ||
| public class PrivilegedDataConverterTest extends BaseModuleContextSensitiveTest { | ||
Ruhanga marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| public static final String INPUT = "input"; | ||
| public static final String REPLACEMENT = "****"; | ||
|
|
@@ -32,16 +29,24 @@ public class PrivilegedDataConverterTest { | |
|
|
||
| @Before | ||
| public void setUp() throws Exception { | ||
| PowerMockito.mockStatic(Context.class); | ||
| PowerMockito.when(Context.hasPrivilege(HAS_PRIV)).thenReturn(true); | ||
| PowerMockito.when(Context.hasPrivilege(DOES_NOT_HAVE_PRIV)).thenReturn(false); | ||
| initializeInMemoryDatabase(); | ||
| executeDataSet("org/openmrs/module/reporting/include/PrivilegeTest.xml"); | ||
| Context.logout(); | ||
|
||
| Context.authenticate("test", "test"); | ||
| } | ||
|
|
||
| @Test | ||
| public void testConvertWithPrivilege() throws Exception { | ||
| PrivilegedDataConverter converter = new PrivilegedDataConverter(HAS_PRIV); | ||
| converter.setReplacement(REPLACEMENT); | ||
| assertThat((String) converter.convert(INPUT), is(INPUT)); | ||
| public void testConvertWithPrivilege() { | ||
| try { | ||
| Context.addProxyPrivilege(HAS_PRIV); | ||
| Context.hasPrivilege(HAS_PRIV); | ||
| PrivilegedDataConverter converter = new PrivilegedDataConverter(HAS_PRIV); | ||
| converter.setReplacement(REPLACEMENT); | ||
| assertThat((String) converter.convert(INPUT), is(INPUT)); | ||
| } | ||
| finally { | ||
| Context.removeProxyPrivilege(HAS_PRIV); | ||
| } | ||
| } | ||
|
|
||
| @Test | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
api-tests/src/test/resources/org/openmrs/module/reporting/include/PrivilegeTest.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| <?xml version='1.0' encoding='UTF-8'?> | ||
| <!-- | ||
|
|
||
| This Source Code Form is subject to the terms of the Mozilla Public License, | ||
| v. 2.0. If a copy of the MPL was not distributed with this file, You can | ||
| obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under | ||
| the terms of the Healthcare Disclaimer located at http://openmrs.org/license. | ||
|
|
||
| Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS | ||
| graphic logo is a trademark of OpenMRS Inc. | ||
|
|
||
| --> | ||
| <dataset> | ||
| <person person_id="3" gender="" birthdate="1975-06-30" birthdate_estimated="false" dead="false" date_created="2005-01-01 00:00:00.0" voided="false" uuid="6adb7c42-cfd2-4301-b53b-ff17c5654ffa"/> | ||
| <users user_id="3" person_id="3" system_id="1-8" username="test" password="4a1750c8607d0fa237de36c6305715c223415189" salt="c788c6ad82a157b712392ca695dfcf2eed193d7f" secret_question="" creator="1" date_created="2005-01-01 00:00:00.0" changed_by="1" date_changed="2007-09-20 21:54:12.0" retired="false" retire_reason="" uuid="1010d442-e134-11de-babe-001e378eb67f"/> | ||
| <user_role user_id="1" role="Authenticated"/> | ||
| </dataset> |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.