scalatest-embedinflux


License

License

Categories

Categories

Scala Languages
GroupId

GroupId

com.github.fsanaulla
ArtifactId

ArtifactId

scalatest-embedinflux_2.12
Last Version

Last Version

0.2.3
Release Date

Release Date

Type

Type

jar
Description

Description

scalatest-embedinflux
scalatest-embedinflux
Project URL

Project URL

https://github.com/fsanaulla/scala-embedinflux
Project Organization

Project Organization

com.github.fsanaulla
Source Code Management

Source Code Management

https://github.com/fsanaulla/scala-embedinflux

Download scalatest-embedinflux_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.fsanaulla/scalatest-embedinflux_2.12/ -->
<dependency>
    <groupId>com.github.fsanaulla</groupId>
    <artifactId>scalatest-embedinflux_2.12</artifactId>
    <version>0.2.3</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.fsanaulla/scalatest-embedinflux_2.12/
implementation 'com.github.fsanaulla:scalatest-embedinflux_2.12:0.2.3'
// https://jarcasting.com/artifacts/com.github.fsanaulla/scalatest-embedinflux_2.12/
implementation ("com.github.fsanaulla:scalatest-embedinflux_2.12:0.2.3")
'com.github.fsanaulla:scalatest-embedinflux_2.12:jar:0.2.3'
<dependency org="com.github.fsanaulla" name="scalatest-embedinflux_2.12" rev="0.2.3">
  <artifact name="scalatest-embedinflux_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.fsanaulla', module='scalatest-embedinflux_2.12', version='0.2.3')
)
libraryDependencies += "com.github.fsanaulla" % "scalatest-embedinflux_2.12" % "0.2.3"
[com.github.fsanaulla/scalatest-embedinflux_2.12 "0.2.3"]

Dependencies

compile (6)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.12.8
com.github.fsanaulla : core-testing_2.12 jar 0.2.3
io.apisense.embed.influx : embed-influxDB jar 1.2.0
com.github.fsanaulla : chronicler-url-io_2.12 jar 0.5.4
com.github.fsanaulla : chronicler-udp_2.12 jar 0.5.4
com.github.fsanaulla : chronicler-macros_2.12 jar 0.5.4

provided (1)

Group / Artifact Type Version
org.scalatest : scalatest_2.12 jar 3.0.8

Project Modules

There are no modules declared in this project.

scala-embedinflux

Build Status Codacy Badge Maven Central

About project

Open-source library for ScalaTest and Specs2, for simply embedding InfluxDB in your test. Built on top of embed-influxDB. Inspired by scalatest-embedmongo.

Integration

Add this dependencies to your build.sbt

// Scalatest
libraryDependencies += "com.github.fsanaulla" %% "scalatest-embedinflux" % <version> % Test

// Specs2
libraryDependencies += "com.github.fsanaulla" %% "specs2-embedinflux" % <version> % Test

Usage

Before you start your testing you need to choose, what type of configuration you need. For example if you need to work with HTTP service. Mix your test suite with InfluxHttpConf. For using UDP feature mix suite with InfluxUDPConf. All port configuration can be changed. By overriding appropriate fields.

HTTP

For starting InfluxDB with HTTP service:

// ScalaTest
class InfluxSpec extends FlatSpec with InfluxHTTPConf with EmbeddedInfluxDB {

  // by default `httpPort`: 8086
  // def httpPort: Int = 8086

  // auth is disabled(false)
  // def auth: Boolean = false

  lazy val influx: InfluxDBClient = _

  ... // your tests
}
// Specs2
class InfluxSpec extends mutable.Specification with InfluxHTTPConf with EmbeddedInfluxDB {

  // by default `httpPort`: 8086
  // def httpPort: Int = 8086

  // auth is disabled(false)
  // def auth: Boolean = false

  lazy val influx: InfluxDBClient = _

  ... // your tests
}

UDP

For UDP support in your tests:

// ScalaTest
class InfluxSpec extends FlatSpec with InfluxUDPConf with EmbeddedInfluxDB {

  // by default `httpPort`: 8086
  // def httpPort: Int = 8086

  // by default `udpPort`: 8089
  // def udpPort: Int = 8089

  // default database name `udp`
  // def databse: Boolean = false

  lazy val influx: InfluxDBClient = _

  ... // your tests
}
// Specs2
class InfluxSpec extends mutable.Specification with InfluxUDPConf with EmbeddedInfluxDB {

  // by default `httpPort`: 8086
  // def httpPort: Int = 8086

  // by default `udpPort`: 8089
  // def udpPort: Int = 8089

  // default database name `udp`
  // def databse: Boolean = false

  lazy val influx: InfluxDBClient = _

  ... // your tests
}

Custom

You can define custom configuration by mixin with InfluxConf into your test suite and overriding configuration method. How to properly configure it look here.

Versions

Version
0.2.3
0.2.2
0.2.1
0.2.0
0.1.7
0.1.6
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0