Search in sources :

Example 6 with NormalizationOperation

use of com.ibm.watson.discovery.v1.model.NormalizationOperation in project java-sdk by watson-developer-cloud.

the class DiscoveryServiceIT method issueNumber518.

@Test
public void issueNumber518() {
    String[] operations = new String[] { Operation.MOVE, Operation.COPY, Operation.MERGE, Operation.REMOVE, Operation.REMOVE_NULLS };
    String uniqueConfigName = uniqueName + "-config";
    CreateConfigurationOptions.Builder createBuilder = new CreateConfigurationOptions.Builder(environmentId);
    Configuration configuration = getTestConfiguration(DISCOVERY2_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();
    // verify getResponse deserializes the operations appropriately
    for (NormalizationOperation normalization : getResponse.getNormalizations()) {
        String operation = normalization.getOperation();
        assertEquals(true, Arrays.asList(operations).contains(operation));
    }
}
Also used : CreateConfigurationOptions(com.ibm.watson.developer_cloud.discovery.v1.model.CreateConfigurationOptions) Configuration(com.ibm.watson.developer_cloud.discovery.v1.model.Configuration) GetConfigurationOptions(com.ibm.watson.developer_cloud.discovery.v1.model.GetConfigurationOptions) NormalizationOperation(com.ibm.watson.developer_cloud.discovery.v1.model.NormalizationOperation) Test(org.junit.Test) WatsonServiceTest(com.ibm.watson.developer_cloud.WatsonServiceTest)

Aggregations

WatsonServiceTest (com.ibm.watson.developer_cloud.WatsonServiceTest)3 Configuration (com.ibm.watson.developer_cloud.discovery.v1.model.Configuration)3 Conversions (com.ibm.watson.discovery.v1.model.Conversions)3 Enrichment (com.ibm.watson.discovery.v1.model.Enrichment)3 NormalizationOperation (com.ibm.watson.discovery.v1.model.NormalizationOperation)3 Source (com.ibm.watson.discovery.v1.model.Source)3 Conversions (com.ibm.watson.developer_cloud.discovery.v1.model.Conversions)2 CreateConfigurationOptions (com.ibm.watson.developer_cloud.discovery.v1.model.CreateConfigurationOptions)2 Enrichment (com.ibm.watson.developer_cloud.discovery.v1.model.Enrichment)2 NormalizationOperation (com.ibm.watson.developer_cloud.discovery.v1.model.NormalizationOperation)2 Configuration (com.ibm.watson.discovery.v1.model.Configuration)2 CreateConfigurationOptions (com.ibm.watson.discovery.v1.model.CreateConfigurationOptions)2 EnrichmentOptions (com.ibm.watson.discovery.v1.model.EnrichmentOptions)2 FontSetting (com.ibm.watson.discovery.v1.model.FontSetting)2 HtmlSettings (com.ibm.watson.discovery.v1.model.HtmlSettings)2 NluEnrichmentConcepts (com.ibm.watson.discovery.v1.model.NluEnrichmentConcepts)2 NluEnrichmentEmotion (com.ibm.watson.discovery.v1.model.NluEnrichmentEmotion)2 NluEnrichmentEntities (com.ibm.watson.discovery.v1.model.NluEnrichmentEntities)2 NluEnrichmentFeatures (com.ibm.watson.discovery.v1.model.NluEnrichmentFeatures)2 NluEnrichmentKeywords (com.ibm.watson.discovery.v1.model.NluEnrichmentKeywords)2