Thread-topic: Refactor org.eclipse.swordfish.internal.core.util.smx.ServiceMixSupport class to improve testability
Title: Refactor org.eclipse.swordfish.internal.core.util.smx.ServiceMixSupport class to improve testabilityHi all,
I have stumbled several times over it now and it’s a pain in the neck to have to satisfy the requirements of the ServiceMixSupport class when testing with mock objects ... apart from the fact that it has a bad smell, consisting of static methods only.
Being able to mock the functions of ServiceMixSupport will significantly simplify tests of existing code that depends on this class, because we can cut of levels of mocks required by the static implementation.
As there are quite a few references to ServiceMixSupport, I propose that we create an internal OSGi (singleton) service that offers the functionality that is currently offered by this class and (for now) redirect from this service to the old implementation. As soon as all references to the old implementation are gone, we can move all the logic to the service class and remove the old one.