Refactor resource scanner spec into a JUnit test