Skip to content

Commit e3944e9

Browse files
committed
test(auth): Add test for ICP auth
1 parent c7ec946 commit e3944e9

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

core/src/test/java/com/ibm/watson/developer_cloud/service/AuthenticationTest.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
import org.junit.Test;
44

55
import static org.junit.Assert.assertTrue;
6+
import static org.junit.Assert.assertFalse;
67

78
public class AuthenticationTest {
9+
private static final String APIKEY_USERNAME = "apikey";
810
private static final String APIKEY = "12345";
11+
private static final String ICP_APIKEY = "icp-12345";
912

1013
public class TestService extends WatsonService {
1114
private static final String SERVICE_NAME = "test";
@@ -18,7 +21,14 @@ public TestService() {
1821
@Test
1922
public void authenticateWithApiKeyAsUsername() {
2023
TestService service = new TestService();
21-
service.setUsernameAndPassword("apikey", APIKEY);
24+
service.setUsernameAndPassword(APIKEY_USERNAME, APIKEY);
2225
assertTrue(service.isTokenManagerSet());
2326
}
27+
28+
@Test
29+
public void authenticateWithIcp() {
30+
TestService service = new TestService();
31+
service.setUsernameAndPassword(APIKEY_USERNAME, ICP_APIKEY);
32+
assertFalse(service.isTokenManagerSet());
33+
}
2434
}

0 commit comments

Comments
 (0)