Skip to content

Commit

Permalink
hotfix_test_utils (#69)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
doronporat authored and ofirventura committed Jan 10, 2018
1 parent 83fce53 commit 2dc0dca
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/scala/com/yotpo/metorikku/utils/TestUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 2dc0dca

Please sign in to comment.