Replace deprecated junit matcher by hamcrest.
Collect all job histories in else path, restore logic as it was before 30a770e49c080b3ba3788fa193880e29e4588fab.