Skip to content

Commit 35267d9

Browse files
committed
test(discovery-v1): remove unnecesary changes
1 parent 9e934ca commit 35267d9

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

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

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2222,7 +2222,7 @@ private synchronized String setupTestDocuments() {
22222222

22232223
WaitFor.Condition collectionAvailable =
22242224
new WaitForCollectionAvailable(environmentId, collectionId);
2225-
WaitFor.waitFor(collectionAvailable, 1, TimeUnit.MINUTES, 500);
2225+
WaitFor.waitFor(collectionAvailable, 10, TimeUnit.SECONDS, 500);
22262226

22272227
return collectionId;
22282228
}
@@ -2316,20 +2316,10 @@ private class WaitForCollectionAvailable implements WaitFor.Condition {
23162316

23172317
@Override
23182318
public boolean isSatisfied() {
2319-
String status = "";
2320-
try {
2321-
// In a successful case, you can grab the ID with the following code.
2322-
GetCollectionOptions getOptions =
2323-
new GetCollectionOptions.Builder(environmentId, collectionId).build();
2324-
Collection collectionResult = discovery.getCollection(getOptions).execute().getResult();
2325-
status = collectionResult.getStatus();
2326-
} catch (ServiceResponseException e) {
2327-
// This is how you get the ID from a failed request.
2328-
// Make sure to use the ServiceResponseException class or one of its subclasses!
2329-
String transactionId = e.getHeaders().values("x-global-transaction-id").get(0);
2330-
System.out.println("x-global-transcation-id: "+transactionId);
2331-
System.err.println("x-global-transcation-id: "+transactionId);
2332-
}
2319+
GetCollectionOptions getOptions =
2320+
new GetCollectionOptions.Builder(environmentId, collectionId).build();
2321+
Collection collectionResult = discovery.getCollection(getOptions).execute().getResult();
2322+
String status = collectionResult.getStatus();
23332323
return status.equals(Collection.Status.ACTIVE);
23342324
}
23352325

0 commit comments

Comments
 (0)