void () { myFixture.copyFileToProject("injected/MyController.java"); myFixture.copyFileToProject("injected/FooVBox.java"); final RegistryValue registryValue = Registry.get("javafx.fxml.controller.from.loader"); final boolean injectionAllowed = registryValue.asBoolean(); try { registryValue.setValue(true); doTestNavigation("injected.MyController", "label", "injected/" + getTestName(true) + ".fxml"); } finally { registryValue.setValue(injectionAllowed); } }