Reschedule unsuccessful requests instead of sleeping

Prior to this change the retry logic was implemented at the http client
level and it would simply sleep and retry in a loop. This was suboptimal
as it keeps a thread allocated all the time.

When a web hook can not be executed, reschedule the task to be executed
again after the configured retry interval. This is the same approach
as we have in the replication plugin.

This change also adds dependency to the mockito and provides tests
for the retry logic.

Change-Id: I53486cb8752990991763acf9dd83d075b2aa7273
5 files changed
tree: 34cc7c12ec15426f764dda1b9524f6ffce5be06f
  1. lib/
  2. src/
  3. .buckconfig
  4. .gitignore
  5. BUCK