Reputation: 33
I have figured out how to create methods and add to the bodies of the method. What I need to also do is add annotations to the generated method such as @Test
etc, how would I accomplish this?
Upvotes: 2
Views: 58
Reputation: 11868
if you want to infer annotatations inside the inferrer you could do something like
members += greeting.toMethod("testHello" + greeting.name, typeRef(Void.TYPE)) [
annotations += "org.junit.Test".annotationRef()
body = '''
// TODO
'''
]
Upvotes: 2