Annotation Interface Mocka


@Target(FIELD) @Retention(RUNTIME) public @interface Mocka
Annotation used to automatically generate mock entity instances for testing within the Mocka framework.

When applied to a field, this annotation triggers entity creation using the specified GenerateType. By default, it uses GenerateType.SELF, which generates only the annotated entity itself without recursively generating related entities.

Usage Example:


 @ExtendsWith(MockaExtension.class)
 public class MemberTest {

     @Mocka
     private Member member; // generates a single Member entity

     @Mocka(GenerateType.CHILDREN)
     private Recruit recruit; // generates Recruit and its child entities
 }
 
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description