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

openmrs / openmrs-core / 10268010242

06 Aug 2024 02:01PM CUT coverage: 64.952% (+0.04%) from 64.912%
10268010242

push

github

web-flow
TRUNK-6188 Upgrade xstream and migrate to whitelisting (#4377)

54 of 58 new or added lines in 2 files covered. (93.1%)

5 existing lines in 3 files now uncovered.

22960 of 35349 relevant lines covered (64.95%)

0.65 hits per line

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

0.0
/api/src/main/java/org/openmrs/api/db/hibernate/envers/OpenmrsRevisionEntityListener.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

11
package org.openmrs.api.db.hibernate.envers;
12

13
import org.hibernate.envers.RevisionListener;
14
import org.openmrs.api.context.Context;
15
import org.openmrs.api.context.Daemon;
16

17
import java.util.Date;
18

19
public class OpenmrsRevisionEntityListener implements RevisionListener {
×
20
        @Override
21
        public void newRevision(Object o) {
22
                OpenmrsRevisionEntity customRevisionEntity = (OpenmrsRevisionEntity) o;
×
23
                if(Context.getUserContext().isAuthenticated()) {
×
24
                        customRevisionEntity.setChangedBy(Context.getUserContext().getAuthenticatedUser().getUserId());
×
25
                }
26
                else if(Daemon.getDaemonThreadUser() != null) {
×
27
                        customRevisionEntity.setChangedBy(Daemon.getDaemonThreadUser().getUserId());
×
28
                }
29
                customRevisionEntity.setChangedOn(new Date());
×
30
        }
×
31
}
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

© 2025 Coveralls, Inc