public class Partial
extends java.lang.Object
Concrete partial types can be created by generating
UnsupportedOperationException-throwing implementations for all methods that should not
be called in the test. This has some issues:
This last issue is especially problematic for testing annotation processors, as the
javax.lang.model interfaces change between Java versions. Instead, we create an abstract
class containing only the methods with real behaviour, and create a concrete partial subclass
of this dynamically at runtime. This requires javassist, as Proxy can
only subclass interfaces.
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
of(java.lang.Class<T> cls,
java.lang.Object... args)
Constructs a partial instance of abstract type
cls, passing args into its
constructor. |