From 75af6ed7f4a650df962dd4354bb0e72c35efdc30 Mon Sep 17 00:00:00 2001 From: Michel Davit Date: Thu, 5 Sep 2024 14:43:14 +0200 Subject: [PATCH] Fix tests --- .../scio/testing/SCollectionMatchersTest.scala | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/scio-test/core/src/test/scala/com/spotify/scio/testing/SCollectionMatchersTest.scala b/scio-test/core/src/test/scala/com/spotify/scio/testing/SCollectionMatchersTest.scala index 5fc45a72bc..9c7c10c8be 100644 --- a/scio-test/core/src/test/scala/com/spotify/scio/testing/SCollectionMatchersTest.scala +++ b/scio-test/core/src/test/scala/com/spotify/scio/testing/SCollectionMatchersTest.scala @@ -20,7 +20,6 @@ package com.spotify.scio.testing import com.spotify.scio.coders.{Coder, CoderMaterializer} import com.spotify.scio.streaming.ACCUMULATING_FIRED_PANES import com.spotify.scio.values.WindowOptions -import org.apache.beam.sdk.Pipeline.PipelineExecutionException import org.apache.beam.sdk.transforms.windowing.{ AfterProcessingTime, AfterWatermark, @@ -130,10 +129,10 @@ class SCollectionMatchersTest extends PipelineSpec { an[AssertionError] should be thrownBy { runWithContext(_.parallelize(Seq(1)) should containSingleValue(10)) } - a[PipelineExecutionException] should be thrownBy { + a[AssertionError] should be thrownBy { runWithContext(_.parallelize(1 to 10) should containSingleValue(1)) } - a[PipelineExecutionException] should be thrownBy { + a[AssertionError] should be thrownBy { runWithContext { _.parallelize(Seq.empty[Int]) should containSingleValue(1) } @@ -145,10 +144,10 @@ class SCollectionMatchersTest extends PipelineSpec { an[AssertionError] should be thrownBy { runWithContext(_.parallelize(Seq(1)) shouldNot containSingleValue(1)) } - a[PipelineExecutionException] should be thrownBy { + a[AssertionError] should be thrownBy { runWithContext(_.parallelize(1 to 10) shouldNot containSingleValue(1)) } - a[PipelineExecutionException] should be thrownBy { + a[AssertionError] should be thrownBy { runWithContext { _.parallelize(Seq.empty[Int]) shouldNot containSingleValue(1) } @@ -351,12 +350,12 @@ class SCollectionMatchersTest extends PipelineSpec { _.parallelize(Seq(1)) should satisfySingleValue[Int](_ == 10) } } - a[PipelineExecutionException] should be thrownBy { + a[AssertionError] should be thrownBy { runWithContext { _.parallelize(1 to 10) should satisfySingleValue[Int](_ == 1) } } - a[PipelineExecutionException] should be thrownBy { + a[AssertionError] should be thrownBy { runWithContext { _.parallelize(Seq.empty[Int]) should satisfySingleValue[Int](_ == 1) } @@ -372,12 +371,12 @@ class SCollectionMatchersTest extends PipelineSpec { _.parallelize(Seq(1)) shouldNot satisfySingleValue[Int](_ == 1) } } - a[PipelineExecutionException] should be thrownBy { + a[AssertionError] should be thrownBy { runWithContext { _.parallelize(1 to 10) shouldNot satisfySingleValue[Int](_ == 1) } } - a[PipelineExecutionException] should be thrownBy { + a[AssertionError] should be thrownBy { runWithContext { _.parallelize(Seq.empty[Int]) shouldNot satisfySingleValue[Int](_ == 1) }