diff --git a/amber/src/test/integration/org/apache/texera/amber/storage/result/iceberg/IcebergDocumentConsoleMessagesSpec.scala b/amber/src/test/integration/org/apache/texera/amber/storage/result/iceberg/IcebergDocumentConsoleMessagesSpec.scala index a74d1f741a5..1e7f1ea8222 100644 --- a/amber/src/test/integration/org/apache/texera/amber/storage/result/iceberg/IcebergDocumentConsoleMessagesSpec.scala +++ b/amber/src/test/integration/org/apache/texera/amber/storage/result/iceberg/IcebergDocumentConsoleMessagesSpec.scala @@ -25,7 +25,6 @@ import org.apache.texera.amber.core.storage.{DocumentFactory, VFSURIFactory} import org.apache.texera.amber.core.tuple.{Schema, Tuple} import org.apache.texera.amber.core.virtualidentity._ import org.apache.texera.amber.tags.IntegrationTest -import org.scalatest.BeforeAndAfterAll import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers @@ -37,8 +36,7 @@ import scala.util.{Try, Using} class IcebergDocumentConsoleMessagesSpec extends AnyFlatSpec with Matchers - with VirtualDocumentSpec[Tuple] - with BeforeAndAfterAll { + with VirtualDocumentSpec[Tuple] { private val amberSchema: Schema = ResultSchema.consoleMessagesSchema var uri: URI = _ diff --git a/amber/src/test/scala/org/apache/texera/amber/engine/architecture/control/TrivialControlSpec.scala b/amber/src/test/scala/org/apache/texera/amber/engine/architecture/control/TrivialControlSpec.scala index cb37ddf9130..bf9b6cbd47f 100644 --- a/amber/src/test/scala/org/apache/texera/amber/engine/architecture/control/TrivialControlSpec.scala +++ b/amber/src/test/scala/org/apache/texera/amber/engine/architecture/control/TrivialControlSpec.scala @@ -42,7 +42,7 @@ import org.apache.texera.amber.engine.common.ambermessage.WorkflowMessage.getInM import org.apache.texera.amber.engine.common.rpc.AsyncRPCClient.ControlInvocation import org.apache.texera.amber.engine.common.virtualidentity.util.COORDINATOR import org.scalatest.wordspec.AnyWordSpecLike -import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach} +import org.scalatest.BeforeAndAfterAll import scala.collection.mutable import scala.concurrent.duration._ @@ -50,7 +50,6 @@ import scala.concurrent.duration._ class TrivialControlSpec extends TestKit(ActorSystem("TrivialControlSpec")) with AnyWordSpecLike - with BeforeAndAfterEach with BeforeAndAfterAll { override def afterAll(): Unit = { diff --git a/amber/src/test/scala/org/apache/texera/amber/engine/architecture/messaginglayer/NetworkInputGatewaySpec.scala b/amber/src/test/scala/org/apache/texera/amber/engine/architecture/messaginglayer/NetworkInputGatewaySpec.scala index 04f4f000455..6593b44b501 100644 --- a/amber/src/test/scala/org/apache/texera/amber/engine/architecture/messaginglayer/NetworkInputGatewaySpec.scala +++ b/amber/src/test/scala/org/apache/texera/amber/engine/architecture/messaginglayer/NetworkInputGatewaySpec.scala @@ -22,10 +22,9 @@ package org.apache.texera.amber.engine.architecture.messaginglayer import org.apache.texera.amber.core.tuple.{AttributeType, Schema, TupleLike} import org.apache.texera.amber.core.virtualidentity.{ActorVirtualIdentity, ChannelIdentity} import org.apache.texera.amber.engine.common.ambermessage.{DataFrame, WorkflowFIFOMessage} -import org.scalamock.scalatest.MockFactory import org.scalatest.flatspec.AnyFlatSpec -class NetworkInputGatewaySpec extends AnyFlatSpec with MockFactory { +class NetworkInputGatewaySpec extends AnyFlatSpec { private val fakeReceiverID = ActorVirtualIdentity("testReceiver") private val fakeSenderID = ActorVirtualIdentity("testSender") diff --git a/amber/src/test/scala/org/apache/texera/amber/engine/architecture/messaginglayer/RangeBasedShuffleSpec.scala b/amber/src/test/scala/org/apache/texera/amber/engine/architecture/messaginglayer/RangeBasedShuffleSpec.scala index 668b4fda99f..424f34e79e2 100644 --- a/amber/src/test/scala/org/apache/texera/amber/engine/architecture/messaginglayer/RangeBasedShuffleSpec.scala +++ b/amber/src/test/scala/org/apache/texera/amber/engine/architecture/messaginglayer/RangeBasedShuffleSpec.scala @@ -23,10 +23,9 @@ import org.apache.texera.amber.core.tuple.{Attribute, AttributeType, Schema, Tup import org.apache.texera.amber.core.virtualidentity.{ActorVirtualIdentity, ChannelIdentity} import org.apache.texera.amber.engine.architecture.sendsemantics.partitioners.RangeBasedShufflePartitioner import org.apache.texera.amber.engine.architecture.sendsemantics.partitionings.RangeBasedShufflePartitioning -import org.scalamock.scalatest.MockFactory import org.scalatest.flatspec.AnyFlatSpec -class RangeBasedShuffleSpec extends AnyFlatSpec with MockFactory { +class RangeBasedShuffleSpec extends AnyFlatSpec { val identifier = ActorVirtualIdentity("batch producer mock") val fakeID1: ActorVirtualIdentity = ActorVirtualIdentity("rec1") val fakeID2: ActorVirtualIdentity = ActorVirtualIdentity("rec2") diff --git a/amber/src/test/scala/org/apache/texera/amber/engine/architecture/scheduling/CostBasedScheduleGeneratorSpec.scala b/amber/src/test/scala/org/apache/texera/amber/engine/architecture/scheduling/CostBasedScheduleGeneratorSpec.scala index 0b4aabe3b19..40b891474a0 100644 --- a/amber/src/test/scala/org/apache/texera/amber/engine/architecture/scheduling/CostBasedScheduleGeneratorSpec.scala +++ b/amber/src/test/scala/org/apache/texera/amber/engine/architecture/scheduling/CostBasedScheduleGeneratorSpec.scala @@ -30,12 +30,11 @@ import org.apache.texera.amber.engine.common.virtualidentity.util.COORDINATOR import org.apache.texera.amber.engine.e2e.TestUtils.buildWorkflow import org.apache.texera.amber.operator.TestOperators import org.apache.texera.common.compiler.model.LogicalLink -import org.scalamock.scalatest.MockFactory import org.scalatest.flatspec.AnyFlatSpec import scala.jdk.CollectionConverters._ -class CostBasedScheduleGeneratorSpec extends AnyFlatSpec with MockFactory { +class CostBasedScheduleGeneratorSpec extends AnyFlatSpec { "CostBasedRegionPlanGenerator" should "finish bottom-up search using different pruning techniques with correct number of states explored in csv->->filter->join->filter2 workflow" in { val headerlessCsvOpDesc1 = TestOperators.headerlessSmallCsvScanOpDesc() diff --git a/amber/src/test/scala/org/apache/texera/amber/engine/architecture/scheduling/DefaultCostEstimatorSpec.scala b/amber/src/test/scala/org/apache/texera/amber/engine/architecture/scheduling/DefaultCostEstimatorSpec.scala index c3438d5d387..dc1949741cb 100644 --- a/amber/src/test/scala/org/apache/texera/amber/engine/architecture/scheduling/DefaultCostEstimatorSpec.scala +++ b/amber/src/test/scala/org/apache/texera/amber/engine/architecture/scheduling/DefaultCostEstimatorSpec.scala @@ -40,7 +40,7 @@ import org.apache.texera.dao.MockTexeraDB import org.apache.texera.dao.jooq.generated.enums.UserRoleEnum import org.apache.texera.web.ExecutionDatabaseTestSupport import org.scalatest.flatspec.AnyFlatSpec -import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach} +import org.scalatest.BeforeAndAfterEach import java.net.URI import java.sql.Timestamp @@ -48,7 +48,6 @@ import scala.jdk.CollectionConverters.CollectionHasAsScala class DefaultCostEstimatorSpec extends AnyFlatSpec - with BeforeAndAfterAll with BeforeAndAfterEach with MockTexeraDB with ExecutionDatabaseTestSupport { diff --git a/amber/src/test/scala/org/apache/texera/amber/engine/architecture/worker/DataProcessorSpec.scala b/amber/src/test/scala/org/apache/texera/amber/engine/architecture/worker/DataProcessorSpec.scala index c48e9594208..33129ffe0e4 100644 --- a/amber/src/test/scala/org/apache/texera/amber/engine/architecture/worker/DataProcessorSpec.scala +++ b/amber/src/test/scala/org/apache/texera/amber/engine/architecture/worker/DataProcessorSpec.scala @@ -62,14 +62,13 @@ import org.apache.texera.amber.engine.common.virtualidentity.util.COORDINATOR import org.apache.texera.amber.util.JSONUtils.objectMapper import org.apache.texera.amber.util.VirtualIdentityUtils import org.scalamock.scalatest.MockFactory -import org.scalatest.BeforeAndAfterEach import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers import java.util.concurrent.LinkedBlockingQueue import scala.collection.mutable.ArrayBuffer -class DataProcessorSpec extends AnyFlatSpec with MockFactory with Matchers with BeforeAndAfterEach { +class DataProcessorSpec extends AnyFlatSpec with MockFactory with Matchers { import DataProcessorSpec._ diff --git a/amber/src/test/scala/org/apache/texera/amber/engine/architecture/worker/WorkerSpec.scala b/amber/src/test/scala/org/apache/texera/amber/engine/architecture/worker/WorkerSpec.scala index 96929eab9a2..81d71cc0bb5 100644 --- a/amber/src/test/scala/org/apache/texera/amber/engine/architecture/worker/WorkerSpec.scala +++ b/amber/src/test/scala/org/apache/texera/amber/engine/architecture/worker/WorkerSpec.scala @@ -49,7 +49,6 @@ import org.apache.texera.amber.engine.common.ambermessage.{ } import org.apache.texera.amber.engine.common.rpc.AsyncRPCClient import org.apache.texera.amber.engine.common.virtualidentity.util.COORDINATOR -import org.scalamock.scalatest.MockFactory import org.scalatest.BeforeAndAfterAll import org.scalatest.flatspec.AnyFlatSpecLike @@ -67,8 +66,7 @@ class WorkerSpec extends TestKit(ActorSystem("WorkerSpec", AmberRuntime.pekkoConfig)) with ImplicitSender with AnyFlatSpecLike - with BeforeAndAfterAll - with MockFactory { + with BeforeAndAfterAll { def mkSchema(fields: Any*): Schema = { var schema = Schema() diff --git a/amber/src/test/scala/org/apache/texera/amber/engine/e2e/BatchSizePropagationSpec.scala b/amber/src/test/scala/org/apache/texera/amber/engine/e2e/BatchSizePropagationSpec.scala index 8e2a804b0fe..968a1dcb53f 100644 --- a/amber/src/test/scala/org/apache/texera/amber/engine/e2e/BatchSizePropagationSpec.scala +++ b/amber/src/test/scala/org/apache/texera/amber/engine/e2e/BatchSizePropagationSpec.scala @@ -32,7 +32,7 @@ import org.apache.texera.amber.operator.{LogicalOp, TestOperators} import org.apache.texera.amber.operator.aggregate.AggregationFunction import org.apache.texera.common.compiler.model.LogicalLink import org.scalatest.flatspec.AnyFlatSpecLike -import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach} +import org.scalatest.BeforeAndAfterAll import scala.concurrent.duration.DurationInt @@ -40,8 +40,7 @@ class BatchSizePropagationSpec extends TestKit(ActorSystem("BatchSizePropagationSpec")) with ImplicitSender with AnyFlatSpecLike - with BeforeAndAfterAll - with BeforeAndAfterEach { + with BeforeAndAfterAll { implicit val timeout: Timeout = Timeout(5.seconds) diff --git a/amber/src/test/scala/org/apache/texera/amber/engine/faulttolerance/LoggingSpec.scala b/amber/src/test/scala/org/apache/texera/amber/engine/faulttolerance/LoggingSpec.scala index e090642f3c3..b1756ad68ab 100644 --- a/amber/src/test/scala/org/apache/texera/amber/engine/faulttolerance/LoggingSpec.scala +++ b/amber/src/test/scala/org/apache/texera/amber/engine/faulttolerance/LoggingSpec.scala @@ -67,6 +67,10 @@ class LoggingSpec with BeforeAndAfterAll with TimeLimitedTests { + override def afterAll(): Unit = { + TestKit.shutdownActorSystem(system) + } + private val identifier1 = ActorVirtualIdentity("Worker:WF1-E1-op-layer-1") private val identifier2 = ActorVirtualIdentity("Worker:WF1-E1-op-layer-2") private val operatorIdentity = OperatorIdentity("testOperator") diff --git a/amber/src/test/scala/org/apache/texera/amber/engine/faulttolerance/ReplaySpec.scala b/amber/src/test/scala/org/apache/texera/amber/engine/faulttolerance/ReplaySpec.scala index 3fa198fb058..e178aa3a349 100644 --- a/amber/src/test/scala/org/apache/texera/amber/engine/faulttolerance/ReplaySpec.scala +++ b/amber/src/test/scala/org/apache/texera/amber/engine/faulttolerance/ReplaySpec.scala @@ -50,6 +50,10 @@ class ReplaySpec with AnyFlatSpecLike with BeforeAndAfterAll { + override def afterAll(): Unit = { + TestKit.shutdownActorSystem(system) + } + class IterableReadOnlyLogStore(iter: Iterable[ReplayLogRecord]) extends SequentialRecordStorage[ReplayLogRecord] { override def getWriter( diff --git a/common/workflow-core/src/test/scala/org/apache/texera/amber/core/storage/util/LakeFSStorageClientMtimeSpec.scala b/common/workflow-core/src/test/scala/org/apache/texera/amber/core/storage/util/LakeFSStorageClientMtimeSpec.scala index 88076d807c3..2fc1b682d45 100644 --- a/common/workflow-core/src/test/scala/org/apache/texera/amber/core/storage/util/LakeFSStorageClientMtimeSpec.scala +++ b/common/workflow-core/src/test/scala/org/apache/texera/amber/core/storage/util/LakeFSStorageClientMtimeSpec.scala @@ -57,11 +57,7 @@ import java.nio.charset.StandardCharsets * whichever suite ran second talk to the other one's server. */ @NonParallelTest -class LakeFSStorageClientMtimeSpec - extends AnyFlatSpec - with Matchers - with ForAllTestContainer - with org.scalatest.BeforeAndAfterAll { +class LakeFSStorageClientMtimeSpec extends AnyFlatSpec with Matchers with ForAllTestContainer { // Shared network so LakeFS can reach Postgres and RustFS by their in-network aliases while // the test reaches LakeFS/RustFS via mapped host ports. diff --git a/common/workflow-core/src/test/scala/org/apache/texera/amber/storage/FileResolverSpec.scala b/common/workflow-core/src/test/scala/org/apache/texera/amber/storage/FileResolverSpec.scala index 2d7f06b9004..2b3783af7f2 100644 --- a/common/workflow-core/src/test/scala/org/apache/texera/amber/storage/FileResolverSpec.scala +++ b/common/workflow-core/src/test/scala/org/apache/texera/amber/storage/FileResolverSpec.scala @@ -42,15 +42,11 @@ import org.apache.texera.dao.jooq.generated.tables.pojos.{ User } import org.scalatest.flatspec.AnyFlatSpec -import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach} +import org.scalatest.BeforeAndAfterAll import java.nio.file.Paths -class FileResolverSpec - extends AnyFlatSpec - with BeforeAndAfterAll - with BeforeAndAfterEach - with MockTexeraDB { +class FileResolverSpec extends AnyFlatSpec with BeforeAndAfterAll with MockTexeraDB { private val testUser: User = { val user = new User diff --git a/common/workflow-core/src/test/scala/org/apache/texera/service/util/LargeBinaryInputStreamSpec.scala b/common/workflow-core/src/test/scala/org/apache/texera/service/util/LargeBinaryInputStreamSpec.scala index 21b6e8c29b7..5bdba17f56c 100644 --- a/common/workflow-core/src/test/scala/org/apache/texera/service/util/LargeBinaryInputStreamSpec.scala +++ b/common/workflow-core/src/test/scala/org/apache/texera/service/util/LargeBinaryInputStreamSpec.scala @@ -21,18 +21,13 @@ package org.apache.texera.service.util import org.apache.texera.amber.core.tuple.LargeBinary import org.apache.texera.common.tags.NonParallelTest -import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach} import org.scalatest.funsuite.AnyFunSuite import java.io.{ByteArrayInputStream, IOException} import scala.util.Random @NonParallelTest -class LargeBinaryInputStreamSpec - extends AnyFunSuite - with S3StorageTestBase - with BeforeAndAfterAll - with BeforeAndAfterEach { +class LargeBinaryInputStreamSpec extends AnyFunSuite with S3StorageTestBase { private val testBucketName = "test-large-binary-input-stream" diff --git a/common/workflow-core/src/test/scala/org/apache/texera/service/util/LargeBinaryOutputStreamSpec.scala b/common/workflow-core/src/test/scala/org/apache/texera/service/util/LargeBinaryOutputStreamSpec.scala index 35e75950138..3c87be43305 100644 --- a/common/workflow-core/src/test/scala/org/apache/texera/service/util/LargeBinaryOutputStreamSpec.scala +++ b/common/workflow-core/src/test/scala/org/apache/texera/service/util/LargeBinaryOutputStreamSpec.scala @@ -21,18 +21,13 @@ package org.apache.texera.service.util import org.apache.texera.amber.core.tuple.LargeBinary import org.apache.texera.common.tags.NonParallelTest -import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach} import org.scalatest.funsuite.AnyFunSuite import java.io.IOException import scala.util.Random @NonParallelTest -class LargeBinaryOutputStreamSpec - extends AnyFunSuite - with S3StorageTestBase - with BeforeAndAfterAll - with BeforeAndAfterEach { +class LargeBinaryOutputStreamSpec extends AnyFunSuite with S3StorageTestBase { private val testBucketName = "test-large-binary-output-stream" diff --git a/common/workflow-core/src/test/scala/org/apache/texera/service/util/S3StorageClientSpec.scala b/common/workflow-core/src/test/scala/org/apache/texera/service/util/S3StorageClientSpec.scala index 1e910a46b6b..9e2c068f0d2 100644 --- a/common/workflow-core/src/test/scala/org/apache/texera/service/util/S3StorageClientSpec.scala +++ b/common/workflow-core/src/test/scala/org/apache/texera/service/util/S3StorageClientSpec.scala @@ -21,7 +21,6 @@ package org.apache.texera.service.util import org.apache.texera.common.config.StorageConfig import org.apache.texera.common.tags.NonParallelTest -import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach} import org.scalatest.funsuite.AnyFunSuite import software.amazon.awssdk.auth.credentials.{AwsBasicCredentials, StaticCredentialsProvider} import software.amazon.awssdk.regions.Region @@ -36,11 +35,7 @@ import scala.jdk.CollectionConverters._ import scala.util.Random @NonParallelTest -class S3StorageClientSpec - extends AnyFunSuite - with S3StorageTestBase - with BeforeAndAfterAll - with BeforeAndAfterEach { +class S3StorageClientSpec extends AnyFunSuite with S3StorageTestBase { private val testBucketName = "test-s3-storage-client" diff --git a/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/keywordSearch/KeywordSearchOpExecSpec.scala b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/keywordSearch/KeywordSearchOpExecSpec.scala index d035a3da7b0..b3addf36ff8 100644 --- a/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/keywordSearch/KeywordSearchOpExecSpec.scala +++ b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/keywordSearch/KeywordSearchOpExecSpec.scala @@ -21,10 +21,9 @@ package org.apache.texera.amber.operator.keywordSearch import org.apache.texera.amber.core.tuple.{Attribute, AttributeType, Schema, Tuple} import org.apache.texera.amber.util.JSONUtils.objectMapper -import org.scalatest.BeforeAndAfter import org.scalatest.flatspec.AnyFlatSpec -class KeywordSearchOpExecSpec extends AnyFlatSpec with BeforeAndAfter { +class KeywordSearchOpExecSpec extends AnyFlatSpec { val inputPort: Int = 0 val opDesc: KeywordSearchOpDesc = new KeywordSearchOpDesc() diff --git a/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/source/fetcher/URLFetcherOpExecSpec.scala b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/source/fetcher/URLFetcherOpExecSpec.scala index a1a3967d65c..e6dbf902962 100644 --- a/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/source/fetcher/URLFetcherOpExecSpec.scala +++ b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/source/fetcher/URLFetcherOpExecSpec.scala @@ -20,9 +20,8 @@ package org.apache.texera.amber.operator.source.fetcher import org.apache.texera.amber.util.JSONUtils.objectMapper -import org.scalatest.BeforeAndAfter import org.scalatest.flatspec.AnyFlatSpec -class URLFetcherOpExecSpec extends AnyFlatSpec with BeforeAndAfter { +class URLFetcherOpExecSpec extends AnyFlatSpec { val opDesc: URLFetcherOpDesc = new URLFetcherOpDesc() diff --git a/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/typecasting/TypeCastingOpExecSpec.scala b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/typecasting/TypeCastingOpExecSpec.scala index 02b710a849d..071b5520af5 100644 --- a/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/typecasting/TypeCastingOpExecSpec.scala +++ b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/typecasting/TypeCastingOpExecSpec.scala @@ -21,9 +21,8 @@ package org.apache.texera.amber.operator.typecasting import org.apache.texera.amber.core.tuple._ import org.apache.texera.amber.util.JSONUtils.objectMapper -import org.scalatest.BeforeAndAfter import org.scalatest.flatspec.AnyFlatSpec -class TypeCastingOpExecSpec extends AnyFlatSpec with BeforeAndAfter { +class TypeCastingOpExecSpec extends AnyFlatSpec { val tupleSchema: Schema = Schema() .add(new Attribute("field1", AttributeType.STRING)) .add(new Attribute("field2", AttributeType.INTEGER)) diff --git a/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/ImageViz/ImageVisualizerOpDescSpec.scala b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/ImageViz/ImageVisualizerOpDescSpec.scala index 71c90f83bce..08c8930773f 100644 --- a/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/ImageViz/ImageVisualizerOpDescSpec.scala +++ b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/ImageViz/ImageVisualizerOpDescSpec.scala @@ -40,13 +40,13 @@ class ImageVisualizerOpDescSpec // operator reaches the nonEmpty assert and surfaces a domain error with // the standard "cannot be empty" message rather than a // NullPointerException from dereferencing null. - val ex = expectError[AssertionError]("cannot be empty")(opDesc.createBinaryData()) + expectError[AssertionError]("cannot be empty")(opDesc.createBinaryData()) } it should "reject missing binaryContent with a controlled error via generatePythonCode" in { // The assert inside createBinaryData is also reachable through the // public codegen entry point; the same message must surface there. - val ex = expectError[AssertionError]("cannot be empty")(opDesc.generatePythonCode()) + expectError[AssertionError]("cannot be empty")(opDesc.generatePythonCode()) } "ImageVisualizerOpDesc.operatorInfo" should "advertise the user-friendly name and Media group" in { @@ -76,7 +76,7 @@ class ImageVisualizerOpDescSpec // the nonEmpty assert, whose message must end with the standard // "cannot be empty" phrase. opDesc.binaryContent = "" - val ex = expectError[AssertionError]("cannot be empty")(opDesc.createBinaryData()) + expectError[AssertionError]("cannot be empty")(opDesc.createBinaryData()) } it should "render the configured binary content column in createBinaryData" in { diff --git a/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/ScatterMatrixChart/ScatterMatrixChartOpDescSpec.scala b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/ScatterMatrixChart/ScatterMatrixChartOpDescSpec.scala index 747f3586766..4a0947d6419 100644 --- a/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/ScatterMatrixChart/ScatterMatrixChartOpDescSpec.scala +++ b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/ScatterMatrixChart/ScatterMatrixChartOpDescSpec.scala @@ -37,12 +37,12 @@ class ScatterMatrixChartOpDescSpec it should "throw AssertionError with a 'cannot be empty' message when selected attributes are left at their default" in { // selectedAttributes now defaults to List() and the assert is null-safe, // so an unconfigured operator hits the assert (never an NPE). - val ex = expectError[AssertionError]("cannot be empty")(opDesc.createPlotlyFigure()) + expectError[AssertionError]("cannot be empty")(opDesc.createPlotlyFigure()) } it should "throw AssertionError with a 'cannot be empty' message when selected attributes list is explicitly empty" in { opDesc.selectedAttributes = List() - val ex = expectError[AssertionError]("cannot be empty")(opDesc.createPlotlyFigure()) + expectError[AssertionError]("cannot be empty")(opDesc.createPlotlyFigure()) } it should "render selected attributes and the color column when configured" in { diff --git a/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/continuousErrorBands/ContinuousErrorBandsOpDescSpec.scala b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/continuousErrorBands/ContinuousErrorBandsOpDescSpec.scala index 1d0a9c01be4..ece05032717 100644 --- a/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/continuousErrorBands/ContinuousErrorBandsOpDescSpec.scala +++ b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/continuousErrorBands/ContinuousErrorBandsOpDescSpec.scala @@ -51,12 +51,11 @@ class ContinuousErrorBandsOpDescSpec } it should "throw an AssertionError (not a NullPointerException) when bands is left empty (createPlotlyFigure)" in { - val ex = expectError[AssertionError]("Bands cannot be empty")(opDesc.createPlotlyFigure()) - ex shouldBe a[AssertionError] + expectError[AssertionError]("Bands cannot be empty")(opDesc.createPlotlyFigure()) } it should "throw an AssertionError naming the Bands when generating python code with an empty bands list" in { - val ex = expectError[AssertionError]("Bands cannot be empty")(opDesc.generatePythonCode()) + expectError[AssertionError]("Bands cannot be empty")(opDesc.generatePythonCode()) } it should "render the configured band columns when the bands list is set" in { diff --git a/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/figureFactoryTable/FigureFactoryTableOpDescSpec.scala b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/figureFactoryTable/FigureFactoryTableOpDescSpec.scala index 1d1123ee6c5..8b9e7d60926 100644 --- a/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/figureFactoryTable/FigureFactoryTableOpDescSpec.scala +++ b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/figureFactoryTable/FigureFactoryTableOpDescSpec.scala @@ -50,26 +50,23 @@ class FigureFactoryTableOpDescSpec opDesc.columns = List(column("col_one"), column("col_two")) it should "throw AssertionError with a 'cannot be empty' message when columns list is empty (manipulateTable)" in { - val ex = expectError[AssertionError]("cannot be empty")(opDesc.manipulateTable()) + expectError[AssertionError]("cannot be empty")(opDesc.manipulateTable()) } it should "throw AssertionError with a 'cannot be empty' message when columns list is empty (createFigureFactoryTablePlotlyFigure)" in { - val ex = - expectError[AssertionError]("cannot be empty")(opDesc.createFigureFactoryTablePlotlyFigure()) + expectError[AssertionError]("cannot be empty")(opDesc.createFigureFactoryTablePlotlyFigure()) } it should "throw AssertionError mentioning 'at least 30' when rowHeight is below 30" in { withColumns() opDesc.rowHeight = 10.0 - val ex = - expectError[AssertionError]("at least 30")(opDesc.createFigureFactoryTablePlotlyFigure()) + expectError[AssertionError]("at least 30")(opDesc.createFigureFactoryTablePlotlyFigure()) } it should "throw AssertionError mentioning 'non-negative' when fontSize is negative" in { withColumns() opDesc.fontSize = -1.0 - val ex = - expectError[AssertionError]("non-negative")(opDesc.createFigureFactoryTablePlotlyFigure()) + expectError[AssertionError]("non-negative")(opDesc.createFigureFactoryTablePlotlyFigure()) } it should "not throw with default fontSize (12) and rowHeight (30) once columns are set" in { diff --git a/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/histogram/HistogramChartOpDescSpec.scala b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/histogram/HistogramChartOpDescSpec.scala index c17d4785c0b..d73ab8bccdf 100644 --- a/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/histogram/HistogramChartOpDescSpec.scala +++ b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/histogram/HistogramChartOpDescSpec.scala @@ -45,7 +45,7 @@ class HistogramChartOpDescSpec } it should "throw AssertionError with a non-blank message via generatePythonCode when value is empty" in { - val ex = expectError[AssertionError]("cannot be empty")(opDesc.generatePythonCode()) + expectError[AssertionError]("cannot be empty")(opDesc.generatePythonCode()) } it should "render the figure with the configured value column when value is set" in { diff --git a/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/htmlviz/HtmlVizOpExecSpec.scala b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/htmlviz/HtmlVizOpExecSpec.scala index 078b19b426f..3921b6f4cf8 100644 --- a/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/htmlviz/HtmlVizOpExecSpec.scala +++ b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/htmlviz/HtmlVizOpExecSpec.scala @@ -22,9 +22,8 @@ package org.apache.texera.amber.operator.visualization.htmlviz import org.apache.texera.amber.core.tuple._ import org.apache.texera.amber.core.workflow.PortIdentity import org.apache.texera.amber.util.JSONUtils.objectMapper -import org.scalatest.BeforeAndAfter import org.scalatest.flatspec.AnyFlatSpec -class HtmlVizOpExecSpec extends AnyFlatSpec with BeforeAndAfter { +class HtmlVizOpExecSpec extends AnyFlatSpec { val schema = new Schema( new Attribute("field1", AttributeType.STRING), new Attribute("field2", AttributeType.STRING) diff --git a/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/nestedTable/NestedTableOpDescSpec.scala b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/nestedTable/NestedTableOpDescSpec.scala index b0530dc8208..15f8f27c293 100644 --- a/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/nestedTable/NestedTableOpDescSpec.scala +++ b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/nestedTable/NestedTableOpDescSpec.scala @@ -49,9 +49,7 @@ class NestedTableOpDescSpec } it should "throw an AssertionError (not a NullPointerException) when includedColumns is left empty" in { - val ex = - expectError[AssertionError]("Included Columns cannot be empty")(opDesc.generatePythonCode()) - ex shouldBe a[AssertionError] + expectError[AssertionError]("Included Columns cannot be empty")(opDesc.generatePythonCode()) } it should "generate python code carrying the configured columns when includedColumns is set" in { diff --git a/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/tablesChart/TablesPlotOpDescSpec.scala b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/tablesChart/TablesPlotOpDescSpec.scala index 492880d7c94..e2474cc07bb 100644 --- a/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/tablesChart/TablesPlotOpDescSpec.scala +++ b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/tablesChart/TablesPlotOpDescSpec.scala @@ -47,11 +47,11 @@ class TablesPlotOpDescSpec } it should "throw AssertionError with a 'cannot be empty' message when included columns list is empty (manipulateTable)" in { - val ex = expectError[AssertionError]("cannot be empty")(opDesc.manipulateTable()) + expectError[AssertionError]("cannot be empty")(opDesc.manipulateTable()) } it should "throw AssertionError with a 'cannot be empty' message when included columns list is empty (createPlotlyFigure)" in { - val ex = expectError[AssertionError]("cannot be empty")(opDesc.createPlotlyFigure()) + expectError[AssertionError]("cannot be empty")(opDesc.createPlotlyFigure()) } it should "render the configured columns when the included columns list is set" in { diff --git a/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/ternaryContour/TernaryContourOpDescSpec.scala b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/ternaryContour/TernaryContourOpDescSpec.scala index 7409b4c757d..6e6c3357c1d 100644 --- a/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/ternaryContour/TernaryContourOpDescSpec.scala +++ b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/ternaryContour/TernaryContourOpDescSpec.scala @@ -35,7 +35,7 @@ class TernaryContourOpDescSpec } it should "throw AssertionError with a 'cannot be empty' message when all variables are empty" in { - val ex = expectError[AssertionError]("cannot be empty")(opDesc.manipulateTable()) + expectError[AssertionError]("cannot be empty")(opDesc.manipulateTable()) } // The compound assert over the four variables is split per-field; diff --git a/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/ternaryPlot/TernaryPlotOpDescSpec.scala b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/ternaryPlot/TernaryPlotOpDescSpec.scala index 68a396cc119..d544e6d7469 100644 --- a/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/ternaryPlot/TernaryPlotOpDescSpec.scala +++ b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/ternaryPlot/TernaryPlotOpDescSpec.scala @@ -35,7 +35,7 @@ class TernaryPlotOpDescSpec } it should "throw AssertionError with a 'cannot be empty' message when all variables are empty" in { - val ex = expectError[AssertionError]("cannot be empty")(opDesc.manipulateTable()) + expectError[AssertionError]("cannot be empty")(opDesc.manipulateTable()) } // The compound assert over the three variables is being split per-field; diff --git a/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/waterfallChart/WaterfallChartOpDescSpec.scala b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/waterfallChart/WaterfallChartOpDescSpec.scala index 50d88ceeb85..d93393508f5 100644 --- a/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/waterfallChart/WaterfallChartOpDescSpec.scala +++ b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/waterfallChart/WaterfallChartOpDescSpec.scala @@ -48,15 +48,12 @@ class WaterfallChartOpDescSpec } it should "throw an AssertionError (not a NullPointerException) naming the X Axis when xColumn is left empty" in { - val ex = - expectError[AssertionError]("X Axis Values cannot be empty")(opDesc.createPlotlyFigure()) - ex shouldBe a[AssertionError] + expectError[AssertionError]("X Axis Values cannot be empty")(opDesc.createPlotlyFigure()) } it should "throw an AssertionError naming the Y Axis when only xColumn is set" in { opDesc.xColumn = "x_col" - val ex = - expectError[AssertionError]("Y Axis Values cannot be empty")(opDesc.createPlotlyFigure()) + expectError[AssertionError]("Y Axis Values cannot be empty")(opDesc.createPlotlyFigure()) } it should "render the configured x and y columns when both are set" in { diff --git a/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/windRoseChart/WindRoseChartOpDescSpec.scala b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/windRoseChart/WindRoseChartOpDescSpec.scala index 118bdff80df..17a8c8dd2c4 100644 --- a/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/windRoseChart/WindRoseChartOpDescSpec.scala +++ b/common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/visualization/windRoseChart/WindRoseChartOpDescSpec.scala @@ -45,15 +45,14 @@ class WindRoseChartOpDescSpec } it should "throw an AssertionError (not a NullPointerException) naming the Radial column when rColumn is empty" in { - val ex = expectError[AssertionError]("Radial Values (r) column must be selected.")( + expectError[AssertionError]("Radial Values (r) column must be selected.")( opDesc.createPlotlyFigure() ) - ex shouldBe a[AssertionError] } it should "throw an AssertionError naming the Angular column when only rColumn is set" in { opDesc.rColumn = "r_col" - val ex = expectError[AssertionError]("Angular Values (θ) column must be selected.")( + expectError[AssertionError]("Angular Values (θ) column must be selected.")( opDesc.createPlotlyFigure() ) }