use of com.ibm.cloud.sdk.core.security.Authenticator in project cloudant-java-sdk by IBM.
the class CouchDbSessionAuthenticatorTest method newAuthenticator.
@Test
void newAuthenticator() {
Authenticator authenticator = createAuthenticator(USERNAME, PASSWORD);
assertNotNull(authenticator, "Authenticator should not be null.");
}
use of com.ibm.cloud.sdk.core.security.Authenticator in project cloudant-java-sdk by IBM.
the class CouchDbSessionAuthenticatorTest method validateEmptyPass.
@Test
void validateEmptyPass() {
Authenticator a = createAuthenticator(CouchDbSessionAuthenticatorTest.USERNAME, "");
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 validateNullPass.
@Test
void validateNullPass() {
Authenticator a = createAuthenticator(CouchDbSessionAuthenticatorTest.USERNAME, null);
assertThrows(IllegalArgumentException.class, a::validate);
}
use of com.ibm.cloud.sdk.core.security.Authenticator in project cloudant-java-sdk by IBM.
the class Cloudant method newInstance.
/**
* Class method which constructs an instance of the `Cloudant` client.
* The specified service name is used to configure the client instance.
*
* @param serviceName the service name to be used when configuring the client instance
* @return an instance of the `Cloudant` client using external configuration
*/
public static Cloudant newInstance(String serviceName) {
Authenticator authenticator = com.ibm.cloud.cloudant.internal.DelegatingAuthenticatorFactory.getAuthenticator(serviceName);
Cloudant service = new Cloudant(serviceName, authenticator);
service.configureService(serviceName);
return service;
}
use of com.ibm.cloud.sdk.core.security.Authenticator in project java-sdk by watson-developer-cloud.
the class ToneAnalyzerTest method constructClientService.
public void constructClientService() throws Throwable {
final String serviceName = "testService";
// set mock values for global params
String version = "testString";
final Authenticator authenticator = new NoAuthAuthenticator();
toneAnalyzerService = new ToneAnalyzer(version, serviceName, authenticator);
String url = server.url("/").toString();
toneAnalyzerService.setServiceUrl(url);
}
Aggregations