Search in sources :

Example 11 with NoAuthAuthenticator

use of com.ibm.cloud.sdk.core.security.NoAuthAuthenticator in project java-sdk by watson-developer-cloud.

the class DiscoveryTest 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();
    discoveryService = new Discovery(version, serviceName, authenticator);
    String url = server.url("/").toString();
    discoveryService.setServiceUrl(url);
}
Also used : NoAuthAuthenticator(com.ibm.cloud.sdk.core.security.NoAuthAuthenticator) NoAuthAuthenticator(com.ibm.cloud.sdk.core.security.NoAuthAuthenticator) Authenticator(com.ibm.cloud.sdk.core.security.Authenticator)

Example 12 with NoAuthAuthenticator

use of com.ibm.cloud.sdk.core.security.NoAuthAuthenticator in project java-sdk by watson-developer-cloud.

the class LanguageTranslatorTest method constructClientService.

// Constructs an instance of the service to be used by the tests
public void constructClientService() {
    final String serviceName = "testService";
    // set mock values for global params
    String version = "2018-05-01";
    final Authenticator authenticator = new NoAuthAuthenticator();
    languageTranslatorService = new LanguageTranslator(version, serviceName, authenticator);
    String url = server.url("/").toString();
    languageTranslatorService.setServiceUrl(url);
}
Also used : NoAuthAuthenticator(com.ibm.cloud.sdk.core.security.NoAuthAuthenticator) NoAuthAuthenticator(com.ibm.cloud.sdk.core.security.NoAuthAuthenticator) Authenticator(com.ibm.cloud.sdk.core.security.Authenticator)

Example 13 with NoAuthAuthenticator

use of com.ibm.cloud.sdk.core.security.NoAuthAuthenticator in project java-sdk by watson-developer-cloud.

the class NaturalLanguageUnderstandingTest method constructClientService.

// Constructs an instance of the service to be used by the tests
public void constructClientService() {
    final String serviceName = "testService";
    // set mock values for global params
    String version = "testString";
    final Authenticator authenticator = new NoAuthAuthenticator();
    naturalLanguageUnderstandingService = new NaturalLanguageUnderstanding(version, serviceName, authenticator);
    String url = server.url("/").toString();
    naturalLanguageUnderstandingService.setServiceUrl(url);
}
Also used : NoAuthAuthenticator(com.ibm.cloud.sdk.core.security.NoAuthAuthenticator) NoAuthAuthenticator(com.ibm.cloud.sdk.core.security.NoAuthAuthenticator) Authenticator(com.ibm.cloud.sdk.core.security.Authenticator)

Example 14 with NoAuthAuthenticator

use of com.ibm.cloud.sdk.core.security.NoAuthAuthenticator in project java-sdk by watson-developer-cloud.

the class AssistantTest method constructClientService.

// Constructs an instance of the service to be used by the tests
public void constructClientService() {
    final String serviceName = "testService";
    // set mock values for global params
    String version = "testString";
    final Authenticator authenticator = new NoAuthAuthenticator();
    assistantService = new Assistant(version, serviceName, authenticator);
    String url = server.url("/").toString();
    assistantService.setServiceUrl(url);
}
Also used : NoAuthAuthenticator(com.ibm.cloud.sdk.core.security.NoAuthAuthenticator) Authenticator(com.ibm.cloud.sdk.core.security.Authenticator) NoAuthAuthenticator(com.ibm.cloud.sdk.core.security.NoAuthAuthenticator)

Example 15 with NoAuthAuthenticator

use of com.ibm.cloud.sdk.core.security.NoAuthAuthenticator in project java-sdk by watson-developer-cloud.

the class DiscoveryServiceTest method setup.

/**
 * Setup.
 *
 * @throws Exception the exception
 */
@Before
public void setup() throws Exception {
    super.setUp();
    discoveryService = new Discovery(VERSION, new NoAuthAuthenticator());
    discoveryService.setServiceUrl(getMockWebServerUrl());
    environmentId = "mock_envid";
    environmentName = "my_environment";
    environmentDesc = "My environment";
    uniqueConfigName = "my-config";
    configurationId = "mock_confid";
    uniqueCollectionName = "mock_collname";
    collectionId = "mock_collid";
    documentId = "mock_docid";
    queryId = "mock_queryid";
    date = new Date();
    testStream = new FileInputStream(RESOURCE + "get_env_resp.json");
    envResp = loadFixture(RESOURCE + "get_env_resp.json", Environment.class);
    envsResp = loadFixture(RESOURCE + "get_envs_resp.json", ListEnvironmentsResponse.class);
    createEnvResp = loadFixture(RESOURCE + "create_env_resp.json", Environment.class);
    deleteEnvResp = loadFixture(RESOURCE + "delete_env_resp.json", DeleteEnvironmentResponse.class);
    updateEnvResp = loadFixture(RESOURCE + "update_env_resp.json", Environment.class);
    createConfResp = loadFixture(RESOURCE + "create_conf_resp.json", Configuration.class);
    getConfsResp = loadFixture(RESOURCE + "get_confs_resp.json", ListConfigurationsResponse.class);
    getConfResp = loadFixture(RESOURCE + "get_conf_resp.json", Configuration.class);
    deleteConfResp = loadFixture(RESOURCE + "delete_conf_resp.json", DeleteConfigurationResponse.class);
    updateConfResp = loadFixture(RESOURCE + "update_conf_resp.json", Configuration.class);
    createCollResp = loadFixture(RESOURCE + "create_coll_resp.json", Collection.class);
    getCollsResp = loadFixture(RESOURCE + "get_coll_resp.json", ListCollectionsResponse.class);
    getCollResp = loadFixture(RESOURCE + "get_coll1_resp.json", Collection.class);
    deleteCollResp = loadFixture(RESOURCE + "delete_coll_resp.json", DeleteCollectionResponse.class);
    listfieldsCollResp = loadFixture(RESOURCE + "listfields_coll_resp.json", ListCollectionFieldsResponse.class);
    createDocResp = loadFixture(RESOURCE + "create_doc_resp.json", DocumentAccepted.class);
    updateDocResp = loadFixture(RESOURCE + "update_doc_resp.json", DocumentAccepted.class);
    getDocResp = loadFixture(RESOURCE + "get_doc_resp.json", DocumentStatus.class);
    deleteDocResp = loadFixture(RESOURCE + "delete_doc_resp.json", DeleteDocumentResponse.class);
    queryResp = loadFixture(RESOURCE + "query1_resp.json", QueryResponse.class);
    queryNoticesResp = loadFixture(RESOURCE + "query1_resp.json", QueryNoticesResponse.class);
    addTrainingQueryResp = loadFixture(RESOURCE + "add_training_query_resp.json", TrainingQuery.class);
    listTrainingDataResp = loadFixture(RESOURCE + "list_training_data_resp.json", TrainingDataSet.class);
    createTrainingExampleResp = loadFixture(RESOURCE + "add_training_example_resp.json", TrainingExample.class);
    getTrainingDataResp = loadFixture(RESOURCE + "get_training_data_resp.json", TrainingQuery.class);
    getTrainingExampleResp = loadFixture(RESOURCE + "get_training_example_resp.json", TrainingExample.class);
    updateTrainingExampleResp = loadFixture(RESOURCE + "update_training_example_resp.json", TrainingExample.class);
    listTrainingExamplesResp = loadFixture(RESOURCE + "list_training_examples_resp.json", TrainingExampleList.class);
    listFieldsResp = loadFixture(RESOURCE + "list_fields_resp.json", ListCollectionFieldsResponse.class);
    expansionsResp = loadFixture(RESOURCE + "expansions_resp.json", Expansions.class);
    credentialsResp = loadFixture(RESOURCE + "credentials_resp.json", Credentials.class);
    listCredentialsResp = loadFixture(RESOURCE + "list_credentials_resp.json", CredentialsList.class);
    deleteCredentialsResp = loadFixture(RESOURCE + "delete_credentials_resp.json", DeleteCredentials.class);
    createEventResp = loadFixture(RESOURCE + "create_event_resp.json", CreateEventResponse.class);
    metricResp = loadFixture(RESOURCE + "metric_resp.json", MetricResponse.class);
    metricTokenResp = loadFixture(RESOURCE + "metric_token_resp.json", MetricTokenResponse.class);
    logQueryResp = loadFixture(RESOURCE + "log_query_resp.json", LogQueryResponse.class);
    tokenDictStatusResponse = loadFixture(RESOURCE + "token_dict_status_resp.json", TokenDictStatusResponse.class);
    tokenDictStatusResponseStopwords = loadFixture(RESOURCE + "token_dict_status_resp_stopwords.json", TokenDictStatusResponse.class);
    gatewayResponse = loadFixture(RESOURCE + "gateway_resp.json", Gateway.class);
    listGatewaysResponse = loadFixture(RESOURCE + "list_gateways_resp.json", GatewayList.class);
    deleteGatewayResponse = loadFixture(RESOURCE + "delete_gateway_resp.json", GatewayDelete.class);
}
Also used : NoAuthAuthenticator(com.ibm.cloud.sdk.core.security.NoAuthAuthenticator) Configuration(com.ibm.watson.discovery.v1.model.Configuration) QueryNoticesResponse(com.ibm.watson.discovery.v1.model.QueryNoticesResponse) LogQueryResponse(com.ibm.watson.discovery.v1.model.LogQueryResponse) GatewayList(com.ibm.watson.discovery.v1.model.GatewayList) MetricResponse(com.ibm.watson.discovery.v1.model.MetricResponse) Gateway(com.ibm.watson.discovery.v1.model.Gateway) TrainingExample(com.ibm.watson.discovery.v1.model.TrainingExample) TrainingDataSet(com.ibm.watson.discovery.v1.model.TrainingDataSet) ListCollectionFieldsResponse(com.ibm.watson.discovery.v1.model.ListCollectionFieldsResponse) DeleteEnvironmentResponse(com.ibm.watson.discovery.v1.model.DeleteEnvironmentResponse) ListCollectionsResponse(com.ibm.watson.discovery.v1.model.ListCollectionsResponse) DocumentAccepted(com.ibm.watson.discovery.v1.model.DocumentAccepted) DeleteDocumentResponse(com.ibm.watson.discovery.v1.model.DeleteDocumentResponse) TrainingExampleList(com.ibm.watson.discovery.v1.model.TrainingExampleList) DeleteCredentials(com.ibm.watson.discovery.v1.model.DeleteCredentials) ListConfigurationsResponse(com.ibm.watson.discovery.v1.model.ListConfigurationsResponse) MetricTokenResponse(com.ibm.watson.discovery.v1.model.MetricTokenResponse) CreateEventResponse(com.ibm.watson.discovery.v1.model.CreateEventResponse) DeleteCollectionResponse(com.ibm.watson.discovery.v1.model.DeleteCollectionResponse) Date(java.util.Date) FileInputStream(java.io.FileInputStream) TrainingQuery(com.ibm.watson.discovery.v1.model.TrainingQuery) Expansions(com.ibm.watson.discovery.v1.model.Expansions) GatewayDelete(com.ibm.watson.discovery.v1.model.GatewayDelete) ListEnvironmentsResponse(com.ibm.watson.discovery.v1.model.ListEnvironmentsResponse) DocumentStatus(com.ibm.watson.discovery.v1.model.DocumentStatus) CredentialsList(com.ibm.watson.discovery.v1.model.CredentialsList) LogQueryResponse(com.ibm.watson.discovery.v1.model.LogQueryResponse) QueryResponse(com.ibm.watson.discovery.v1.model.QueryResponse) Environment(com.ibm.watson.discovery.v1.model.Environment) DeleteConfigurationResponse(com.ibm.watson.discovery.v1.model.DeleteConfigurationResponse) Collection(com.ibm.watson.discovery.v1.model.Collection) TokenDictStatusResponse(com.ibm.watson.discovery.v1.model.TokenDictStatusResponse) Credentials(com.ibm.watson.discovery.v1.model.Credentials) DeleteCredentials(com.ibm.watson.discovery.v1.model.DeleteCredentials)

Aggregations

NoAuthAuthenticator (com.ibm.cloud.sdk.core.security.NoAuthAuthenticator)20 Authenticator (com.ibm.cloud.sdk.core.security.Authenticator)14 Test (org.testng.annotations.Test)5 Request (okhttp3.Request)4 HttpUrl (okhttp3.HttpUrl)3 Collection (com.ibm.watson.discovery.v1.model.Collection)1 Configuration (com.ibm.watson.discovery.v1.model.Configuration)1 CreateEventResponse (com.ibm.watson.discovery.v1.model.CreateEventResponse)1 Credentials (com.ibm.watson.discovery.v1.model.Credentials)1 CredentialsList (com.ibm.watson.discovery.v1.model.CredentialsList)1 DeleteCollectionResponse (com.ibm.watson.discovery.v1.model.DeleteCollectionResponse)1 DeleteConfigurationResponse (com.ibm.watson.discovery.v1.model.DeleteConfigurationResponse)1 DeleteCredentials (com.ibm.watson.discovery.v1.model.DeleteCredentials)1 DeleteDocumentResponse (com.ibm.watson.discovery.v1.model.DeleteDocumentResponse)1 DeleteEnvironmentResponse (com.ibm.watson.discovery.v1.model.DeleteEnvironmentResponse)1 DocumentAccepted (com.ibm.watson.discovery.v1.model.DocumentAccepted)1 DocumentStatus (com.ibm.watson.discovery.v1.model.DocumentStatus)1 Environment (com.ibm.watson.discovery.v1.model.Environment)1 Expansions (com.ibm.watson.discovery.v1.model.Expansions)1 Gateway (com.ibm.watson.discovery.v1.model.Gateway)1