RequestResponsePactForger

pact4s.munit.RequestResponsePactForger

Attributes

Graph
Supertypes

Members list

Concise view

Type members

Inherited classlikes

abstract class Fixture[T](val fixtureName: String)

Attributes

name

The name of this fixture, used for displaying an error message if beforeAll() or afterAll() fail.

Inherited from:
Suite
Graph
Supertypes
class Object
trait Matchable
class Any
class FunFixture[T]

Attributes

Inherited from:
FunFixtures
Graph
Supertypes
class Object
trait Matchable
class Any
object FunFixture

Attributes

Inherited from:
FunFixtures
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
CatsEffectAssertions
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
CatsEffectAssertions
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
CatsEffectAssertions
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
CatsEffectAssertions
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
CatsEffectAssertions
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
CatsEffectFunFixtures
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Inherited from:
CatsEffectFixturesPlatform
Graph
Supertypes
class Object
trait Matchable
class Any
final class SuiteTransform(val name: String, fn: List[Test] => List[Test]) extends List[Test] => List[Test]

Attributes

Inherited from:
SuiteTransforms
Graph
Supertypes
trait List[Test] => List[Test]
class Object
trait Matchable
class Any

Attributes

Inherited from:
CatsEffectFunFixtures
Graph
Supertypes
class Object
trait Matchable
class Any
final class TestTransform(val name: String, fn: Test => Test) extends Test => Test

Attributes

Inherited from:
TestTransforms
Graph
Supertypes
trait Test => Test
class Object
trait Matchable
class Any

Similar to ResourceSuiteLocalFixture, but supported on both JVM and JS via several caveats. Instead of directly providing T provides a (memoized) IO[T] that is backed by a Deferred[T]. It is unsafe because on JS the resource is closed concurrently without backpressure, i.e. the suite will complete even while the resource has not closed yet. On JVM it is semantically equivalent to ResourceSuiteLocalFixture. Note also that constructing this fixture is impure because it unsafely allocates a Deferred.

Similar to ResourceSuiteLocalFixture, but supported on both JVM and JS via several caveats. Instead of directly providing T provides a (memoized) IO[T] that is backed by a Deferred[T]. It is unsafe because on JS the resource is closed concurrently without backpressure, i.e. the suite will complete even while the resource has not closed yet. On JVM it is semantically equivalent to ResourceSuiteLocalFixture. Note also that constructing this fixture is impure because it unsafely allocates a Deferred.

Attributes

Inherited from:
CatsEffectFixtures
Graph
Supertypes
class Object
trait Matchable
class Any
final class ValueTransform(val name: String, fn: PartialFunction[Any, Future[Any]]) extends Any => Option[Future[Any]]

Attributes

Inherited from:
ValueTransforms
Graph
Supertypes
trait Any => Option[Future[Any]]
class Object
trait Matchable
class Any

Types

type Effect[_] = IO[_]

Inherited types

Attributes

Inherited from:
Suite

Attributes

Inherited from:
Suite
final type Test = GenericTest[TestValue]

Attributes

Inherited from:
Suite
final type TestValue = Future[Any]

The value produced by test bodies.

The value produced by test bodies.

Attributes

Inherited from:
FunSuite

Value members

Concrete methods

This effect runs after the consumer pact tests are run, but before they get written to a file.

This effect runs after the consumer pact tests are run, but before they get written to a file.

Attributes

override def munitFixtures: Seq[Fixture[_]]

Functinonal fixtures that can be reused for individual test cases or entire suites.

Functinonal fixtures that can be reused for individual test cases or entire suites.

Attributes

Definition Classes
def pactTest(name: String)(test: BaseMockServer => Any): Unit
override def test(options: TestOptions)(body: => Any)(implicit loc: Location): Unit

Attributes

Definition Classes

Inherited methods

def afterAll(): Unit

Runs once after all test cases and after all suite-local fixtures have been tear down.

Runs once after all test cases and after all suite-local fixtures have been tear down.

Attributes

Inherited from:
Suite

Runs after each individual test case.

Runs after each individual test case.

Attributes

Inherited from:
Suite
def assert(cond: => Boolean, clue: => Any)(implicit loc: Location): Unit

Attributes

Inherited from:
Assertions
def assertEquals[A, B](obtained: A, expected: B, clue: => Any)(implicit loc: Location, ev: B <:< A): Unit

Asserts that two elements are equal using == equality.

Asserts that two elements are equal using == equality.

The "expected" value (second argument) must have the same type or be a subtype of the "obtained" value (first argument). For example:

 assertEquals(Option(1), Some(1)) // OK
 assertEquals(Some(1), Option(1)) // Error: Option[Int] is not a subtype of Some[Int]

Use assertEquals[Any, Any](a, b) as an escape hatch to compare two values of different types. For example:

 val a: Either[List[String], Int] = Right(42)
 val b: Either[String, Int]       = Right(42)
 assertEquals[Any, Any](a, b) // OK
 assertEquals(a, b) // Error: Either[String, Int] is not a subtype of Either[List[String], Int]

Attributes

Inherited from:
() } Diffs.assertNoDiff(Assertions.this.munitPrint(obtained),Assertions.this.munitPrint(expected),Assertions.this.munitComparisonHandler(obtained,expected),Assertions.this.munitPrint(clue),printObtainedAsStripMargin=false)(loc) Diffs.assertNoDiff(obtained.toString(),expected.toString(),Assertions.this.munitComparisonHandler(obtained,expected),Assertions.this.munitPrint(clue),printObtainedAsStripMargin=false)(loc) Assertions.this.failComparison(_root_.scala.StringContext.apply("valuesarenotequaleveniftheyhavethesame`toString()`:","").s(obtained),obtained,expected,Assertions.this.failComparison$default$4)(loc) }else())">Assertions

Asserts that two doubles are equal to within a positive delta. If the expected value is infinity then the delta value is ignored. NaNs are considered equal: assertEquals(Double.NaN, Double.NaN, *) passes.

Asserts that two doubles are equal to within a positive delta. If the expected value is infinity then the delta value is ignored. NaNs are considered equal: assertEquals(Double.NaN, Double.NaN, *) passes.

Attributes

Inherited from:
Assertions

Asserts that two floats are equal to within a positive delta. If the expected value is infinity then the delta value is ignored. NaNs are considered equal: assertEquals(Float.NaN, Float.NaN, *) passes.

Asserts that two floats are equal to within a positive delta. If the expected value is infinity then the delta value is ignored. NaNs are considered equal: assertEquals(Float.NaN, Float.NaN, *) passes.

Attributes

Inherited from:
Assertions
def assertIO[A, B](obtained: IO[A], returns: B, clue: => Any)(implicit loc: Location, ev: B <:< A): IO[Unit]

Asserts that an IO returns an expected value.

Asserts that an IO returns an expected value.

The "returns" value (second argument) must have the same type or be a subtype of the one "contained" inside the IO (first argument). For example:

 assertIO(IO(Option(1)), returns = Some(1)) // OK
 assertIO(IO(Some(1)), returns = Option(1)) // Error: Option[Int] is not a subtype of Some[Int]

The "clue" value can be used to give extra information about the failure in case the assertion fails.

Attributes

clue

a value that will be printed in case the assertions fails

obtained

the IO under testing

returns

the expected value

Inherited from:
CatsEffectAssertions

Attributes

Inherited from:
Assertions
def assertNotEquals[A, B](obtained: A, expected: B, clue: => Any)(implicit loc: Location, ev: A =:= B): Unit

Attributes

Inherited from:
Assertions
def assertSyncIO[A, B](obtained: SyncIO[A], returns: B, clue: => Any)(implicit loc: Location, ev: B <:< A): SyncIO[Unit]

Asserts that a SyncIO returns an expected value.

Asserts that a SyncIO returns an expected value.

The "returns" value (second argument) must have the same type or be a subtype of the one "contained" inside the SyncIO (first argument). For example:

 assertSyncIO(SyncIO(Option(1)), returns = Some(1)) // OK
 assertSyncIO(SyncIO(Some(1)), returns = Option(1)) // Error: Option[Int] is not a subtype of Some[Int]

The "clue" value can be used to give extra information about the failure in case the assertion fails.

Attributes

clue

a value that will be printed in case the assertions fails

obtained

the SyncIO under testing

returns

the expected value

Inherited from:
CatsEffectAssertions
def assume(cond: Boolean, clue: => Any)(implicit loc: Location): Unit

Attributes

Inherited from:
Assertions

Runs once before all test cases and before all suite-local fixtures are setup. An error in this method aborts the test suite.

Runs once before all test cases and before all suite-local fixtures are setup. An error in this method aborts the test suite.

Attributes

Inherited from:
Suite

Runs before each individual test case. An error in this method aborts the test case.

Runs before each individual test case. An error in this method aborts the test case.

Attributes

Inherited from:
Suite
def clue[T](c: Clue[T]): T

Attributes

Inherited from:
Assertions
def clues(clue: Clue[_]*): Clues

Attributes

Inherited from:
Assertions
def fail(message: String, clues: Clues)(implicit loc: Location): Nothing

Attributes

Inherited from:
Assertions
def fail(message: String, cause: Throwable)(implicit loc: Location): Nothing

Attributes

Inherited from:
Assertions
def failComparison(message: String, obtained: Any, expected: Any, clues: Clues)(implicit loc: Location): Nothing

Attributes

Inherited from:
Assertions
def failSuite(message: String, clues: Clues)(implicit loc: Location): Nothing

Attributes

Inherited from:
Assertions
def intercept[T <: Throwable](body: => Any)(implicit T: ClassTag[T], loc: Location): T

Attributes

Inherited from:
Assertions
def interceptIO[T <: Throwable](io: IO[Any])(implicit T: ClassTag[T], loc: Location): IO[T]

Intercepts a Throwable being thrown inside the provided IO.

Intercepts a Throwable being thrown inside the provided IO.

Attributes

Example:
 val io = IO.raiseError[Unit](MyException("BOOM!"))
 interceptIO[MyException](io)

or

 interceptIO[MyException] {
     IO.raiseError[Unit](MyException("BOOM!"))
 }
Inherited from:
CatsEffectAssertions

Attributes

Inherited from:
Assertions

Intercepts a Throwable with a certain message being thrown inside the provided IO.

Intercepts a Throwable with a certain message being thrown inside the provided IO.

Attributes

Example:
 val io = IO.raiseError[Unit](MyException("BOOM!"))
 interceptIO[MyException]("BOOM!")(io)

or

 interceptIO[MyException] {
     IO.raiseError[Unit](MyException("BOOM!"))
 }
Inherited from:
CatsEffectAssertions

Intercepts a Throwable with a certain message being thrown inside the provided SyncIO.

Intercepts a Throwable with a certain message being thrown inside the provided SyncIO.

Attributes

Example:
 val io = SyncIO.raiseError[Unit](MyException("BOOM!"))
 interceptSyncIO[MyException]("BOOM!")(io)

or

 interceptSyncIO[MyException] {
     SyncIO.raiseError[Unit](MyException("BOOM!"))
 }
Inherited from:
CatsEffectAssertions
def interceptSyncIO[T <: Throwable](io: SyncIO[Any])(implicit T: ClassTag[T], loc: Location): SyncIO[T]

Intercepts a Throwable being thrown inside the provided SyncIO.

Intercepts a Throwable being thrown inside the provided SyncIO.

Attributes

Example:
 val io = SyncIO.raiseError[Unit](MyException("BOOM!"))
 interceptSyncIO[MyException](io)

or

 interceptSyncIO[MyException] {
     SyncIO.raiseError[Unit](MyException("BOOM!"))
 }
Inherited from:
CatsEffectAssertions

Attributes

Inherited from:
SuiteTransforms

Attributes

Inherited from:
Assertions
def munitCaptureClues[T](thunk: => T): (T, Clues)

Attributes

Inherited from:
Assertions

Attributes

Inherited from:
TestTransforms

Attributes

Inherited from:
SuiteTransforms
def munitPrint(clue: => Any): String

Attributes

Inherited from:
Assertions

Attributes

Inherited from:
TestTransforms

The base class for all test suites

The base class for all test suites

Attributes

Inherited from:
FunSuite

Attributes

Inherited from:
FunSuite
final def munitValueTransform(testValue: => Any): Future[Any]

Attributes

Inherited from:
ValueTransforms

Attributes

Definition Classes
Inherited from:
CatsEffectSuite
def pact: Pact

Attributes

Inherited from:
BasePactForgerResources
def test(name: String)(body: => Any)(implicit loc: Location): Unit

Attributes

Inherited from:
FunSuite

Inherited fields

Attributes

Inherited from:
Assertions

Attributes

Inherited from:
FunSuite

Implicits

Inherited implicits

Attributes

Inherited from:
CatsEffectSuite

Attributes

Inherited from:
CatsEffectSuite

Implicitly create a TestOptions given a test name. This allows writing test("name") { ... } even if test accepts a TestOptions

Implicitly create a TestOptions given a test name. This allows writing test("name") { ... } even if test accepts a TestOptions

Attributes

Inherited from:
TestOptionsConversions

Attributes

Inherited from:
PactOps