From 1e024ef3f50988b1f75fc8576f6f5531f6773b58 Mon Sep 17 00:00:00 2001 From: mherman22 Date: Mon, 16 Jun 2025 18:25:53 +0300 Subject: [PATCH 1/5] Update adminui module to 2.8.0-SNAPSHOT --- api/pom.xml | 16 +++-- .../org/openmrs/module/adminui/TestUtils.java | 70 +++++++------------ .../account/AccountServiceComponentTest.java | 26 +++---- .../adminui/account/AccountServiceTest.java | 59 ++++++---------- .../account/AdminUiAccountValidatorTest.java | 62 ++++++++-------- .../resources/TestingApplicationContext.xml | 6 +- .../resources/accountComponentTestDataset.xml | 4 +- .../org.mockito.plugins.MockMaker | 1 + api/src/test/resources/test-hibernate.cfg.xml | 24 ------- omod/pom.xml | 5 -- ...viderTabContentPaneFragmentController.java | 4 +- .../accounts/AccountPageController.java | 24 +++---- omod/src/main/resources/config.xml | 1 - pom.xml | 55 ++++++--------- 14 files changed, 143 insertions(+), 214 deletions(-) create mode 100644 api/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker delete mode 100644 api/src/test/resources/test-hibernate.cfg.xml diff --git a/api/pom.xml b/api/pom.xml index 344a1286..2055469f 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -32,13 +32,14 @@ org.openmrs.api openmrs-api - jar + provided org.openmrs.web openmrs-web jar + provided @@ -64,11 +65,6 @@ - - org.openmrs.module - providermanagement-api - - org.openmrs.module uiframework-api @@ -79,6 +75,14 @@ legacyui-omod + + + javax.servlet + javax.servlet-api + 3.1.0 + test + + diff --git a/api/src/test/java/org/openmrs/module/adminui/TestUtils.java b/api/src/test/java/org/openmrs/module/adminui/TestUtils.java index ec2459ef..88bfc8e6 100644 --- a/api/src/test/java/org/openmrs/module/adminui/TestUtils.java +++ b/api/src/test/java/org/openmrs/module/adminui/TestUtils.java @@ -10,16 +10,13 @@ package org.openmrs.module.adminui; import org.apache.commons.beanutils.PropertyUtils; -import org.hamcrest.Matcher; -import org.junit.Assert; -import org.mockito.ArgumentMatcher; import org.openmrs.util.OpenmrsUtil; import java.util.Collection; -import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.fail; /** * Various utils to help with testing @@ -29,9 +26,10 @@ public class TestUtils { /** * To test things like: assertContainsElementWithProperty(listOfPatients, "patientId", 2) * - * @param collection - * @param property - * @param value + * @param collection the collection to search + * @param property the name of the bean property to evaluate + * @param value the expected value of the property + * @throws AssertionError if no matching element is found */ public static void assertContainsElementWithProperty(Collection collection, String property, Object value) { for (Object o : collection) { @@ -40,50 +38,30 @@ public static void assertContainsElementWithProperty(Collection collection, S return; } } catch (Exception ex) { - // pass + // Skip this element } } - Assert.fail("Collection does not contain an element with " + property + " = " + value + ". Collection: " - + collection); - } - - public static ArgumentMatcher isCollectionOfExactlyElementsWithProperties(final String property, - final Object... expectedPropertyValues) { - return new ArgumentMatcher() { - - @Override - public boolean matches(Object o) { - assertTrue(o instanceof Collection); - Collection actual = (Collection) o; - assertThat(actual.size(), is(expectedPropertyValues.length)); - for (Object expectedPropertyValue : expectedPropertyValues) { - assertContainsElementWithProperty(actual, property, expectedPropertyValue); - } - return true; - } - }; + fail("Collection does not contain an element with " + property + " = " + value + ". Collection: " + collection); } /** - * Creates an argument matcher that tests equality based on the equals method, the developer - * doesn't have to type cast the returned argument when pass it to - * {@link org.mockito.Mockito#argThat(org.hamcrest.Matcher)} as it would be the case if we used - * {@link org.mockito.internal.matchers.Equals} matcher + * Asserts that the given collection contains exactly the expected property values, with no extra or missing values. + * The assertion passes if the collection contains the same number of elements as the number of expected values, + * and each expected property value is found in at least one element of the collection. + * This does not consider order or duplicates; it treats both actual and expected values as sets. * - * @param object - * @return Matcher + * @param collection the collection to check + * @param property the bean property to evaluate for each element + * @param expectedPropertyValues the expected values of the property across the collection + * @throws AssertionError if the size does not match or any expected value is missing */ - @SuppressWarnings("unchecked") - public static Matcher equalsMatcher(final T object) { - return new ArgumentMatcher() { + public static void assertCollectionHasExactlyElementsWithProperty(Collection collection, String property, Object... expectedPropertyValues) { + assertNotNull(collection, "Collection is null"); + assertEquals(expectedPropertyValues.length, collection.size(), "Collection size does not match expected"); - /** - * @see org.mockito.ArgumentMatcher#matches(Object) - */ - @Override - public boolean matches(Object arg) { - return OpenmrsUtil.nullSafeEquals(object, (T) arg); - } - }; + for (Object expectedValue : expectedPropertyValues) { + assertContainsElementWithProperty(collection, property, expectedValue); + } } + } diff --git a/api/src/test/java/org/openmrs/module/adminui/account/AccountServiceComponentTest.java b/api/src/test/java/org/openmrs/module/adminui/account/AccountServiceComponentTest.java index 66a68d4e..fe66f9f3 100644 --- a/api/src/test/java/org/openmrs/module/adminui/account/AccountServiceComponentTest.java +++ b/api/src/test/java/org/openmrs/module/adminui/account/AccountServiceComponentTest.java @@ -9,30 +9,30 @@ */ package org.openmrs.module.adminui.account; -import static org.junit.Assert.assertNotNull; - -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.openmrs.Provider; import org.openmrs.User; +import org.openmrs.api.ProviderService; import org.openmrs.api.UserService; import org.openmrs.api.context.Context; -import org.openmrs.module.providermanagement.Provider; -import org.openmrs.module.providermanagement.api.ProviderManagementService; -import org.openmrs.test.BaseModuleContextSensitiveTest; +import org.openmrs.test.jupiter.BaseModuleContextSensitiveTest; + +import static org.junit.jupiter.api.Assertions.assertNotNull; -public class AccountServiceComponentTest extends BaseModuleContextSensitiveTest { +public class AccountServiceComponentTest extends BaseModuleContextSensitiveTest{ private AccountService accountService; private UserService userService; + + private ProviderService providerService; - private ProviderManagementService providerManagementService; - - @Before + @BeforeEach public void setup() { userService = Context.getUserService(); accountService = Context.getService(AccountService.class); - providerManagementService = Context.getService(ProviderManagementService.class); + providerService = Context.getProviderService(); } /** @@ -48,7 +48,7 @@ public void saveAccount_shouldSaveNewAccountWithAProviderAndUserAccount() throws user.addRole(userService.getRole("Application Role: Archives"));//capability Provider provider = new Provider(); - provider.setProviderRole(providerManagementService.getProviderRole(1001)); + provider.setProviderRole(providerService.getProviderRole(1001)); Account account = new Account(null); account.setFamilyName("some"); account.setGivenName("tester"); diff --git a/api/src/test/java/org/openmrs/module/adminui/account/AccountServiceTest.java b/api/src/test/java/org/openmrs/module/adminui/account/AccountServiceTest.java index c8e98b6c..0cb91de7 100644 --- a/api/src/test/java/org/openmrs/module/adminui/account/AccountServiceTest.java +++ b/api/src/test/java/org/openmrs/module/adminui/account/AccountServiceTest.java @@ -9,17 +9,17 @@ */ package org.openmrs.module.adminui.account; -import static org.junit.Assert.assertThat; +import org.junit.jupiter.api.Test; +import org.mockito.junit.jupiter.MockitoExtension; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.extension.ExtendWith; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import java.util.Arrays; import java.util.List; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; import org.openmrs.Person; import org.openmrs.Provider; import org.openmrs.Role; @@ -28,18 +28,10 @@ import org.openmrs.api.PersonService; import org.openmrs.api.ProviderService; import org.openmrs.api.UserService; -import org.openmrs.api.context.Context; import org.openmrs.module.adminui.AdminUiConstants; import org.openmrs.module.adminui.TestUtils; -import org.openmrs.module.providermanagement.api.ProviderManagementService; -import org.powermock.api.mockito.PowerMockito; -import org.powermock.core.classloader.annotations.PowerMockIgnore; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; -@RunWith(PowerMockRunner.class) -@PrepareForTest(Context.class) -@PowerMockIgnore("jdk.internal.reflect.*") +@ExtendWith(MockitoExtension.class) public class AccountServiceTest { private AccountServiceImpl accountService; @@ -50,26 +42,20 @@ public class AccountServiceTest { private ProviderService providerService; - private ProviderManagementService providerManagementService; - private AdministrationService adminService; - - @Before + + @BeforeEach public void setup() { - PowerMockito.mockStatic(Context.class); userService = mock(UserService.class); personService = mock(PersonService.class); providerService = mock(ProviderService.class); - providerManagementService = mock(ProviderManagementService.class); adminService = mock(AdministrationService.class); - + accountService = new AccountServiceImpl(); accountService.setUserService(userService); accountService.setPersonService(personService); accountService.setProviderService(providerService); accountService.setAdminService(adminService); - when(Context.getUserService()).thenReturn(userService); - when(Context.getProviderService()).thenReturn(providerService); } /** @@ -107,7 +93,7 @@ public void getAllAccounts_shouldGetAllUniqueAccounts() throws Exception { when(userService.getAllUsers()).thenReturn(Arrays.asList(user1, user2, user3, daemonUser)); when(providerService.getAllProviders()).thenReturn(Arrays.asList(provider1, provider2, unknownProvider)); - Assert.assertEquals(3, accountService.getAllAccounts().size()); + assertEquals(3, accountService.getAllAccounts().size()); } /** @@ -122,28 +108,29 @@ public void getAllCapabilities_shouldReturnAllRolesWithTheCapabilityPrefix() thr when(userService.getAllRoles()).thenReturn(Arrays.asList(role1, role2, role3)); List capabilities = accountService.getAllCapabilities(); - Assert.assertEquals(2, capabilities.size()); - assertThat(capabilities, TestUtils.isCollectionOfExactlyElementsWithProperties("role", - AdminUiConstants.ROLE_PREFIX_CAPABILITY + "role1", AdminUiConstants.ROLE_PREFIX_CAPABILITY + "role3")); + assertEquals(2, capabilities.size()); + TestUtils.assertCollectionHasExactlyElementsWithProperty( + capabilities, "role", AdminUiConstants.ROLE_PREFIX_CAPABILITY + "role1", + AdminUiConstants.ROLE_PREFIX_CAPABILITY + "role3" + ); } - + /** * @verifies return all roles with the privilege level prefix * @see AccountService#getAllPrivilegeLevels() */ @Test - public void getAllPrivilegeLevels_shouldReturnAllRolesWithThePrivilegeLevelPrefix() throws Exception { + public void getAllPrivilegeLevels_shouldReturnAllRolesWithThePrivilegeLevelPrefix() { Role role1 = new Role(AdminUiConstants.ROLE_PREFIX_PRIVILEGE_LEVEL + "role1"); Role role3 = new Role("role2"); Role role2 = new Role(AdminUiConstants.ROLE_PREFIX_PRIVILEGE_LEVEL + "role3"); - + when(userService.getAllRoles()).thenReturn(Arrays.asList(role1, role2, role3)); List privilegeLevels = accountService.getAllPrivilegeLevels(); - Assert.assertEquals(2, privilegeLevels.size()); - assertThat( - privilegeLevels, - TestUtils.isCollectionOfExactlyElementsWithProperties("role", AdminUiConstants.ROLE_PREFIX_PRIVILEGE_LEVEL - + "role1", AdminUiConstants.ROLE_PREFIX_PRIVILEGE_LEVEL + "role3")); + assertEquals(2, privilegeLevels.size()); + TestUtils.assertCollectionHasExactlyElementsWithProperty( + privilegeLevels, "role", AdminUiConstants.ROLE_PREFIX_PRIVILEGE_LEVEL + "role1", + AdminUiConstants.ROLE_PREFIX_PRIVILEGE_LEVEL + "role3" + ); } - } diff --git a/api/src/test/java/org/openmrs/module/adminui/account/AdminUiAccountValidatorTest.java b/api/src/test/java/org/openmrs/module/adminui/account/AdminUiAccountValidatorTest.java index d01e9194..be96f962 100644 --- a/api/src/test/java/org/openmrs/module/adminui/account/AdminUiAccountValidatorTest.java +++ b/api/src/test/java/org/openmrs/module/adminui/account/AdminUiAccountValidatorTest.java @@ -9,51 +9,53 @@ */ package org.openmrs.module.adminui.account; -import static org.powermock.api.mockito.PowerMockito.when; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; import org.mockito.Mockito; +import org.mockito.junit.jupiter.MockitoExtension; +import org.mockito.MockedStatic; import org.openmrs.api.AdministrationService; import org.openmrs.api.context.Context; -import org.powermock.api.mockito.PowerMockito; -import org.powermock.core.classloader.annotations.PowerMockIgnore; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; import org.springframework.validation.BindException; import org.springframework.validation.Errors; -@RunWith(PowerMockRunner.class) -@PrepareForTest(Context.class) -@PowerMockIgnore("jdk.internal.reflect.*") +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +@ExtendWith(MockitoExtension.class) public class AdminUiAccountValidatorTest { - - private AdminUiAccountValidator validator; - + + private Account account; + private Errors errors; + + @Mock private AdministrationService adminService; - - @Before - public void setValidator() { - PowerMockito.mockStatic(Context.class); - adminService = Mockito.mock(AdministrationService.class); - when(Context.getAdministrationService()).thenReturn(adminService); - + + private AdminUiAccountValidator validator; + + @BeforeEach + public void setUp() { + account = new Account(null); + errors = new BindException(account, "account"); validator = new AdminUiAccountValidator(); } - + /** * @see AdminUiAccountValidator#validate(Object,org.springframework.validation.Errors) * @verifies reject an account with no user or provider account */ @Test public void validate_shouldRejectAnAccountWithNoUserOrProviderAccount() throws Exception { - Account account = new Account(null); - Errors errors = new BindException(account, "account"); - validator.validate(account, errors); - Assert.assertTrue(errors.hasErrors()); - Assert.assertEquals(1, errors.getAllErrors().size()); - Assert.assertEquals("adminui.account.userOrProvider.required", errors.getAllErrors().get(0).getCode()); + try (MockedStatic mockedContext = Mockito.mockStatic(Context.class)) { + mockedContext.when(Context::getAdministrationService).thenReturn(adminService); + + validator.validate(account, errors); + + assertTrue(errors.hasErrors()); + assertEquals(1, errors.getAllErrors().size()); + assertEquals("adminui.account.userOrProvider.required", errors.getAllErrors().get(0).getCode()); + } } } diff --git a/api/src/test/resources/TestingApplicationContext.xml b/api/src/test/resources/TestingApplicationContext.xml index 1acfa5ec..67d32a13 100644 --- a/api/src/test/resources/TestingApplicationContext.xml +++ b/api/src/test/resources/TestingApplicationContext.xml @@ -21,12 +21,16 @@ classpath:hibernate.cfg.xml - classpath:test-hibernate.cfg.xml + + + org.openmrs + + \ No newline at end of file diff --git a/api/src/test/resources/accountComponentTestDataset.xml b/api/src/test/resources/accountComponentTestDataset.xml index f8a95663..0af49352 100644 --- a/api/src/test/resources/accountComponentTestDataset.xml +++ b/api/src/test/resources/accountComponentTestDataset.xml @@ -19,10 +19,10 @@ - - diff --git a/api/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker b/api/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker new file mode 100644 index 00000000..1f0955d4 --- /dev/null +++ b/api/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker @@ -0,0 +1 @@ +mock-maker-inline diff --git a/api/src/test/resources/test-hibernate.cfg.xml b/api/src/test/resources/test-hibernate.cfg.xml deleted file mode 100644 index c646bc77..00000000 --- a/api/src/test/resources/test-hibernate.cfg.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - diff --git a/omod/pom.xml b/omod/pom.xml index db5265a6..6ae9b55e 100644 --- a/omod/pom.xml +++ b/omod/pom.xml @@ -106,11 +106,6 @@ uiframework-api - - org.openmrs.module - providermanagement-api - - org.openmrs.module uicommons-omod diff --git a/omod/src/main/java/org/openmrs/module/adminui/fragment/controller/systemadmin/accounts/ProviderTabContentPaneFragmentController.java b/omod/src/main/java/org/openmrs/module/adminui/fragment/controller/systemadmin/accounts/ProviderTabContentPaneFragmentController.java index 01b96558..d326e05d 100644 --- a/omod/src/main/java/org/openmrs/module/adminui/fragment/controller/systemadmin/accounts/ProviderTabContentPaneFragmentController.java +++ b/omod/src/main/java/org/openmrs/module/adminui/fragment/controller/systemadmin/accounts/ProviderTabContentPaneFragmentController.java @@ -12,10 +12,9 @@ import javax.servlet.http.HttpServletRequest; import org.openmrs.OpenmrsObject; +import org.openmrs.Provider; import org.openmrs.api.PersonService; import org.openmrs.api.ProviderService; -import org.openmrs.module.providermanagement.Provider; -import org.openmrs.module.providermanagement.api.ProviderManagementService; import org.openmrs.ui.framework.UiUtils; import org.openmrs.ui.framework.annotation.BindParams; import org.openmrs.ui.framework.annotation.SpringBean; @@ -39,7 +38,6 @@ public FragmentActionResult process(@RequestParam(value = "uuid", required = fal @RequestParam(value = "reason", required = false) String reason, @SpringBean("personService") PersonService personService, @SpringBean("providerService") ProviderService providerService, - @SpringBean("providerManagementService") ProviderManagementService providerManagementService, HttpServletRequest request, UiUtils ui) { try { diff --git a/omod/src/main/java/org/openmrs/module/adminui/page/controller/systemadmin/accounts/AccountPageController.java b/omod/src/main/java/org/openmrs/module/adminui/page/controller/systemadmin/accounts/AccountPageController.java index 831c5324..3c01e211 100644 --- a/omod/src/main/java/org/openmrs/module/adminui/page/controller/systemadmin/accounts/AccountPageController.java +++ b/omod/src/main/java/org/openmrs/module/adminui/page/controller/systemadmin/accounts/AccountPageController.java @@ -24,10 +24,13 @@ import org.openmrs.OpenmrsObject; import org.openmrs.Person; import org.openmrs.PersonName; +import org.openmrs.Provider; +import org.openmrs.ProviderRole; import org.openmrs.Role; import org.openmrs.User; import org.openmrs.api.APIException; import org.openmrs.api.AdministrationService; +import org.openmrs.api.ProviderService; import org.openmrs.api.UserService; import org.openmrs.api.context.Context; import org.openmrs.messagesource.MessageSourceService; @@ -37,9 +40,6 @@ import org.openmrs.module.adminui.account.AdminUiAccountValidator; import org.openmrs.module.appframework.domain.Extension; import org.openmrs.module.appframework.service.AppFrameworkService; -import org.openmrs.module.providermanagement.Provider; -import org.openmrs.module.providermanagement.ProviderRole; -import org.openmrs.module.providermanagement.api.ProviderManagementService; import org.openmrs.module.uicommons.UiCommonsConstants; import org.openmrs.module.uicommons.util.InfoErrorMessageUtil; import org.openmrs.ui.framework.SimpleObject; @@ -83,17 +83,17 @@ public Account getAccount(@RequestParam(value = "personId", required = false) Pe * @param model * @param account * @param accountService - * @param providerManagementService + * @param providerService */ public void get(PageModel model, @MethodParam("getAccount") Account account, @SpringBean("adminAccountService") AccountService accountService, @SpringBean("adminService") AdministrationService administrationService, - @SpringBean("providerManagementService") ProviderManagementService providerManagementService, + @SpringBean("providerService") ProviderService providerService, UiUtils uu, @SpringBean("appFrameworkService") AppFrameworkService appFrameworkService) throws IOException { - setModelAttributes(model, account, null, accountService, administrationService, providerManagementService, uu, appFrameworkService); + setModelAttributes(model, account, null, accountService, administrationService, providerService, uu, appFrameworkService); if (account.getPerson().getPersonId() == null) { setJsonFormData(model, account, null, uu); } @@ -104,7 +104,7 @@ public void get(PageModel model, @MethodParam("getAccount") Account account, * @param messageSourceService * @param accountService * @param administrationService - * @param providerManagementService + * @param providerService * @param accountValidator * @param model * @param request @@ -116,7 +116,7 @@ public String post(PageModel model, @MethodParam("getAccount") @BindParams Accou @SpringBean("adminAccountService") AccountService accountService, @SpringBean("adminService") AdministrationService administrationService, @SpringBean("adminUiAccountValidator") AdminUiAccountValidator accountValidator, - @SpringBean("providerManagementService") ProviderManagementService providerManagementService, + @SpringBean("providerService") ProviderService providerService, @SpringBean("appFrameworkService") AppFrameworkService appFrameworkService, HttpServletRequest request, UiUtils uu) throws IOException { @@ -188,7 +188,7 @@ public String post(PageModel model, @MethodParam("getAccount") @BindParams Accou if (otherAccountData.getAddProviderAccount()) { Provider provider = new Provider(); provider.setIdentifier(request.getParameter("identifier")); - provider.setProviderRole(providerManagementService.getProviderRoleByUuid(request.getParameter("providerRole"))); + provider.setProviderRole(providerService.getProviderRoleByUuid(request.getParameter("providerRole"))); account.addProviderAccount(provider); } @@ -217,7 +217,7 @@ public String post(PageModel model, @MethodParam("getAccount") @BindParams Accou } setModelAttributes(model, account, otherAccountData, accountService, administrationService, - providerManagementService, uu, appFrameworkService); + providerService, uu, appFrameworkService); sendErrorMessage(errors, model, messageSourceService, request); @@ -231,7 +231,7 @@ public String post(PageModel model, @MethodParam("getAccount") @BindParams Accou public void setModelAttributes(PageModel model, Account account, OtherAccountData otherAccountData, AccountService accountService, AdministrationService administrationService, - ProviderManagementService providerManagementService, UiUtils uu, + ProviderService providerService, UiUtils uu, AppFrameworkService appFrameworkService) throws IOException { model.addAttribute("account", account); @@ -259,7 +259,7 @@ public void setModelAttributes(PageModel model, Account account, OtherAccountDat model.addAttribute("privilegeLevelPrefix", privilegeLevelPrefix); model.addAttribute("rolePrefix", rolePrefix); model.addAttribute("allowedLocales", administrationService.getAllowedLocales()); - List providerRoles = providerManagementService.getAllProviderRoles(false); + List providerRoles = providerService.getAllProviderRoles(false); model.addAttribute("providerRoles", providerRoles); List customPersonAttributeEditFragments = diff --git a/omod/src/main/resources/config.xml b/omod/src/main/resources/config.xml index 4a9a9f29..c17763a2 100644 --- a/omod/src/main/resources/config.xml +++ b/omod/src/main/resources/config.xml @@ -32,7 +32,6 @@ org.openmrs.module.appframework org.openmrs.module.uicommons org.openmrs.module.appui - org.openmrs.module.providermanagement org.openmrs.module.webservices.rest diff --git a/pom.xml b/pom.xml index 233a8b1c..661eba86 100644 --- a/pom.xml +++ b/pom.xml @@ -49,15 +49,14 @@ - 2.0.0 + 2.8.0-SNAPSHOT UTF-8 - 2.1 - 1.7 - 3.9 - 2.9 - 2.5.0 - 2.16 - 1.16.0 + 2.27.0-SNAPSHOT + 1.19.0-SNAPSHOT + 4.0.1-SNAPSHOT + 2.19.0-SNAPSHOT + 2.50.0-SNAPSHOT + 1.23.0 @@ -103,10 +102,18 @@ ${openMRSVersion} pom test + + + org.powermock + powermock-module-junit4 + + + org.powermock + powermock-api-mockito2 + + - - - + @@ -125,14 +132,6 @@ ${appframeworkVersion} - - org.openmrs.module - providermanagement-api - ${providermanagementVersion} - jar - provided - - org.openmrs.module legacyui-omod @@ -161,8 +160,8 @@ org.apache.maven.plugins maven-compiler-plugin - 1.7 - 1.7 + 1.8 + 1.8 @@ -275,20 +274,6 @@ graphic logo is a trademark of OpenMRS Inc. test - - org.powermock - powermock-core - 1.6.1 - test - - - - org.powermock - powermock-module-junit4 - 1.6.1 - test - - com.thoughtworks.xstream xstream From 412c6c5699bae0cf105d738dc2d867d38a3dd336 Mon Sep 17 00:00:00 2001 From: mherman22 Date: Tue, 19 Aug 2025 23:00:49 +0300 Subject: [PATCH 2/5] use 2.8.1-SNAPSHOT --- omod/pom.xml | 10 ++++++++-- .../systemadmin/accounts/AccountPageController.java | 2 +- pom.xml | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/omod/pom.xml b/omod/pom.xml index 6ae9b55e..a3f5cdc3 100644 --- a/omod/pom.xml +++ b/omod/pom.xml @@ -146,8 +146,14 @@ gem provided - - + + javax.servlet + javax.servlet-api + 4.0.1 + compile + + + ${project.parent.artifactId}-${project.parent.version} diff --git a/omod/src/main/java/org/openmrs/module/adminui/page/controller/systemadmin/accounts/AccountPageController.java b/omod/src/main/java/org/openmrs/module/adminui/page/controller/systemadmin/accounts/AccountPageController.java index 3c01e211..4924dba6 100644 --- a/omod/src/main/java/org/openmrs/module/adminui/page/controller/systemadmin/accounts/AccountPageController.java +++ b/omod/src/main/java/org/openmrs/module/adminui/page/controller/systemadmin/accounts/AccountPageController.java @@ -280,7 +280,7 @@ public void setModelAttributes(PageModel model, Account account, OtherAccountDat Collections.sort(customUserPropertyViewFragments); model.addAttribute("customUserPropertyViewFragments", customUserPropertyViewFragments); - Map propertyMaxLengthMap = new HashMap(); + Map propertyMaxLengthMap = new HashMap<>(); propertyMaxLengthMap.put("familyName", administrationService.getMaximumPropertyLength(PersonName.class, "family_name")); propertyMaxLengthMap diff --git a/pom.xml b/pom.xml index 661eba86..6f28ad2f 100644 --- a/pom.xml +++ b/pom.xml @@ -49,7 +49,7 @@ - 2.8.0-SNAPSHOT + 2.8.1-SNAPSHOT UTF-8 2.27.0-SNAPSHOT 1.19.0-SNAPSHOT From 4242571a19212af361967524ba929b7c5b8c67a0 Mon Sep 17 00:00:00 2001 From: mherman22 Date: Wed, 20 Aug 2025 15:05:40 +0300 Subject: [PATCH 3/5] fix javax/servlet dependency --- api/pom.xml | 7 +++---- omod/pom.xml | 12 ++++++------ pom.xml | 14 +++++++++++++- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/api/pom.xml b/api/pom.xml index 2055469f..ac898c31 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -32,6 +32,7 @@ org.openmrs.api openmrs-api + jar provided @@ -74,13 +75,11 @@ org.openmrs.module legacyui-omod - - + javax.servlet javax.servlet-api - 3.1.0 - test + provided diff --git a/omod/pom.xml b/omod/pom.xml index a3f5cdc3..3571909b 100644 --- a/omod/pom.xml +++ b/omod/pom.xml @@ -128,6 +128,12 @@ ${appuiVersion} provided + + + javax.servlet + javax.servlet-api + provided + @@ -146,12 +152,6 @@ gem provided - - javax.servlet - javax.servlet-api - 4.0.1 - compile - diff --git a/pom.xml b/pom.xml index 6f28ad2f..73f969d3 100644 --- a/pom.xml +++ b/pom.xml @@ -57,6 +57,7 @@ 2.19.0-SNAPSHOT 2.50.0-SNAPSHOT 1.23.0 + 4.0.1 @@ -78,6 +79,12 @@ ${openMRSVersion} jar provided + + + javax.servlet + servlet-api + + @@ -148,7 +155,12 @@ provided - + + javax.servlet + javax.servlet-api + ${javaxServletApiVersion} + provided + From 53740df6521add0b5930cc4b8d1b51afd0b94cbb Mon Sep 17 00:00:00 2001 From: mherman22 Date: Sat, 30 Aug 2025 18:35:53 +0300 Subject: [PATCH 4/5] Bump project version to 2.0.0-SNAPSHOT and legacy version to 2.0.0-SNAPSHOT --- api/pom.xml | 2 +- omod/pom.xml | 2 +- pom.xml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/pom.xml b/api/pom.xml index ac898c31..ab9319e7 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -18,7 +18,7 @@ org.openmrs.module adminui - 1.7.0-SNAPSHOT + 2.0.0-SNAPSHOT adminui-api diff --git a/omod/pom.xml b/omod/pom.xml index 3571909b..29f89345 100644 --- a/omod/pom.xml +++ b/omod/pom.xml @@ -18,7 +18,7 @@ org.openmrs.module adminui - 1.7.0-SNAPSHOT + 2.0.0-SNAPSHOT adminui-omod diff --git a/pom.xml b/pom.xml index 73f969d3..940b9a14 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ org.openmrs.module adminui - 1.7.0-SNAPSHOT + 2.0.0-SNAPSHOT pom Admin UI Module Administration Tools for the Reference Application @@ -56,7 +56,7 @@ 4.0.1-SNAPSHOT 2.19.0-SNAPSHOT 2.50.0-SNAPSHOT - 1.23.0 + 2.0.0-SNAPSHOT 4.0.1 From bf7eee79da675ad585fe03ae19f01e89fed23045 Mon Sep 17 00:00:00 2001 From: mherman22 Date: Mon, 1 Sep 2025 09:35:04 +0300 Subject: [PATCH 5/5] Make mock-maker-inline available by dependency --- api/pom.xml | 6 ++++++ .../mockito-extensions/org.mockito.plugins.MockMaker | 1 - pom.xml | 8 ++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) delete mode 100644 api/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker diff --git a/api/pom.xml b/api/pom.xml index ab9319e7..ae533421 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -81,6 +81,12 @@ javax.servlet-api provided + + + org.mockito + mockito-inline + test + diff --git a/api/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker b/api/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker deleted file mode 100644 index 1f0955d4..00000000 --- a/api/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker +++ /dev/null @@ -1 +0,0 @@ -mock-maker-inline diff --git a/pom.xml b/pom.xml index 940b9a14..35a500f0 100644 --- a/pom.xml +++ b/pom.xml @@ -58,6 +58,7 @@ 2.50.0-SNAPSHOT 2.0.0-SNAPSHOT 4.0.1 + 4.8.0 @@ -162,6 +163,13 @@ provided + + org.mockito + mockito-inline + ${mockitoInlineVersion} + test + +