@@ -32,7 +32,7 @@ public class DiscoveryIntegrationTests
3232 {
3333 private DiscoveryService service ;
3434 private string versionDate = "2019-11-22" ;
35- private string filepathToIngest = @"DiscoveryTestData/watson_beats_jeopardy.html " ;
35+ private string filepathToIngest = @"DiscoveryTestData/problem.json " ;
3636 private string enrichmentFile = @"DiscoveryTestData/test.csv" ;
3737 private string metadata = "{\" Creator\" : \" .NET SDK Test\" ,\" Subject\" : \" Discovery service\" }" ;
3838 private string bearerToken = "" ;
@@ -43,11 +43,12 @@ public class DiscoveryIntegrationTests
4343 [ TestInitialize ]
4444 public void Setup ( )
4545 {
46- //Authenticator discoveryAuthenticator = new BearerTokenAuthenticator(bearerToken: bearerToken);
47- //service = new DiscoveryService(versionDate: versionDate, authenticator: discoveryAuthenticator);
48- //service.SetServiceUrl(serviceUrl: serviceUrl);
49- //service.DisableSslVerification(true);
50- service = new DiscoveryService ( versionDate ) ;
46+ Authenticator discoveryAuthenticator = new BearerTokenAuthenticator ( bearerToken : bearerToken ) ;
47+ service = new DiscoveryService ( version : versionDate , authenticator : discoveryAuthenticator ) ;
48+ service . SetServiceUrl ( serviceUrl : serviceUrl ) ;
49+ service . DisableSslVerification ( true ) ;
50+ //service = new DiscoveryService(versionDate);
51+ //service.SetServiceUrl(serviceUrl);
5152 var creds = CredentialUtils . GetServiceProperties ( "discovery" ) ;
5253 creds . TryGetValue ( "PROJECT_ID" , out projectId ) ;
5354 creds . TryGetValue ( "COLLECTION_ID" , out collectionId ) ;
@@ -61,7 +62,7 @@ public void TestQueryPassagesPerDocument()
6162 projectId : projectId ,
6263 collectionIds : new List < string > { collectionId } ,
6364 passages : new QueryLargePassages ( ) { PerDocument = true } ,
64- query : "text:IBM " ,
65+ query : "text:document " ,
6566 count : 2 ) ;
6667
6768 Assert . IsNotNull ( queryResult . Result . Results [ 0 ] . DocumentPassages [ 0 ] . PassageText ) ;
@@ -74,7 +75,7 @@ public void TestQueryPassages()
7475 projectId : projectId ,
7576 collectionIds : new List < string > { collectionId } ,
7677 passages : new QueryLargePassages ( ) { PerDocument = false } ,
77- query : "text:IBM " ,
78+ query : "text:document " ,
7879 count : 2 ) ;
7980
8081 Assert . IsNotNull ( queryResult . Result . Passages [ 0 ] . CollectionId ) ;
@@ -186,7 +187,7 @@ public void TestGetAutocompletion()
186187 service . WithHeader ( "X-Watson-Test" , "1" ) ;
187188 var getAutocompletionResult = service . GetAutocompletion (
188189 projectId : projectId ,
189- prefix : "ha "
190+ prefix : "pd "
190191 ) ;
191192
192193 Assert . IsNotNull ( getAutocompletionResult . Result ) ;
@@ -320,14 +321,13 @@ public void TestAnalyzeDocument()
320321 using ( MemoryStream ms = new MemoryStream ( ) )
321322 {
322323 fs . CopyTo ( ms ) ;
323-
324324 service . WithHeader ( "X-Watson-Test" , "1" ) ;
325325 var response = service . AnalyzeDocument (
326326 projectId : projectId ,
327327 collectionId : collectionId ,
328328 file : ms ,
329- filename : "watson_beats_jeopardy.html " ,
330- fileContentType : DiscoveryService . AnalyzeDocumentEnums . FileContentTypeValue . TEXT_HTML ,
329+ filename : "problem.json " ,
330+ fileContentType : DiscoveryService . AnalyzeDocumentEnums . FileContentTypeValue . APPLICATION_JSON ,
331331 metadata : "{ \" metadata\" : \" value\" }"
332332 ) ;
333333 Assert . IsNotNull ( response ) ;
0 commit comments