Refactor OSGi tests