use of com.ibm.watson.discovery.v1.model.GetConfigurationOptions in project java-sdk by watson-developer-cloud.
the class DiscoveryServiceIT method issueNumber517.
// Tests for reported issues
@Test
public void issueNumber517() {
String uniqueConfigName = uniqueName + "-config";
CreateConfigurationOptions.Builder createBuilder = new CreateConfigurationOptions.Builder(environmentId);
Configuration configuration = getTestConfiguration(DISCOVERY1_TEST_CONFIG_FILE);
configuration.setName(uniqueConfigName);
createBuilder.configuration(configuration);
Configuration createResponse = createConfiguration(createBuilder.build());
GetConfigurationOptions getOptions = new GetConfigurationOptions.Builder(environmentId, createResponse.getConfigurationId()).build();
Configuration getResponse = discovery.getConfiguration(getOptions).execute();
// returned config should have some json data
assertEquals(1, getResponse.getConversions().getJsonNormalizations().size());
}
use of com.ibm.watson.discovery.v1.model.GetConfigurationOptions in project java-sdk by watson-developer-cloud.
the class DiscoveryServiceTest method getConfigurationIsSuccessful.
/**
* Gets the configuration is successful.
*
* @throws InterruptedException the interrupted exception
*/
@Test
public void getConfigurationIsSuccessful() throws InterruptedException {
server.enqueue(jsonResponse(getConfResp));
GetConfigurationOptions getRequest = new GetConfigurationOptions.Builder(environmentId, configurationId).build();
Configuration response = discoveryService.getConfiguration(getRequest).execute().getResult();
RecordedRequest request = server.takeRequest();
assertEquals(CONF2_PATH, request.getPath());
assertEquals(GET, request.getMethod());
assertEquals(getConfResp, response);
}
Aggregations