csantanapr closed pull request #254: More Resiliency Updates for MessageHub Tests URL: https://github.com/apache/incubator-openwhisk-package-kafka/pull/254
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/tests/src/test/scala/system/packages/MessageHubFeedTests.scala b/tests/src/test/scala/system/packages/MessageHubFeedTests.scala index e280e39..9cd1e2f 100644 --- a/tests/src/test/scala/system/packages/MessageHubFeedTests.scala +++ b/tests/src/test/scala/system/packages/MessageHubFeedTests.scala @@ -175,7 +175,7 @@ class MessageHubFeedTests retry({ println("Polling for activations") val activations = wsk.activation.pollFor(N = 1, Some(triggerName), retries = maxRetries) - assert(activations.length == 1) + assert(activations.nonEmpty) val matchingActivations = for { id <- activations @@ -183,7 +183,7 @@ class MessageHubFeedTests if (activation.isRight && activation.right.get.fields.get("response").toString.contains(encodedCurrentTime)) } yield activation.right.get - assert(matchingActivations.length > 0) + assert(matchingActivations.nonEmpty) val activation = matchingActivations.head activation.getFieldPath("response", "success") shouldBe Some(true.toJson) @@ -311,7 +311,7 @@ class MessageHubFeedTests if (activation.isRight && (activation.right.get.fields.get("response").toString.contains(s"first${currentTime}"))) } yield activation.right.get - assert(matchingActivations.length == 0) + assert(matchingActivations.isEmpty) }, N = 3) } @@ -481,7 +481,7 @@ class MessageHubFeedTests retry({ println("Polling for activations") val activations = wsk.activation.pollFor(N = 1, Some(triggerName), since = Some(since), retries = maxRetries) - assert(activations.length == 1) + assert(activations.nonEmpty) println("Validating content of activation(s)") val matchingActivations = for { @@ -490,7 +490,7 @@ class MessageHubFeedTests if (activation.isRight && activation.right.get.fields.get("response").toString.contains(value)) } yield activation.right.get - assert(matchingActivations.length > 0) + assert(matchingActivations.nonEmpty) val activation = matchingActivations.head activation.getFieldPath("response", "success") shouldBe Some(true.toJson) diff --git a/tests/src/test/scala/system/packages/MessageHubProduceTests.scala b/tests/src/test/scala/system/packages/MessageHubProduceTests.scala index 4d2b38c..37a5bd9 100644 --- a/tests/src/test/scala/system/packages/MessageHubProduceTests.scala +++ b/tests/src/test/scala/system/packages/MessageHubProduceTests.scala @@ -209,7 +209,7 @@ class MessageHubProduceTests if (activation.isRight && activation.right.get.fields.get("response").toString.contains(decodedMessage)) } yield activation.right.get - assert(matchingActivations.length > 0) + assert(matchingActivations.nonEmpty) val activation = matchingActivations.head activation.getFieldPath("response", "success") shouldBe Some(true.toJson) @@ -278,7 +278,7 @@ class MessageHubProduceTests if (activation.isRight && activation.right.get.fields.get("response").toString.contains(decodedKey)) } yield activation.right.get - assert(matchingActivations.length > 0) + assert(matchingActivations.nonEmpty) val activation = matchingActivations.head activation.getFieldPath("response", "success") shouldBe Some(true.toJson) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services