[Coldbox 5.6.2] - BaseService testing with Populator

I am implementing fluentAPI v6 base components models posted by Luis on GitHub. I would like to test the following method from the BaseService.cfc component:

/**

  • Return a new Entity, empty or pre-populated with passed in data

I think I got the answer to this issue. I realised that the base service methods can in fact simply be tested within any of their child services. When I build a test for the child service, the parent class is initiated (init) and all the dependency injections listed in the parent class (BaseService) become available. Hence, when I run: mySVC.new() in the child service test, POPULATOR is automatically loaded. In a nutshell:

1 - BaseService includes a dependency injection of “wirebox:populator” for the property “Populator”,
2 - myService extends BaseService
3 - finally, I included mySVC = getInstance(“myService”); in the test suite header as shown below.

Bottom line, there is probably no reason to test a parent class on its own…