From 97c9f50c6b360fb238dfb535a64c0f86c92dc4f1 Mon Sep 17 00:00:00 2001 From: Marcin Kuthan Date: Sat, 23 Sep 2023 08:42:59 +0200 Subject: [PATCH] Scalafix (#106) * configure scalafix plugin * Configure scalafix * Fix build * Apply scalafix --- .github/workflows/ci.yml | 10 ++++++- .scalafix.conf | 7 +++++ build.sbt | 2 +- project/Settings.scala | 14 ++++++--- project/plugins.sbt | 2 ++ .../infrastructure/pubsub/PubsubParams.scala | 4 +-- .../IntegrationTestFixtures.scala | 16 +++++----- .../common/IoDiagnosticTest.scala | 12 ++++---- .../VehiclesWithExpiredRegistration.scala | 5 ---- .../domain/booth/TollBoothEntryFixture.scala | 13 ++++---- .../domain/booth/TollBoothExitFixture.scala | 10 +++---- .../domain/booth/TollBoothStatsFixture.scala | 4 +-- .../VehicleRegistrationFixture.scala | 19 ++++++------ .../vehicle/TotalVehicleTimeFixture.scala | 4 +-- ...hiclesWithExpiredRegistrationFixture.scala | 30 ++++++++++++------- 15 files changed, 90 insertions(+), 62 deletions(-) create mode 100644 .scalafix.conf diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 384e4ba2..bdf264e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,9 +24,17 @@ jobs: with: name: scapegoat-report path: '**/scapegoat-report/*.html' - + + scalafix: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup + - run: sbt "scalafixAll --check" + test: runs-on: ubuntu-latest + needs: [scalafmt, scapegoat, scalafix] steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup diff --git a/.scalafix.conf b/.scalafix.conf new file mode 100644 index 00000000..40e14b27 --- /dev/null +++ b/.scalafix.conf @@ -0,0 +1,7 @@ +rules = [ + ExplicitResultTypes + LeakingImplicitClassVal + ProcedureSyntax + RedundantSyntax + RemoveUnused +] diff --git a/build.sbt b/build.sbt index 77ea0983..818735ad 100644 --- a/build.sbt +++ b/build.sbt @@ -3,7 +3,7 @@ import sbt._ import Dependencies._ import Settings._ -addCommandAlias("check", "clean; scalafmtAll; scapegoat; testOnly -- -l org.scalatest.tags.Slow") +addCommandAlias("check", "clean; scalafixAll; scalafmtAll; scapegoat; testOnly -- -l org.scalatest.tags.Slow") lazy val root = (project in file(".")) .settings( diff --git a/project/Settings.scala b/project/Settings.scala index 6da32ae6..ea07fcaa 100644 --- a/project/Settings.scala +++ b/project/Settings.scala @@ -1,10 +1,12 @@ -import sbt.* -import sbt.nio.Keys.* -import sbt.Keys.* +import sbt._ +import sbt.nio.Keys.onChangedBuildSource +import sbt.nio.Keys.ReloadOnSourceChanges +import sbt.Keys._ import com.github.sbt.jacoco.JacocoKeys.jacocoReportSettings import com.github.sbt.jacoco.JacocoKeys.JacocoReportFormats import com.github.sbt.jacoco.JacocoPlugin.autoImport.JacocoReportSettings +import scalafix.sbt.ScalafixPlugin.autoImport._ object Settings { val commonSettings = Seq( @@ -39,6 +41,10 @@ object Settings { excludeDependencies += "commons-logging" % "commons-logging", // enable XML report for codecov jacocoReportSettings := JacocoReportSettings() - .withFormats(JacocoReportFormats.XML, JacocoReportFormats.HTML) + .withFormats(JacocoReportFormats.XML, JacocoReportFormats.HTML), + // scalafix + ThisBuild / semanticdbEnabled := true, + ThisBuild / semanticdbVersion := scalafixSemanticdb.revision, + ThisBuild / scalafixScalaBinaryVersion := CrossVersion.binaryScalaVersion(scalaVersion.value) ) } diff --git a/project/plugins.sbt b/project/plugins.sbt index faf886c3..0f0beb0b 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -5,3 +5,5 @@ addSbtPlugin("com.github.sbt" % "sbt-jacoco" % "3.4.0") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") // code analysis addSbtPlugin("com.sksamuel.scapegoat" %% "sbt-scapegoat" % "1.2.1") +// automated code changes +addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.11.1") diff --git a/stream-processing-infrastructure/src/main/scala/org/mkuthan/streamprocessing/infrastructure/pubsub/PubsubParams.scala b/stream-processing-infrastructure/src/main/scala/org/mkuthan/streamprocessing/infrastructure/pubsub/PubsubParams.scala index f7f7d0d5..759171e4 100644 --- a/stream-processing-infrastructure/src/main/scala/org/mkuthan/streamprocessing/infrastructure/pubsub/PubsubParams.scala +++ b/stream-processing-infrastructure/src/main/scala/org/mkuthan/streamprocessing/infrastructure/pubsub/PubsubParams.scala @@ -63,7 +63,7 @@ case class MaxBatchBytesSize(value: Int) extends PubsubWriteParam { } object MaxBatchBytesSize { - val HighThroughput = MaxBatchBytesSize(8 * 1024 * 1024) + val HighThroughput: MaxBatchBytesSize = MaxBatchBytesSize(8 * 1024 * 1024) } case class MaxBatchSize(value: Int) extends PubsubWriteParam { @@ -74,5 +74,5 @@ case class MaxBatchSize(value: Int) extends PubsubWriteParam { } object MaxBatchSize { - val HighThroughput = MaxBatchSize(1000) + val HighThroughput: MaxBatchSize = MaxBatchSize(1000) } diff --git a/stream-processing-infrastructure/src/test/scala/org/mkuthan/streamprocessing/infrastructure/IntegrationTestFixtures.scala b/stream-processing-infrastructure/src/test/scala/org/mkuthan/streamprocessing/infrastructure/IntegrationTestFixtures.scala index 91d371bf..0813dcad 100644 --- a/stream-processing-infrastructure/src/test/scala/org/mkuthan/streamprocessing/infrastructure/IntegrationTestFixtures.scala +++ b/stream-processing-infrastructure/src/test/scala/org/mkuthan/streamprocessing/infrastructure/IntegrationTestFixtures.scala @@ -32,10 +32,10 @@ trait IntegrationTestFixtures extends JodaTimeArbitrary { ) } - val SampleClassBigQueryType = BigQueryType[SampleClass] + val SampleClassBigQueryType: BigQueryType[SampleClass] = BigQueryType[SampleClass] val SampleClassBigQuerySchema = SampleClassBigQueryType.schema - val SampleObject1 = SampleClass( + val SampleObject1: SampleClass = SampleClass( stringField = "complex 1", optionalStringField = Some("complex 1"), intField = 1, @@ -44,9 +44,9 @@ trait IntegrationTestFixtures extends JodaTimeArbitrary { localDateField = LocalDate.parse("2014-09-10") ) - val SampleJson1 = JsonSerde.writeJsonAsBytes(SampleObject1) + val SampleJson1: Array[Byte] = JsonSerde.writeJsonAsBytes(SampleObject1) - val SampleObject2 = SampleClass( + val SampleObject2: SampleClass = SampleClass( stringField = "complex 2", optionalStringField = None, intField = 2, @@ -55,12 +55,12 @@ trait IntegrationTestFixtures extends JodaTimeArbitrary { localDateField = LocalDate.parse("2014-09-10") ) - val SampleJson2 = JsonSerde.writeJsonAsBytes(SampleObject2) + val SampleJson2: Array[Byte] = JsonSerde.writeJsonAsBytes(SampleObject2) - val InvalidJson = "invalid json".getBytes(StandardCharsets.UTF_8) + val InvalidJson: Array[Byte] = "invalid json".getBytes(StandardCharsets.UTF_8) - val SampleMap1 = Map("key1" -> "value1") - val SampleMap2 = Map("key2" -> "value2") + val SampleMap1: Map[String, String] = Map("key1" -> "value1") + val SampleMap2: Map[String, String] = Map("key2" -> "value2") } object IntegrationTestFixtures { diff --git a/stream-processing-infrastructure/src/test/scala/org/mkuthan/streamprocessing/infrastructure/common/IoDiagnosticTest.scala b/stream-processing-infrastructure/src/test/scala/org/mkuthan/streamprocessing/infrastructure/common/IoDiagnosticTest.scala index cd710d83..c00d7a3b 100644 --- a/stream-processing-infrastructure/src/test/scala/org/mkuthan/streamprocessing/infrastructure/common/IoDiagnosticTest.scala +++ b/stream-processing-infrastructure/src/test/scala/org/mkuthan/streamprocessing/infrastructure/common/IoDiagnosticTest.scala @@ -30,19 +30,19 @@ class IoDiagnosticTest extends AnyFlatSpec with Matchers with IntegrationTestScioContext with BigQueryContext { - val ioDiagnosticType = BigQueryType[IoDiagnostic.Record] + val ioDiagnosticType: BigQueryType[IoDiagnostic.Record] = BigQueryType[IoDiagnostic.Record] - val anyIoDiagnostic = IoDiagnostic( + val anyIoDiagnostic: IoDiagnostic = IoDiagnostic( id = "any-id", reason = "any reason" ) - val ioDiagnostic1 = anyIoDiagnostic.copy(id = "id1") - val ioDiagnostic2 = anyIoDiagnostic.copy(id = "id2") + val ioDiagnostic1: IoDiagnostic = anyIoDiagnostic.copy(id = "id1") + val ioDiagnostic2: IoDiagnostic = anyIoDiagnostic.copy(id = "id2") - val tenMinutes = Duration.standardMinutes(10) + val tenMinutes: Duration = Duration.standardMinutes(10) - val windowOptions = WindowOptions( + val windowOptions: WindowOptions = WindowOptions( trigger = Repeatedly.forever(AfterWatermark.pastEndOfWindow()), allowedLateness = Duration.ZERO, accumulationMode = AccumulationMode.DISCARDING_FIRED_PANES, diff --git a/toll-domain/src/main/scala/org/mkuthan/streamprocessing/toll/domain/vehicle/VehiclesWithExpiredRegistration.scala b/toll-domain/src/main/scala/org/mkuthan/streamprocessing/toll/domain/vehicle/VehiclesWithExpiredRegistration.scala index e086d968..c81e5174 100644 --- a/toll-domain/src/main/scala/org/mkuthan/streamprocessing/toll/domain/vehicle/VehiclesWithExpiredRegistration.scala +++ b/toll-domain/src/main/scala/org/mkuthan/streamprocessing/toll/domain/vehicle/VehiclesWithExpiredRegistration.scala @@ -1,10 +1,5 @@ package org.mkuthan.streamprocessing.toll.domain.vehicle -import org.apache.beam.sdk.transforms.windowing.AfterWatermark -import org.apache.beam.sdk.transforms.windowing.Repeatedly -import org.apache.beam.sdk.transforms.windowing.Window -import org.apache.beam.sdk.values.WindowingStrategy.AccumulationMode - import com.spotify.scio.bigquery.types.BigQueryType import com.spotify.scio.values.SCollection import com.spotify.scio.values.WindowOptions diff --git a/toll-domain/src/test/scala/org/mkuthan/streamprocessing/toll/domain/booth/TollBoothEntryFixture.scala b/toll-domain/src/test/scala/org/mkuthan/streamprocessing/toll/domain/booth/TollBoothEntryFixture.scala index 2380811e..3a3f6eab 100644 --- a/toll-domain/src/test/scala/org/mkuthan/streamprocessing/toll/domain/booth/TollBoothEntryFixture.scala +++ b/toll-domain/src/test/scala/org/mkuthan/streamprocessing/toll/domain/booth/TollBoothEntryFixture.scala @@ -7,7 +7,7 @@ import org.mkuthan.streamprocessing.toll.domain.common.LicensePlate trait TollBoothEntryFixture { - final val anyTollBoothEntryPayload = TollBoothEntry.Payload( + final val anyTollBoothEntryPayload: TollBoothEntry.Payload = TollBoothEntry.Payload( id = "1", entry_time = "2014-09-10T12:01:00Z", license_plate = "JNB 7001", @@ -20,16 +20,17 @@ trait TollBoothEntryFixture { tag = "String" ) - final val tollBoothEntryPayloadInvalid = anyTollBoothEntryPayload.copy(id = "") + final val tollBoothEntryPayloadInvalid: TollBoothEntry.Payload = anyTollBoothEntryPayload.copy(id = "") - final val tollBoothEntryDecodingError = DeadLetter[TollBoothEntry.Payload]( + final val tollBoothEntryDecodingError: DeadLetter[TollBoothEntry.Payload] = DeadLetter[TollBoothEntry.Payload]( data = tollBoothEntryPayloadInvalid, error = "requirement failed: Toll booth id is empty" ) - final val tollBoothEntryPayloadWithoutExit = anyTollBoothEntryPayload.copy(license_plate = "other license plate") + final val tollBoothEntryPayloadWithoutExit: TollBoothEntry.Payload = + anyTollBoothEntryPayload.copy(license_plate = "other license plate") - final val anyTollBoothEntryRecord = TollBoothEntry.Record( + final val anyTollBoothEntryRecord: TollBoothEntry.Record = TollBoothEntry.Record( id = anyTollBoothEntryPayload.id, entry_time = Instant.parse(anyTollBoothEntryPayload.entry_time), license_plate = anyTollBoothEntryPayload.license_plate, @@ -42,7 +43,7 @@ trait TollBoothEntryFixture { tag = anyTollBoothEntryPayload.tag ) - final val anyTollBoothEntry = TollBoothEntry( + final val anyTollBoothEntry: TollBoothEntry = TollBoothEntry( id = TollBoothId(anyTollBoothEntryPayload.id), entryTime = Instant.parse(anyTollBoothEntryPayload.entry_time), toll = BigDecimal(anyTollBoothEntryPayload.toll), diff --git a/toll-domain/src/test/scala/org/mkuthan/streamprocessing/toll/domain/booth/TollBoothExitFixture.scala b/toll-domain/src/test/scala/org/mkuthan/streamprocessing/toll/domain/booth/TollBoothExitFixture.scala index 96e4b113..f65d3a3f 100644 --- a/toll-domain/src/test/scala/org/mkuthan/streamprocessing/toll/domain/booth/TollBoothExitFixture.scala +++ b/toll-domain/src/test/scala/org/mkuthan/streamprocessing/toll/domain/booth/TollBoothExitFixture.scala @@ -7,26 +7,26 @@ import org.mkuthan.streamprocessing.toll.domain.common.LicensePlate trait TollBoothExitFixture { - final val anyTollBoothExitPayload = TollBoothExit.Payload( + final val anyTollBoothExitPayload: TollBoothExit.Payload = TollBoothExit.Payload( id = "1", exit_time = "2014-09-10T12:03:00Z", license_plate = "JNB 7001" ) - final val tollBoothExitPayloadInvalid = anyTollBoothExitPayload.copy(id = "") + final val tollBoothExitPayloadInvalid: TollBoothExit.Payload = anyTollBoothExitPayload.copy(id = "") - final val tollBoothExitDecodingError = DeadLetter[TollBoothExit.Payload]( + final val tollBoothExitDecodingError: DeadLetter[TollBoothExit.Payload] = DeadLetter[TollBoothExit.Payload]( data = tollBoothExitPayloadInvalid, error = "requirement failed: Toll booth id is empty" ) - final val anyTollBoothExitRecord = TollBoothExit.Record( + final val anyTollBoothExitRecord: TollBoothExit.Record = TollBoothExit.Record( id = anyTollBoothExitPayload.id, exit_time = Instant.parse(anyTollBoothExitPayload.exit_time), license_plate = anyTollBoothExitPayload.license_plate ) - final val anyTollBoothExit = TollBoothExit( + final val anyTollBoothExit: TollBoothExit = TollBoothExit( id = TollBoothId(anyTollBoothExitPayload.id), exitTime = Instant.parse(anyTollBoothExitPayload.exit_time), licensePlate = LicensePlate(anyTollBoothExitPayload.license_plate) diff --git a/toll-domain/src/test/scala/org/mkuthan/streamprocessing/toll/domain/booth/TollBoothStatsFixture.scala b/toll-domain/src/test/scala/org/mkuthan/streamprocessing/toll/domain/booth/TollBoothStatsFixture.scala index a077f33a..f0e04005 100644 --- a/toll-domain/src/test/scala/org/mkuthan/streamprocessing/toll/domain/booth/TollBoothStatsFixture.scala +++ b/toll-domain/src/test/scala/org/mkuthan/streamprocessing/toll/domain/booth/TollBoothStatsFixture.scala @@ -4,7 +4,7 @@ import org.joda.time.Instant trait TollBoothStatsFixture { - final val anyTollBoothStats = TollBoothStats( + final val anyTollBoothStats: TollBoothStats = TollBoothStats( id = TollBoothId("1"), totalToll = BigDecimal(7), count = 1, @@ -12,7 +12,7 @@ trait TollBoothStatsFixture { lastEntryTime = Instant.parse("2014-09-10T12:01:00.000Z") ) - final val anyTollBoothStatsRecord = TollBoothStats.Record( + final val anyTollBoothStatsRecord: TollBoothStats.Record = TollBoothStats.Record( created_at = Instant.EPOCH, id = anyTollBoothStats.id.id, total_toll = anyTollBoothStats.totalToll, diff --git a/toll-domain/src/test/scala/org/mkuthan/streamprocessing/toll/domain/registration/VehicleRegistrationFixture.scala b/toll-domain/src/test/scala/org/mkuthan/streamprocessing/toll/domain/registration/VehicleRegistrationFixture.scala index 7edad7d5..df4ab972 100644 --- a/toll-domain/src/test/scala/org/mkuthan/streamprocessing/toll/domain/registration/VehicleRegistrationFixture.scala +++ b/toll-domain/src/test/scala/org/mkuthan/streamprocessing/toll/domain/registration/VehicleRegistrationFixture.scala @@ -12,7 +12,7 @@ trait VehicleRegistrationFixture { private final val defaultLicensePlate = "JNB 7001" private final val defaultExpired = "1" - final val anyVehicleRegistrationMessage = Message( + final val anyVehicleRegistrationMessage: Message[VehicleRegistration.Payload] = Message( VehicleRegistration.Payload( id = "1", license_plate = defaultLicensePlate, @@ -21,30 +21,31 @@ trait VehicleRegistrationFixture { Map(VehicleRegistration.TimestampAttribute -> messageTimestamp) ) - final val vehicleRegistrationMessageInvalid = Message( + final val vehicleRegistrationMessageInvalid: Message[VehicleRegistration.Payload] = Message( anyVehicleRegistrationMessage.payload.copy(license_plate = ""), anyVehicleRegistrationMessage.attributes ) - final val vehicleRegistrationDecodingError = DeadLetter[VehicleRegistration.Payload]( - data = vehicleRegistrationMessageInvalid.payload, - error = "requirement failed: Licence plate number is empty" - ) + final val vehicleRegistrationDecodingError: DeadLetter[VehicleRegistration.Payload] = + DeadLetter[VehicleRegistration.Payload]( + data = vehicleRegistrationMessageInvalid.payload, + error = "requirement failed: Licence plate number is empty" + ) - final val anyVehicleRegistrationRecord = VehicleRegistration.Record( + final val anyVehicleRegistrationRecord: VehicleRegistration.Record = VehicleRegistration.Record( id = "2", license_plate = defaultLicensePlate, expired = defaultExpired.toInt ) - final val anyVehicleRegistrationUpdate = VehicleRegistration( + final val anyVehicleRegistrationUpdate: VehicleRegistration = VehicleRegistration( id = VehicleRegistrationId(anyVehicleRegistrationMessage.payload.id), registrationTime = Instant.parse("2014-09-10T11:59:00Z"), // before toll booth entry licensePlate = LicensePlate(defaultLicensePlate), expired = defaultExpired == "1" ) - final val anyVehicleRegistrationHistory = VehicleRegistration( + final val anyVehicleRegistrationHistory: VehicleRegistration = VehicleRegistration( id = VehicleRegistrationId(anyVehicleRegistrationRecord.id), registrationTime = Instant.parse("2014-09-09T00:00:00.000Z"), // the previous day licensePlate = LicensePlate(defaultLicensePlate), diff --git a/toll-domain/src/test/scala/org/mkuthan/streamprocessing/toll/domain/vehicle/TotalVehicleTimeFixture.scala b/toll-domain/src/test/scala/org/mkuthan/streamprocessing/toll/domain/vehicle/TotalVehicleTimeFixture.scala index e8a36323..e37fcb62 100644 --- a/toll-domain/src/test/scala/org/mkuthan/streamprocessing/toll/domain/vehicle/TotalVehicleTimeFixture.scala +++ b/toll-domain/src/test/scala/org/mkuthan/streamprocessing/toll/domain/vehicle/TotalVehicleTimeFixture.scala @@ -8,7 +8,7 @@ import org.mkuthan.streamprocessing.toll.domain.common.LicensePlate trait TotalVehicleTimeFixture { - final val anyTotalVehicleTime = TotalVehicleTime( + final val anyTotalVehicleTime: TotalVehicleTime = TotalVehicleTime( tollBoothId = TollBoothId("1"), licensePlate = LicensePlate("JNB 7001"), entryTime = Instant.parse("2014-09-10T12:01:00.000Z"), @@ -16,7 +16,7 @@ trait TotalVehicleTimeFixture { duration = Duration.standardSeconds(120) ) - final val anyTotalVehicleTimeRecord = TotalVehicleTime.Record( + final val anyTotalVehicleTimeRecord: TotalVehicleTime.Record = TotalVehicleTime.Record( created_at = Instant.EPOCH, toll_booth_id = anyTotalVehicleTime.tollBoothId.id, license_plate = anyTotalVehicleTime.licensePlate.number, diff --git a/toll-domain/src/test/scala/org/mkuthan/streamprocessing/toll/domain/vehicle/VehiclesWithExpiredRegistrationFixture.scala b/toll-domain/src/test/scala/org/mkuthan/streamprocessing/toll/domain/vehicle/VehiclesWithExpiredRegistrationFixture.scala index 91756e0e..0a3900a0 100644 --- a/toll-domain/src/test/scala/org/mkuthan/streamprocessing/toll/domain/vehicle/VehiclesWithExpiredRegistrationFixture.scala +++ b/toll-domain/src/test/scala/org/mkuthan/streamprocessing/toll/domain/vehicle/VehiclesWithExpiredRegistrationFixture.scala @@ -14,14 +14,17 @@ trait VehiclesWithExpiredRegistrationFixture { private val defaultEntryTime = "2014-09-10T12:01:00.000Z" final def anyVehicleWithExpiredRegistration(id: VehicleRegistrationId = - VehicleRegistrationId(defaultRegistrationId)) = VehiclesWithExpiredRegistration( + VehicleRegistrationId(defaultRegistrationId)): VehiclesWithExpiredRegistration = VehiclesWithExpiredRegistration( vehicleRegistrationId = id, licensePlate = LicensePlate(defaultLicencePlate), tollBoothId = TollBoothId(defaultTollBoothId), entryTime = Instant.parse(defaultEntryTime) ) - final def anyVehicleWithExpiredRegistrationRecord(createdAt: Instant, id: String = defaultRegistrationId) = + final def anyVehicleWithExpiredRegistrationRecord( + createdAt: Instant, + id: String = defaultRegistrationId + ): VehiclesWithExpiredRegistration.Record = VehiclesWithExpiredRegistration.Record( created_at = createdAt, vehicle_registration_id = id, @@ -30,7 +33,10 @@ trait VehiclesWithExpiredRegistrationFixture { entry_time = Instant.parse(defaultEntryTime) ) - final def anyVehicleWithExpiredRegistrationMessage(createdAt: Instant, id: String = defaultRegistrationId) = + final def anyVehicleWithExpiredRegistrationMessage( + createdAt: Instant, + id: String = defaultRegistrationId + ): Message[VehiclesWithExpiredRegistration.Payload] = Message( VehiclesWithExpiredRegistration.Payload( created_at = createdAt.toString, @@ -42,13 +48,15 @@ trait VehiclesWithExpiredRegistrationFixture { Map(VehiclesWithExpiredRegistration.TimestampAttribute -> createdAt.toString) ) - final val vehicleWithNotExpiredRegistrationDiagnostic = VehiclesWithExpiredRegistrationDiagnostic( - tollBothId = TollBoothId("1"), - reason = VehiclesWithExpiredRegistrationDiagnostic.NotExpired - ) + final val vehicleWithNotExpiredRegistrationDiagnostic: VehiclesWithExpiredRegistrationDiagnostic = + VehiclesWithExpiredRegistrationDiagnostic( + tollBothId = TollBoothId("1"), + reason = VehiclesWithExpiredRegistrationDiagnostic.NotExpired + ) - final val vehicleWithMissingRegistrationDiagnostic = VehiclesWithExpiredRegistrationDiagnostic( - tollBothId = TollBoothId("1"), - reason = VehiclesWithExpiredRegistrationDiagnostic.MissingRegistration - ) + final val vehicleWithMissingRegistrationDiagnostic: VehiclesWithExpiredRegistrationDiagnostic = + VehiclesWithExpiredRegistrationDiagnostic( + tollBothId = TollBoothId("1"), + reason = VehiclesWithExpiredRegistrationDiagnostic.MissingRegistration + ) }