SearchTestUtils
Stay organized with collections
Save and categorize content based on your preferences.
Utility methods to test that indexed items are served correctly.
Public Constructor Summary
Public Method Summary
static
SearchHelper
|
getSearchHelper(String[] authInfo, String applicationId, Optional<String> rootUrl)
Utility method to return SearchHelper object.
|
void
|
|
void
|
|
Inherited Method Summary
From class
java.lang.Object
boolean
|
equals(Object arg0)
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
Public Methods
public
static
SearchHelper
getSearchHelper
(String[] authInfo, String applicationId, Optional<String> rootUrl)
Utility method to return SearchHelper object.
Parameters
authInfo |
string array containing
userEmail of the user to client secrets file,
credentialsDirectory path containing the StoredCredential file and
clientSecrets path to the client secrets JSON file |
applicationId |
Id of the serving application |
rootUrl |
URL of the Indexing API
|
Throws
IOException |
|
GeneralSecurityException |
|
public
void
waitUntilItemNotServed
(String itemId, String query)
public
void
waitUntilItemServed
(String itemId, String query)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-03-18 UTC.
[null,null,["Last updated 2025-03-18 UTC."],[],[],null,["# SearchTestUtils\n\npublic class **SearchTestUtils** extends Object \nUtility methods to test that indexed items are served correctly. \n\n### Public Constructor Summary\n\n|---|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | [SearchTestUtils](/workspace/cloud-search/docs/reference/sdk/com/google/enterprise/cloudsearch/sdk/serving/SearchTestUtils#SearchTestUtils(com.google.enterprise.cloudsearch.sdk.serving.SearchHelper))([SearchHelper](/workspace/cloud-search/docs/reference/sdk/com/google/enterprise/cloudsearch/sdk/serving/SearchHelper) searchHelper) |\n\n### Public Method Summary\n\n|------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [SearchHelper](/workspace/cloud-search/docs/reference/sdk/com/google/enterprise/cloudsearch/sdk/serving/SearchHelper) | [getSearchHelper](/workspace/cloud-search/docs/reference/sdk/com/google/enterprise/cloudsearch/sdk/serving/SearchTestUtils#getSearchHelper(java.lang.String[], java.lang.String, java.util.Optional\u003cjava.lang.String\u003e))(String\\[\\] authInfo, String applicationId, Optional\\\u003cString\\\u003e rootUrl) Utility method to return SearchHelper object. |\n| void | [waitUntilItemNotServed](/workspace/cloud-search/docs/reference/sdk/com/google/enterprise/cloudsearch/sdk/serving/SearchTestUtils#waitUntilItemNotServed(java.lang.String, java.lang.String))(String itemId, String query) |\n| void | [waitUntilItemServed](/workspace/cloud-search/docs/reference/sdk/com/google/enterprise/cloudsearch/sdk/serving/SearchTestUtils#waitUntilItemServed(java.lang.String, java.lang.String))(String itemId, String query) |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|------------------|---------------------------|\n| boolean | equals(Object arg0) |\n| final Class\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| String | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nPublic Constructors\n-------------------\n\n#### public\n**SearchTestUtils**\n([SearchHelper](/workspace/cloud-search/docs/reference/sdk/com/google/enterprise/cloudsearch/sdk/serving/SearchHelper) searchHelper)\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| searchHelper | |\n|--------------|---|\n\nPublic Methods\n--------------\n\n#### public static [SearchHelper](/workspace/cloud-search/docs/reference/sdk/com/google/enterprise/cloudsearch/sdk/serving/SearchHelper)\n**getSearchHelper**\n(String\\[\\] authInfo, String applicationId, Optional\\\u003cString\\\u003e rootUrl)\n\nUtility method to return SearchHelper object. \n\n##### Parameters\n\n| authInfo | string array containing userEmail of the user to client secrets file, credentialsDirectory path containing the StoredCredential file and clientSecrets path to the client secrets JSON file |\n| applicationId | Id of the serving application |\n| rootUrl | URL of the Indexing API |\n|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n\n##### Throws\n\n| IOException | |\n| GeneralSecurityException | |\n|--------------------------|---|\n\n#### public void\n**waitUntilItemNotServed**\n(String itemId, String query)\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| itemId | |\n| query | |\n|--------|---|\n\n##### Throws\n\n| IOException | |\n|-------------|---|\n\n#### public void\n**waitUntilItemServed**\n(String itemId, String query)\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| itemId | |\n| query | |\n|--------|---|\n\n##### Throws\n\n| IOException | |\n|-------------|---|"]]