From 2dc0dcaa3d36e78e903456a64791b1313a13ce21 Mon Sep 17 00:00:00 2001 From: Doron Porat Date: Wed, 10 Jan 2018 16:16:55 +0200 Subject: [PATCH] hotfix_test_utils (#69) * fix(TestUtils): added missing paranthesis in Metorikku actual vs expected compare * fix(tests): add return statement to prevent inconsistent failures * fix(tests): add return statement to prevent inconsistent failures * fix(tests): fix test failure --- .../scala/com/yotpo/metorikku/utils/TestUtils.scala | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/scala/com/yotpo/metorikku/utils/TestUtils.scala b/src/main/scala/com/yotpo/metorikku/utils/TestUtils.scala index 16f57b649..11cabe2d4 100644 --- a/src/main/scala/com/yotpo/metorikku/utils/TestUtils.scala +++ b/src/main/scala/com/yotpo/metorikku/utils/TestUtils.scala @@ -100,13 +100,15 @@ object TestUtils { } private def matchExpectedRow(mapOfActualRow: Map[String, Nothing], metricExpectedResultRows: List[Map[String, Any]]): Map[String, Any] = { + // scalastyle:off for (expectedRowCandidate <- metricExpectedResultRows) { - if (isMatchingValuesInRow(mapOfActualRow, expectedRowCandidate)) expectedRowCandidate + if (isMatchingValuesInRow(mapOfActualRow, expectedRowCandidate)) { + return expectedRowCandidate + } } - // scalastyle:off null - //TODO Avoid using nulls + //TODO Avoid using nulls and return null - // scalastyle:on null + // scalastyle:on } private def isMatchingValuesInRow(actualRow: Map[String, Nothing], expectedRowCandidate: Map[String, Any]): Boolean = {