Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

You can make the getter of the rule public like so:

@get: Rule var rule = PowerMockRule() 

Or you can mark it as a Java style field with the @JvmField annotation:

@JvmField @Rule var rule = PowerMockRule() 

You can find more details in this answer: http://stackoverflow.com/a/32827600/4465208https://stackoverflow.com/a/32827600/4465208

Ps. You should also consider making it a val if you don't intend on changing its value anywhere.

You can make the getter of the rule public like so:

@get: Rule var rule = PowerMockRule() 

Or you can mark it as a Java style field with the @JvmField annotation:

@JvmField @Rule var rule = PowerMockRule() 

You can find more details in this answer: http://stackoverflow.com/a/32827600/4465208

Ps. You should also consider making it a val if you don't intend on changing its value anywhere.

You can make the getter of the rule public like so:

@get: Rule var rule = PowerMockRule() 

Or you can mark it as a Java style field with the @JvmField annotation:

@JvmField @Rule var rule = PowerMockRule() 

You can find more details in this answer: https://stackoverflow.com/a/32827600/4465208

Ps. You should also consider making it a val if you don't intend on changing its value anywhere.

Source Link
zsmb13
  • 90k
  • 11
  • 236
  • 239

You can make the getter of the rule public like so:

@get: Rule var rule = PowerMockRule() 

Or you can mark it as a Java style field with the @JvmField annotation:

@JvmField @Rule var rule = PowerMockRule() 

You can find more details in this answer: http://stackoverflow.com/a/32827600/4465208

Ps. You should also consider making it a val if you don't intend on changing its value anywhere.