use of com.ibm.cloud.sdk.core.security.Authenticator in project cloudant-java-sdk by IBM.
the class DelegatingAuthenticatorFactoryTest method getAuthenticatorForSessionAuthType.
@Test
void getAuthenticatorForSessionAuthType() {
Authenticator authenticator = DelegatingAuthenticatorFactory.getAuthenticator("test", getServicePropsWithAuthType(Authenticator.PROPNAME_AUTH_TYPE, "COUCHDB_SESSION"));
assertTrue(authenticator instanceof CouchDbSessionAuthenticator, "Should return an " + "instance of CouchDbSessionAuthenticator");
}
use of com.ibm.cloud.sdk.core.security.Authenticator in project cloudant-java-sdk by IBM.
the class DelegatingAuthenticatorFactoryTest method getAuthenticatorForSessionAuthTypeAlias.
@Test
void getAuthenticatorForSessionAuthTypeAlias() {
Authenticator authenticator = DelegatingAuthenticatorFactory.getAuthenticator("test", getServicePropsWithAuthType("AUTHTYPE", "COUCHDB_SESSION"));
assertTrue(authenticator instanceof CouchDbSessionAuthenticator, "Should return an " + "instance of CouchDbSessionAuthenticator");
}
use of com.ibm.cloud.sdk.core.security.Authenticator in project cloudant-java-sdk by IBM.
the class CouchDbSessionAuthenticatorTest method validateNullUser.
@Test
void validateNullUser() {
Authenticator a = createAuthenticator(null, CouchDbSessionAuthenticatorTest.PASSWORD);
assertThrows(IllegalArgumentException.class, a::validate);
}
use of com.ibm.cloud.sdk.core.security.Authenticator in project cloudant-java-sdk by IBM.
the class CouchDbSessionAuthenticatorTest method validateEmptyUser.
@Test
void validateEmptyUser() {
Authenticator a = createAuthenticator("", CouchDbSessionAuthenticatorTest.PASSWORD);
assertThrows(IllegalArgumentException.class, a::validate);
}
use of com.ibm.cloud.sdk.core.security.Authenticator in project java-sdk by watson-developer-cloud.
the class CompareComplyServiceTest method setUp.
/*
* (non-Javadoc)
* @see com.ibm.watson.common.WatsonServiceTest#setUp()
*/
@Override
@Before
public void setUp() throws Exception {
super.setUp();
String apiKey = System.getenv("COMPARE_COMPLY_APIKEY");
Assume.assumeFalse("COMPARE_COMPLY_APIKEY is not defined", apiKey == null);
Authenticator authenticator = new IamAuthenticator(apiKey);
service = new CompareComply(VERSION, authenticator);
service.setServiceUrl(System.getenv("COMPARE_COMPLY_URL"));
service.setDefaultHeaders(getDefaultHeaders());
}
Aggregations