Skip to content

Commit

Permalink
add unit test
Browse files Browse the repository at this point in the history
Signed-off-by: jorgee <[email protected]>
  • Loading branch information
jorgee committed Dec 13, 2024
1 parent 2e14391 commit 85c9677
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,4 +263,18 @@ class TaskHandlerTest extends Specification {
[:] | "job_1"
[TOWER_WORKFLOW_ID: '1234'] | "tw-1234-job_1"
}

def 'should not kill task twice'() {
given:
def handler = Spy(TaskHandler)
when:
handler.kill()
then:
1 * handler.killTask() >> {}

when:
handler.kill()
then:
0 * handler.killTask()
}
}

0 comments on commit 85c9677

Please sign in to comment.