Skip to content

Instantly share code, notes, and snippets.

@afsalthaj
Last active December 3, 2018 00:06
Show Gist options
  • Save afsalthaj/d97f0747ab4d5c22b31efa40f0ec9305 to your computer and use it in GitHub Desktop.
Save afsalthaj/d97f0747ab4d5c22b31efa40f0ec9305 to your computer and use it in GitHub Desktop.
import org.specs2.data.Tag
import org.specs2.matcher.MatchResult
import org.specs2.scalacheck.ScalaCheckFunction1
import org.specs2.specification.core.SpecStructure
import org.specs2.{ ScalaCheck, Specification }
class IntegrationTest extends Specification with ScalaCheck { self =>
// The test requires external environment. In this case
object DockerComposeTag extends Tag("DockerComposeTag")
def is: SpecStructure =
s2"""Runs an actual kafka cluster, stream engine, and pushes the data continuously $test ${tag(DockerComposeTag)}"""
private def test: ScalaCheckFunction1[String, MatchResult[String]] =
prop { g: String =>
// Call kafka related things. Probably set minTestsOk=10, or a lower number. Property based on an actual environment
// does seem to have an impedence mismatch.But for that reason, we don't need to hardcode sample data for instance.
// Upto you to decide on this. You can just rely on specs2 and not ScalaCheck when you do this test, if you need.
g must_=== g
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment