Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Łukasz Ciołecki committed Oct 20, 2023
1 parent b1e168e commit fb3d9fc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class TestServiceInvocationCollector(testRunId: TestRunId) extends ResultCollect
}

//TODO: this should be somehow expressed via ResultCollector/TestServiceInvocationCollector
final class SinkInvocationCollector(runId: TestRunId, nodeId: String, ref: String) {
final class SinkInvocationCollector(runId: TestRunId, nodeId: String, ref: String) extends Serializable {

def collect(context: Context, result: Any): Unit = {
ResultsCollectingListenerHolder.updateResults(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ class FlinkTestScenarioRunnerSpec extends AnyFunSuite with Matchers with FlinkSp
.build()
.runWithData[Int, Int](scenario, List(10))

runResults.validValue.errors.collect { case NuExceptionInfo(_, e: SpelExpressionEvaluationException, _) =>
e.getMessage
runResults.validValue.errors.collect { case exc: NuExceptionInfo[_] =>
exc.throwable.asInstanceOf[SpelExpressionEvaluationException].getMessage
} shouldBe List(
"Expression [#input / 0 != 0] evaluation failed, message: divide by zero"
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package pl.touk.nussknacker.engine.lite.util.test

import cats.data.NonEmptyList
import cats.data.Validated.Invalid
import com.typesafe.config.ConfigValueFactory.fromAnyRef
import com.typesafe.config.{Config, ConfigFactory}
import org.scalatest.Inside
Expand All @@ -14,10 +12,10 @@ import pl.touk.nussknacker.engine.api.process.ProcessObjectDependencies
import pl.touk.nussknacker.engine.api.{MethodToInvoke, ParamName, Service}
import pl.touk.nussknacker.engine.build.ScenarioBuilder
import pl.touk.nussknacker.engine.spel.Implicits._
import pl.touk.nussknacker.engine.spel.SpelExpressionEvaluationException
import pl.touk.nussknacker.engine.util.functions.DateUtils
import pl.touk.nussknacker.engine.util.test.{RunResult, TestScenarioRunner}
import pl.touk.nussknacker.test.ValidatedValuesDetailedMessage
import pl.touk.nussknacker.engine.spel.SpelExpressionEvaluationException

import java.time.{Clock, Instant, ZoneId}
import java.util
Expand Down Expand Up @@ -137,8 +135,8 @@ class LiteTestScenarioRunnerSpec extends AnyFunSuite with Matchers with Validate
.build()
.runWithData[Int, Int](scenario, List(10))

runResults.validValue.errors.collect { case NuExceptionInfo(_, e: SpelExpressionEvaluationException, _) =>
e.getMessage
runResults.validValue.errors.collect { case exc: NuExceptionInfo[_] =>
exc.throwable.asInstanceOf[SpelExpressionEvaluationException].getMessage
} shouldBe List(
"Expression [#input / 0 != 0] evaluation failed, message: divide by zero"
)
Expand Down

0 comments on commit fb3d9fc

Please sign in to comment.