All Downloads are FREE. Search and download functionalities are using the official Maven repository.

app.cash.backfila.client.misk.testing.InstanceSnapshotAssert.kt Maven / Gradle / Ivy

There is a newer version: 0.1.4-20210806.0204-5341f38
Show newest version
package app.cash.backfila.client.misk.testing

import app.cash.backfila.client.misk.internal.PartitionCursor
import org.assertj.core.api.AbstractAssert

class PartitionCursorAssert(
  private val partitionCursor: PartitionCursor
) : AbstractAssert(partitionCursor, PartitionCursorAssert::class.java) {
  fun isDone(): PartitionCursorAssert {
    if (!partitionCursor.done) {
      failWithMessage(
        "Expected the backfill partition ${partitionCursor.partitionName} " +
          "to be done but it isn't. Cursor $partitionCursor"
      )
    }
    return this // Return the current assertion for method chaining.
  }

  fun isNotDone(): PartitionCursorAssert {
    if (partitionCursor.done) {
      failWithMessage(
        "Expected the backfill partition ${partitionCursor.partitionName} " +
          "to be not done but it is. Cursor $partitionCursor"
      )
    }
    return this // Return the current assertion for method chaining.
  }
}

fun assertThat(partitionCursor: PartitionCursor): PartitionCursorAssert {
  return PartitionCursorAssert(partitionCursor)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy