]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-4729: Adjusting tests to see if workflow state changes are happening asynchron...
authorRichard Millet <richard.millet@berkeley.edu>
Wed, 14 Dec 2011 06:45:12 +0000 (06:45 +0000)
committerRichard Millet <richard.millet@berkeley.edu>
Wed, 14 Dec 2011 06:45:12 +0000 (06:45 +0000)
services/client/src/main/java/org/collectionspace/services/client/test/AbstractServiceTestImpl.java

index fc3c7c82b65eba51b8ff27b242bf378b43229bbf..e769e38ae34250e699ff343f96255d04aec0f247 100644 (file)
@@ -799,9 +799,18 @@ public abstract class AbstractServiceTestImpl extends BaseServiceTest implements
             //
             // Next, test that a GET with WorkflowClient.WORKFLOWSTATE_DELETED query param set to 'false' returns a 404
             //
-            CollectionSpacePoxClient client = this.assertPoxClient();
-            ClientResponse<String> res = client.readIncludeDeleted(csid, Boolean.FALSE);
-            int result = res.getStatus();
+            int trials = 0;
+            int result = 0;
+            while (trials < 30) {
+                   CollectionSpacePoxClient client = this.assertPoxClient();
+                   ClientResponse<String> res = client.readIncludeDeleted(csid, Boolean.FALSE);
+                   result = res.getStatus();
+                   if (result == STATUS_NOT_FOUND) {
+                       logger.info("Workflow transition to 'deleted' is complete");
+                       break;
+                   }
+                   trials++;
+            }
             Assert.assertEquals(result, STATUS_NOT_FOUND);
 
         } catch (UnsupportedOperationException e) {