During the refactoring for
NIFI-950, the validation of of referenced Controller Services moved from AbstractConfigurableComponent to AbstractComponentNode. While this works fine for NiFi's lifecycle, it does cause problems with the Mock Framework. Because the Mock Framework does not create an AbstractComponentNode, only the AbstractConfigurableComponent, and validates that component directly, referenced Controller Services are not validated. Additionally, they are not (and never have been) validated when enabled.
We should update the Mock Framework such that when TestRunner.enableControllerService(ControllerService) is called, we first validate the Controller Service before enabling it.
Additionally, in the AbstractConfigurableComponent, or in the Mock Framework itself, verify that all referenced services are in fact enabled when validating the component.