

Whenĭeclared directly by using the config attribute of the annotation, as local configuration for the SQL scripts declared within the enclosing Every attribute in has an implicit default value, which isĭocumented in the javadoc of the corresponding attribute. When declared as a class-level annotation on an integration test class, as global configuration for all SQL scripts within the test class hierarchy. You can configure script parsing and error handling by using the annotation. No: use TestTransaction.flagForCommit() instead No: use TestTransaction.flagForRollback() instead Only Propagation.NOT_SUPPORTED and Propagation.NEVER are supported NOT_SUPPORTED or NEVER are not run within a transaction. Furthermore, tests thatĪre annotated with but have the propagation attribute set to That is not supported on test lifecycle methods - for example, methodsĪnnotated with JUnit Jupiter’s etc. Test methods that are not annotated (at the class or method level) are not run within a transaction.

If a test class is annotated with each test method within that class

Transaction that is, by default, automatically rolled back after completion of the test. GenericXmlWebContextLoader: Loads a WebApplicationContext from XML resourceĪnnotating a test method with causes the test to be run within a GenericXmlContextLoader: Loads a standard ApplicationContext from XML resource GenericGroovyXmlWebContextLoader: Loads a WebApplicationContext from resource Locations that are either Groovy scripts or XML configuration files. GenericGroovyXmlContextLoader: Loads a standard ApplicationContext from resource Groovy support is enabled only if Groovy is on the classpath.ĪnnotationConfigContextLoader: Loads a standard ApplicationContext from componentĪnnotationConfigWebContextLoader: Loads a WebApplicationContext from component A web ContextLoader is used only if is present on the The test class or on the presence of default locations or default configurationĬlasses. GenericGroovyXmlWebContextLoader, depending either on the configuration declared for To an AnnotationConfigWebContextLoader, a GenericXmlWebContextLoader, or a WebDelegatingSmartContextLoader: One of two default loaders, it delegates internally Groovy support is enabled only if Groovy is on the classpath. Test class or on the presence of default locations or default configuration classes. GenericGroovyXmlContextLoader, depending either on the configuration declared for the Further Examples of Client-side REST TestsĭelegatingSmartContextLoader: One of two default loaders, it delegates internally toĪn AnnotationConfigContextLoader, a GenericXmlContextLoader, or a
