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 = {