kotest-extensions / io.kotest.extensions.system / SecurityManagerTestListener

SecurityManagerTestListener

class SecurityManagerTestListener : SecurityManagerListener, TestListener

Overrides System Security Manager with specified securityManager

This is a Listener for code that uses the System Security Manager. It replaces the System Security Manager with the desired securityManager.

After the execution of the test, the System Security Manager is set to what it was before. This will also happen if the original manager is null.

Attention: This code is subject to race conditions. As Java's System Manager is only one per JVM, this code will replace it. However, all other tests are going to use it if tests are running in parallel.

Constructors

<init>

Overrides System Security Manager with specified securityManager

SecurityManagerTestListener(securityManager: SecurityManager?)

Functions

afterTest

suspend fun afterTest(testCase: TestCase, result: TestResult): Unit

beforeTest

suspend fun beforeTest(testCase: TestCase): Unit