Package io.micronaut.test.annotation
Annotation Interface MockBean
@Retention(RUNTIME)
@Target({METHOD,TYPE,ANNOTATION_TYPE,FIELD})
@Bean
@Requires(condition=TestActiveCondition.class)
@Refreshable("micronaut.test.spock.active.mocks")
@Around(proxyTargetMode=ALLOW)
public @interface MockBean
Annotation that can be applied on the method level in a test to define a Mock bean using Spock's mocking API.
- Since:
- 1.0
- Author:
- graemerocher
-
Optional Element Summary
-
Element Details
-
value
- Returns:
- The bean this mock replaces
- Default:
- void.class
-
bean
- Returns:
- The bean this mock replaces
- Default:
- void.class
-
named
The name of the bean to replace in the case of multiple beans.- Returns:
- The qualifier
- Default:
- ""
-