@InteractAs
Offers an alternative to InteractionService 's imperative approach to switch the InteractionContext for a given block of JUnit test code.
Example:
@Test @InteractAs( userName = "sven", localeName = "en", frozenDateTime = "2010-01-01 13:02:04 -03") void test() { // ... }
It can also be applied to a class, meaning it will apply to all tests within that class.
API
InteractAs.java
@interface InteractAs {
String userName() default // unspecified
""; (1)
String localeName() default // unspecified
""; (2)
String frozenDateTime() default // unspecified
""; (3)
}
1 | userName
If empty, defaults to the system user (with elevated privileges). |
2 | localeName
The Locale language tag. Eg. "en", "fr", "de", … If empty, defaults to current system locale. |
3 | frozenDateTime
If empty, defaults to current system time. |