Testing retry policy defined in "task-defaults" for reverse workflow

* Added a unit test
* Minor refactoring in retry policy

Closes-Bug: #1401391

Change-Id: Id92302c196539e80522768e956dc1ebd7de18456
Merge "Testing retry policy defined in "task-defaults" for reverse workflow"