I would like to be able to use JUnit rules such as TemporaryFolder or other TestRules we have already developed in-house.
What is the best method
You could solve the problem by creating a member field of type TemporaryFolder and returning this field value by the @Rule function.
class MyTest extends JUnitSuite {
val _temporaryFolder = new TemporaryFolder
@Rule
def temporaryFolder = _temporaryFolder
@Test
def test: Unit = {
assert(temporaryFolder.newFile() !== null)
}
}