Skip to content

Commit 17a944c

Browse files
TB_KEY/TB_SECRET check
1 parent 8793876 commit 17a944c

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/test/java/com/testingbot/testingbotrest/TestingBotRestTest.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import java.util.*;
77

88
import org.junit.Assert;
9+
import org.junit.Assume;
910
import org.junit.Before;
1011
import org.junit.Test;
1112
import static org.hamcrest.CoreMatchers.is;
@@ -21,7 +22,14 @@ public class TestingBotRestTest {
2122

2223
@Before
2324
public void setUp() {
24-
this.api = new TestingbotREST(System.getenv("TB_KEY"), System.getenv("TB_SECRET"));
25+
String key = System.getenv("TB_KEY");
26+
String secret = System.getenv("TB_SECRET");
27+
// Live integration suite: skip (not fail) when credentials are absent,
28+
// e.g. on Dependabot or outside-contributor PRs that lack Actions secrets.
29+
// The mock suite still runs; this suite runs on master pushes / releases.
30+
Assume.assumeTrue("TB_KEY/TB_SECRET not set; skipping live API tests",
31+
key != null && !key.isEmpty() && secret != null && !secret.isEmpty());
32+
this.api = new TestingbotREST(key, secret);
2533
}
2634

2735
@Test

0 commit comments

Comments
 (0)