Skip to content

Commit ca62e69

Browse files
committed
test(Discovery): Handle server needing to wait to perform tokenization dict operations
1 parent 628fb71 commit ca62e69

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

discovery/src/test/java/com/ibm/watson/developer_cloud/discovery/v1/DiscoveryServiceIT.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
import com.ibm.watson.developer_cloud.discovery.v1.query.AggregationType;
113113
import com.ibm.watson.developer_cloud.discovery.v1.query.Operator;
114114
import com.ibm.watson.developer_cloud.http.HttpMediaType;
115+
import com.ibm.watson.developer_cloud.service.exception.BadRequestException;
115116
import com.ibm.watson.developer_cloud.service.exception.ForbiddenException;
116117
import com.ibm.watson.developer_cloud.service.exception.NotFoundException;
117118
import com.ibm.watson.developer_cloud.service.exception.UnauthorizedException;
@@ -1943,6 +1944,9 @@ public void tokenizationDictionaryOperationsAreSuccessful() throws InterruptedEx
19431944
.collectionId(testCollectionId)
19441945
.build();
19451946
discovery.deleteTokenizationDictionary(deleteOptions).execute();
1947+
} catch (BadRequestException ex) {
1948+
// this most likely means the service wasn't ready to handle another tokenization file - this is fine
1949+
System.out.println("Service wasn't ready yet! Error: " + ex.getMessage());
19461950
} finally {
19471951
// delete test collection
19481952
DeleteCollectionOptions deleteCollectionOptions = new DeleteCollectionOptions.Builder()

0 commit comments

Comments
 (0)