Package io.micronaut.test.annotation
Annotation Interface Sql
@Target(TYPE)
@Retention(RUNTIME)
@Documented
@Inherited
@Repeatable(Sqls.class)
public @interface Sql
Annotation that can be applied to a test scenario to execute SQL against a test database prior to the sceario being run.
- Since:
- 4.1.0
- Author:
- Tim Yates
-
Element Details
-
value
- Returns:
- The SQL scripts to execute
- Default:
- {}
-
dataSourceName
String dataSourceNameThe name of the datasource to use for the SQL scripts.- Returns:
- The datasource name
- Default:
- "default"
-
phase
Sql.Phase phaseThe phase of the test to execute the SQL scripts.- Returns:
- The phase
- Default:
- BEFORE_ALL
-
scripts
Scripts to execute, e.g."classpath:foo.sql"
.- Returns:
- The SQL scripts to execute
- Default:
- {}
-
resourceType
Class<?> resourceType- Returns:
- The type of the resource to use for the SQL scripts.
- Default:
- javax.sql.DataSource.class
-