@Documented @Inherited @Retention(value=RUNTIME) @Target(value=FIELD) public @interface Fixture
An annotation that can be placed on test related classes or test class fields to denote them as test fixture. Note that if this annotation is placed on:
initialized or
destroyed before and after each test run:
@Module(MyModule.class)
public class MyModuleServiceiT {
@Sut
@Fixture(init = "init", destroy = "destroy")
MyService sut;
}
@Fixture
public class MyModule {
...
}
| Modifier and Type | Optional Element and Description |
|---|---|
boolean |
autoClose
Indicates whether fixtures that implement
AutoCloseable interfaces
should be closed automatically after the test run. |
String |
destroy
Indicates the fixture instance method name called to destroy the fixture.
|
String |
init
Indicates the fixture instance method name called to initialize the fixture.
|
public abstract String init
public abstract String destroy
public abstract boolean autoClose
Indicates whether fixtures that implement AutoCloseable interfaces
should be closed automatically after the test run.
By default this is enabled. If the fixture does not implement
AutoCloseable interface you can explicitly specify the method to call
by setting destroy()
Copyright © 2016–2018 Testify Project. All rights reserved.