setAllowOnlyMockedVariables

Versionshinweise

25.1

Code

void setAllowOnlyMockedVariables(boolean mockedVariablesOnly)

Beschreibung

Gibt an, ob Zugriffe (VariableUtils.getGlobalVariable) auf nicht überschriebene globale Variablen bei der Testausführung zu einem Fehler führen sollen.

Parameter

  • mockedVariablesOnly - true, falls ein Zugriff auf eine nicht überschriebene globale Variable Aufruf zu einem Fehler führen soll.

Beispiele

VariableMockUtils.setAllowOnlyMockedVariables(true);  
Object value = VariableUtils.getGlobalVariable("MyGlobalVariable"); // leads to an error because the global variable is not mocked