TestContext¶
Configuration of TestContext¶
To benefit of all features of com.opentelekomcloud.services.functiongraph.runtime.test.TestContext provide following environment variables:
Environment Variable |
Description |
|---|---|
OTC_SDK_AK |
Access Key |
OTC_SDK_SK |
Secret Key |
OTC_SDK_SECURITY_TOKEN |
Security Token |
OTC_SDK_PROJECTID |
Project Id |
OTC_SDK_SECURITY_ACCESS_KEY |
Security Access Key |
OTC_SDK_SECURITY_SECRET_KEY |
Security Secret Key |
OTC_SDK_TOKEN |
Token |
OTC_SDK_SECURITY_TOKEN |
Security Token |
In JUnit tests environment variables can be set using e.g. a configuration in maven-surefire-plugin for all test classes:
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.0</version>
<configuration>
<environmentVariables>
<OTC_SDK_AK>MyAccessKey</OTC_SDK_AK>
<OTC_SDK_SK>MySecretKey</OTC_SDK_SK>
<OTC_SDK_SECURITY_TOKEN>MySecretKey</OTC_SDK_SECURITY_TOKEN>
<OTC_SDK_PROJECTID>MyProjectId</OTC_SDK_PROJECTID>
</environmentVariables>
</configuration>
</plugin>
Or for Java using System Stubs (compatible with JDK 8 to JDK 16).