-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DMP-4216: Allow inactive tasks to be run manually #2238
Changes from 2 commits
c1746df
5c1022f
f829e60
d2bfbb0
9d82640
b71235e
4f6bdda
0df7f3a
fe66f6e
5435b5d
cb19b6b
35e2cdc
8f67174
873599f
6974ec7
97c6e1b
6f9645f
bca06dd
743d827
8784591
e2358c9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,8 +71,8 @@ void invokesTaskWhenTaskIsNotLocked() { | |
|
||
adminAutomatedTaskService.runAutomatedTask(1); | ||
|
||
verify(automatedTaskRunner, times(1)).run(someAutomatedTask); | ||
verify(auditApi, times(1)).record(AuditActivity.RUN_JOB_MANUALLY,"some-task-name"); | ||
verify(automatedTaskRunner, times(1)).run(someAutomatedTask, true); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You have set isManual to true but is there a test where its set to false There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the is manual run false should be covered by the existing tests for automated tasks. As when it is not manually run we default this value to be false |
||
verify(auditApi, times(1)).record(AuditActivity.RUN_JOB_MANUALLY, "some-task-name"); | ||
} | ||
|
||
@Test | ||
|
@@ -95,7 +95,7 @@ void updateAutomatedTask() { | |
assertFalse(automatedTaskEntity.getTaskEnabled()); | ||
assertEquals(100, automatedTaskEntity.getBatchSize()); | ||
assertEquals(expectedReturnTask, task); | ||
verify(auditApi).record(AuditActivity.ENABLE_DISABLE_JOB,"some-task-name disabled"); | ||
verify(auditApi).record(AuditActivity.ENABLE_DISABLE_JOB, "some-task-name disabled"); | ||
verifyNoMoreInteractions(auditApi); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is making my head hurt. Why are we passing this
isManualRun
in as a parameter? Can't we just use theisManualTask
variable that is already used in this class? Or just get rid of theisManualTask
class variable and use your new parameter.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have removed the ManualTaskService as this no longer provided any value and updated the code to reflect this change