Currently classes are loaded with Class.forName, that uses the classloader from the calling class. However, this might not work on all environments because of different class loading setup (e.g in Quarkus testing). This change uses the current thread context class loader as fallback when Class.forName is not able to load a class.
Fix can be tested by running a UI Unit test on a Quarkus based application.
Running MainViewTest should fail with a ClassNotFoundException, whereas it should pass when using the patched Testbench artifacts.
Description
Currently classes are loaded with Class.forName, that uses the classloader from the calling class. However, this might not work on all environments because of different class loading setup (e.g in Quarkus testing). This change uses the current thread context class loader as fallback when Class.forName is not able to load a class.
Fixes vaadin/quarkus#139 Part of #1655
Type of change
Checklist
Additional for
Feature
type of change