Feature summary
I would like to be able to perform assertions on classes that I load dynamically from a given classloader. This would enable me to test code that deals with custom classloaders using assertj without needing to implement my own custom boilerplate to do this.
This would have multiple cases where this could be useful, as many project such as Spring use their own special class loading strategies for certain use cases. This would also assist in testing code that is loaded using OSGi. In my specific use case it would enable testing the loading of code being passed through javac!
Example
// Given
var mySpecialClassLoader = new MySpecialClassLoader(...);
// Then
assertThat(mySpecialClassLoader)
.hasClass("org.example.MyClass1")
.hasResource("...")
.class("org.example.MyClass2")
... // returns a ClassAssert
Feature summary
I would like to be able to perform assertions on classes that I load dynamically from a given classloader. This would enable me to test code that deals with custom classloaders using assertj without needing to implement my own custom boilerplate to do this.
This would have multiple cases where this could be useful, as many project such as Spring use their own special class loading strategies for certain use cases. This would also assist in testing code that is loaded using OSGi. In my specific use case it would enable testing the loading of code being passed through javac!
Example