{"id":16600344,"url":"https://github.com/fsanaulla/scala-embedinflux","last_synced_at":"2025-04-15T18:17:44.948Z","repository":{"id":57719817,"uuid":"122725149","full_name":"fsanaulla/scala-embedinflux","owner":"fsanaulla","description":"Embedded InfluxDB for testing","archived":false,"fork":false,"pushed_at":"2019-07-25T10:55:53.000Z","size":108,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-15T18:17:37.879Z","etag":null,"topics":["embedded","influxdb","scala","scalatest","specs2","testing"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fsanaulla.png","metadata":{"files":{"readme":"README.md","changelog":"changelog/0.2.0.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-24T09:28:26.000Z","updated_at":"2019-07-25T10:27:15.000Z","dependencies_parsed_at":"2022-09-13T12:50:23.670Z","dependency_job_id":null,"html_url":"https://github.com/fsanaulla/scala-embedinflux","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsanaulla%2Fscala-embedinflux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsanaulla%2Fscala-embedinflux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsanaulla%2Fscala-embedinflux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsanaulla%2Fscala-embedinflux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fsanaulla","download_url":"https://codeload.github.com/fsanaulla/scala-embedinflux/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249126000,"owners_count":21216705,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embedded","influxdb","scala","scalatest","specs2","testing"],"created_at":"2024-10-12T00:14:12.760Z","updated_at":"2025-04-15T18:17:44.928Z","avatar_url":"https://github.com/fsanaulla.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# scala-embedinflux\n[![Build Status](https://travis-ci.org/fsanaulla/scala-embedinflux.svg?branch=master)](https://travis-ci.org/fsanaulla/scala-embedinflux)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/e9932125a5d2487f901e3170a70f4904)](https://www.codacy.com/app/fsanaulla/scala-embedinflux?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=fsanaulla/scala-embedinflux\u0026amp;utm_campaign=Badge_Grade)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.fsanaulla/core-testing_2.11/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.fsanaulla/core-testing_2.11)\n# About project\nOpen-source library for [ScalaTest](http://www.scalatest.org/) and [Specs2](https://etorreborre.github.io/specs2/), for simply embedding [InfluxDB](https://www.influxdata.com/time-series-platform/influxdb/) in your test.\nBuilt on top of [embed-influxDB](https://github.com/APISENSE/embed-influxDB). \nInspired by [scalatest-embedmongo](https://github.com/SimplyScala/scalatest-embedmongo).\n\n## Integration\nAdd this dependencies to your `build.sbt`\n```\n// Scalatest\nlibraryDependencies += \"com.github.fsanaulla\" %% \"scalatest-embedinflux\" % \u003cversion\u003e % Test\n\n// Specs2\nlibraryDependencies += \"com.github.fsanaulla\" %% \"specs2-embedinflux\" % \u003cversion\u003e % Test\n```\n## Usage\nBefore you start your testing you need to choose, what type of configuration you need. For example if you need to work with [HTTP](https://docs.influxdata.com/influxdb/v1.5/guides/writing_data/) service.\nMix your test suite with `InfluxHttpConf`. For using [UDP](https://github.com/influxdata/influxdb/blob/master/services/udp/README.md) feature mix suite with `InfluxUDPConf`.\nAll port configuration can be changed. By overriding appropriate fields.\n\n### HTTP\nFor starting InfluxDB with HTTP service:\n```\n// ScalaTest\nclass InfluxSpec extends FlatSpec with InfluxHTTPConf with EmbeddedInfluxDB {\n\n  // by default `httpPort`: 8086\n  // def httpPort: Int = 8086\n\n  // auth is disabled(false)\n  // def auth: Boolean = false\n\n  lazy val influx: InfluxDBClient = _\n\n  ... // your tests\n}\n```\n\n```\n// Specs2\nclass InfluxSpec extends mutable.Specification with InfluxHTTPConf with EmbeddedInfluxDB {\n\n  // by default `httpPort`: 8086\n  // def httpPort: Int = 8086\n\n  // auth is disabled(false)\n  // def auth: Boolean = false\n\n  lazy val influx: InfluxDBClient = _\n\n  ... // your tests\n}\n```\n### UDP\n\nFor UDP support in your tests:\n```\n// ScalaTest\nclass InfluxSpec extends FlatSpec with InfluxUDPConf with EmbeddedInfluxDB {\n\n  // by default `httpPort`: 8086\n  // def httpPort: Int = 8086\n\n  // by default `udpPort`: 8089\n  // def udpPort: Int = 8089\n\n  // default database name `udp`\n  // def databse: Boolean = false\n\n  lazy val influx: InfluxDBClient = _\n\n  ... // your tests\n}\n```\n\n```\n// Specs2\nclass InfluxSpec extends mutable.Specification with InfluxUDPConf with EmbeddedInfluxDB {\n\n  // by default `httpPort`: 8086\n  // def httpPort: Int = 8086\n\n  // by default `udpPort`: 8089\n  // def udpPort: Int = 8089\n\n  // default database name `udp`\n  // def databse: Boolean = false\n\n  lazy val influx: InfluxDBClient = _\n\n  ... // your tests\n}\n```\n### Custom\nYou can define custom configuration by mixin with `InfluxConf` into your test suite and overriding `configuration` method.\nHow to properly configure it look [here](https://github.com/APISENSE/embed-influxDB/blob/develop/src/main/java/io/apisense/embed/influx/configuration/InfluxConfigurationWriter.java).\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffsanaulla%2Fscala-embedinflux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffsanaulla%2Fscala-embedinflux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffsanaulla%2Fscala-embedinflux/lists"}