A static call to GeoServerExtensions.bean like this is hard to apply unit tests too.  Maybe make it injectable or isolate it in a protected getResourceLoader method that can be overridden?