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

openmrs / openmrs-core / 29365517473

14 Jul 2026 08:23PM UTC coverage: 63.813% (+0.04%) from 63.775%
29365517473

push

github

web-flow
TRUNK-6675: Module is not updated when omod changes (#6257)

* TRUNK-6675: Module is not updated when omod changes

* TRUNK-6675: Address review comments

- Split the deleteDirectory try-catch in the optimized-startup branch so IOException from deletion logs an accurate message instead of "Error while reading module last modified file"
- Pin getLibCacheFolderForModule_shouldRecreateNonEmptyDirWhenModuleChanged to the module-changed branch by explicitly setting optimized.startup=true

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* TRUNK-6675: Address review comments

- Extract deleteLibCacheDir helper to reduce cognitive complexity (fixes SonarCloud quality gate)
- Guard .moduleLastModified write on successful deletion so a failed delete does not mask the problem on the next restart
- Fix Context.getRuntimeProperties() defensive-copy bug in both tests: mutate the copy and push it back via Context.setRuntimeProperties() so isOptimizedStartup() actually sees the change

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Update api/src/main/java/org/openmrs/module/ModuleClassLoader.java

Co-authored-by: dkayiwa <dkayiwa@openmrs.org>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: dkayiwa <dkayiwa@openmrs.org>

7 of 11 new or added lines in 1 file covered. (63.64%)

21 existing lines in 8 files now uncovered.

24094 of 37757 relevant lines covered (63.81%)

0.64 hits per line

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

77.78
/api/src/main/java/org/openmrs/scheduler/jobrunr/JobRequestAdapter.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.scheduler.jobrunr;
11

12
import org.jobrunr.jobs.lambdas.JobRequestHandler;
13
import org.openmrs.scheduler.TaskData;
14

15
/**
16
 * Adapts a {@link TaskData} to a JobRunr {@link org.jobrunr.jobs.lambdas.JobRequest}.
17
 * 
18
 * @since 2.9.0
19
 */
20
public class JobRequestAdapter implements org.jobrunr.jobs.lambdas.JobRequest {
21

22
        private TaskData taskRequest;
23
        
24
        private String userSystemId;
25

26
        // No-arg constructor required for serialization
27
        public JobRequestAdapter() {
1✔
28
        } 
1✔
29

30
        public JobRequestAdapter(TaskData taskRequest, String userSystemId) {
1✔
31
                this.taskRequest = taskRequest;
1✔
32
                this.userSystemId = userSystemId;
1✔
33
        }
1✔
34

35
        @Override
36
        public Class<? extends JobRequestHandler> getJobRequestHandler() {
37
                return JobRequestHandlerAdapter.class;
1✔
38
        }
39

40
        public TaskData getJobRequest() {
UNCOV
41
                return taskRequest;
×
42
        }
43
        
44
        public String getUserSystemId() {
UNCOV
45
                return userSystemId;
×
46
        }
47
}
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