Skip to content

Commit

Permalink
Added documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mockitoguy committed Nov 19, 2018
1 parent 0d31743 commit 7fd9a23
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/main/java/org/mockito/Mock.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.lang.annotation.Target;

import org.mockito.junit.MockitoJUnitRunner;
import org.mockito.stubbing.Answer;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.PARAMETER;
Expand Down Expand Up @@ -67,15 +68,41 @@
@Documented
public @interface Mock {

/**
* Mock will have custom answer, see {@link MockSettings#defaultAnswer(Answer)}.
* For examples how to use 'Mock' annotation and parameters see {@link Mock}.
*/
Answers answer() default Answers.RETURNS_DEFAULTS;

/**
* Mock will be 'stubOnly', see {@link MockSettings#stubOnly()}.
* For examples how to use 'Mock' annotation and parameters see {@link Mock}.
*/
boolean stubOnly() default false;

/**
* Mock will have custom name (shown in verification errors), see {@link MockSettings#name(String)}.
* For examples how to use 'Mock' annotation and parameters see {@link Mock}.
*/
String name() default "";

/**
* Mock will have extra interfaces, see {@link MockSettings#extraInterfaces(Class[])}.
* For examples how to use 'Mock' annotation and parameters see {@link Mock}.
*/
Class<?>[] extraInterfaces() default {};

/**
* Mock will be serializable, see {@link MockSettings#serializable()}.
* For examples how to use 'Mock' annotation and parameters see {@link Mock}.
*/
boolean serializable() default false;

/**
* Mock will be lenient, see {@link MockSettings#lenient()}.
* For examples how to use 'Mock' annotation and parameters see {@link Mock}.
*
* @since 2.23.3
*/
boolean lenient() default false;
}

0 comments on commit 7fd9a23

Please sign in to comment.