Documentation / Getting started / ebean-test
Related: Trouble Shooting
ebean-test
ebean-test is used to setup and configure Ebean for running tests.
1. Add ebean-test as a test dependency
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>11.44.1</version>
<scope>test</scope>
</dependency>
dependencies {
...
testCompile 'io.ebean:ebean-test:11.44.1'
}
2. Add application-test.yaml
In src/test/resources
add application-test.yaml
configuration file
like the one below.
ebean:
test:
platform: h2 # h2, postgres, mysql, mariadb, oracle, sqlserver, hana, clickhouse, sqlite
ddlMode: dropCreate # none | dropCreate | migration
dbName: my_app
We can change the platform
to any of the supported platforms. Ebean test will automatically
manage a docker test container setting it up to run tests.
Refer to testing platforms for more information.
We most often use dropCreate
DDL mode during development.
Refer to testing DDL mode for more information.