Search in sources :

Example 1 with AbstractTask

use of org.openmrs.scheduler.tasks.AbstractTask in project openmrs-core by openmrs.

the class AuditableInterceptorTest method onFlushDirty_shouldNotFailWhenTheDaemonUserModifiesSomething.

/**
 * @see AuditableInterceptor#onFlushDirty(Object,Serializable,null,null,null,null)
 */
@Test
public void onFlushDirty_shouldNotFailWhenTheDaemonUserModifiesSomething() throws Throwable {
    new AsDaemonTask(new AbstractTask() {

        @Override
        public void execute() {
            ConceptNumeric weight = Context.getConceptService().getConceptNumeric(5089);
            Date dateChangedBefore = weight.getDateChanged();
            weight.setHiAbsolute(75d);
            Context.getConceptService().saveConcept(weight);
            Assert.assertNotSame(dateChangedBefore, weight.getDateChanged());
        }
    }).runTheTask();
}
Also used : AbstractTask(org.openmrs.scheduler.tasks.AbstractTask) ConceptNumeric(org.openmrs.ConceptNumeric) Date(java.util.Date) Test(org.junit.Test) BaseContextSensitiveTest(org.openmrs.test.BaseContextSensitiveTest)

Aggregations

Date (java.util.Date)1 Test (org.junit.Test)1 ConceptNumeric (org.openmrs.ConceptNumeric)1 AbstractTask (org.openmrs.scheduler.tasks.AbstractTask)1 BaseContextSensitiveTest (org.openmrs.test.BaseContextSensitiveTest)1