// then: set the priority of the task to 10
taskService.setPriority(task.getId(), 10);
// expect: one entry for the priority update
UserOperationLogQuery query = queryOperationDetails(OPERATION_TYPE_SET_PRIORITY);
assertEquals(1, query.count());
// assert: correct priority set
UserOperationLogEntry userOperationLogEntry = query.singleResult();
assertEquals(PRIORITY, userOperationLogEntry.getProperty());
// note: 50 is the default task priority
assertEquals(50, Integer.parseInt(userOperationLogEntry.getOrgValue()));
assertEquals(10, Integer.parseInt(userOperationLogEntry.getNewValue()));
// then: set priority again
taskService.setPriority(task.getId(), 75);
// expect: one entry for the priority update
query = queryOperationDetails(OPERATION_TYPE_SET_PRIORITY);
assertEquals(2, query.count());
// assert: correct priority set
userOperationLogEntry = query.orderByTimestamp().asc().list().get(1);
assertEquals(PRIORITY, userOperationLogEntry.getProperty());
assertEquals(10, Integer.parseInt(userOperationLogEntry.getOrgValue()));
assertEquals(75, Integer.parseInt(userOperationLogEntry.getNewValue()));
}