Rename public onResourceRequested method to setOnResourceRequested and mimic behavior of other methods.
Add unit test for setOnResourceRequested.