use of com.ibm.cloud.sdk.core.security.IamAuthenticator in project java-sdk by watson-developer-cloud.
the class PersonalityInsightsIT method setUp.
/**
* Sets up the tests.
*
* @throws Exception the exception
*/
/*
* (non-Javadoc)
*
* @see com.ibm.watson.common.WatsonServiceTest#setUp()
*/
@Override
@Before
public void setUp() throws Exception {
super.setUp();
String apiKey = System.getenv("PERSONALITY_INSIGHTS_APIKEY");
Assert.assertNotNull("PERSONALITY_INSIGHTS_APIKEY is not defined", apiKey);
Authenticator authenticator = new IamAuthenticator(apiKey);
service = new PersonalityInsights(VERSION, authenticator);
service.setServiceUrl(System.getenv("PERSONALITY_INSIGHTS_URL"));
service.setDefaultHeaders(getDefaultHeaders());
}
use of com.ibm.cloud.sdk.core.security.IamAuthenticator in project java-sdk by watson-developer-cloud.
the class VisualRecognitionIT method setUp.
/**
* Sets up the tests.
*
* @throws Exception the exception
*/
/*
* (non-Javadoc)
* @see com.ibm.watson.common.WatsonServiceTest#setUp()
*/
@Override
@Before
public void setUp() throws Exception {
super.setUp();
String iamApiKey = System.getenv("VISUAL_RECOGNITION_APIKEY");
assertNotNull("VISUAL_RECOGNITION_APIKEY is not defined", iamApiKey);
Authenticator authenticator = new IamAuthenticator(iamApiKey);
service = new VisualRecognition(VERSION, authenticator);
service.setDefaultHeaders(getDefaultHeaders());
}
Aggregations