Environment
- Apex
Premise
In the present, we must change test user language at m17n testing ( like label which have to change by using language ) because the method like getLabel('key', 'language')
doesn't exist in Apex.
So, dynamically changing test user language is one of solutions.
Code
System.runAs(User)
method changes the test user in the following block.