File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
src/test/java/com/contentstack/sdk Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -12,12 +12,25 @@ class TestAsset {
1212
1313 private final Logger logger = Logger .getLogger (TestAsset .class .getName ());
1414 private String assetUid ;
15- private Stack stack = Credentials .getStack ();
15+ private final Stack stack = Credentials .getStack ();
1616
17+ private String envChecker () {
18+ String githubActions = System .getenv ("GITHUB_ACTIONS" );
19+ if (githubActions != null && githubActions .equals ("true" )) {
20+ System .out .println ("Tests are running in GitHub Actions environment." );
21+ String mySecretKey = System .getenv ("API_KEY" );
22+ System .out .println ("My Secret Key: " + mySecretKey );
23+ return "GitHub" ;
24+ } else {
25+ System .out .println ("Tests are running in a local environment." );
26+ return "local" ;
27+ }
28+ }
1729
1830 @ Test
1931 @ Order (1 )
2032 void testNewAssetLibrary () {
33+ envChecker ();
2134 AssetLibrary assets = stack .assetLibrary ();
2235 assets .fetchAll (new FetchAssetsCallback () {
2336 @ Override
You can’t perform that action at this time.
0 commit comments