I have an object and I need to pass its class to an annotation that takes java.lang.Class, eg:
public @interface PrepareForTest {
Class<?>[] value()
}
object MyObject
@PrepareForTest(Array(?????))
class MySpec ...
I've tried:
@PrepareForTest(Array(classOf[MyObject]))
// error: not found: type MyObject
@PrepareForTest(Array(MyObject))
// error: type mismatch
// found: MyObject.type (with underlying type object MyObject
// required: java.lang.Class[_]
@PrepareForTest(Array(classOf[MyObject.type]))
// error: class type required by MyObject.type found
Not sure what else to try.