This assertion will fail if there is more than one public key on the repo you are testing on, I don't think that's a safe assumption. Better to use Matchers.hasItem() here I think.