diff --git a/README.md b/README.md
index e98f519..570e232 100644
--- a/README.md
+++ b/README.md
@@ -24,7 +24,7 @@ For installation into a Maven project the `provided` scope is recommended so tha
com.diffblue.cover
cover-annotations
- 1.4.0
+ 1.5.0
provided
@@ -36,9 +36,9 @@ For installation into a Gradle project the `compileOnly` and `testImplementation
```
dependencies {
- compileOnly("com.diffblue.cover:cover-annotations:1.4.0")
+ compileOnly("com.diffblue.cover:cover-annotations:1.5.0")
- testImplementation("com.diffblue.cover:cover-annotations:1.4.0")
+ testImplementation("com.diffblue.cover:cover-annotations:1.5.0")
}
```
diff --git a/pom.xml b/pom.xml
index 97786d6..3a51e16 100644
--- a/pom.xml
+++ b/pom.xml
@@ -16,7 +16,7 @@
4.0.0
com.diffblue.cover
cover-annotations
- 1.4.0
+ 1.5.0
jar
Cover Annotations
diff --git a/src/main/java/com/diffblue/cover/annotations/InTestsMock.java b/src/main/java/com/diffblue/cover/annotations/InTestsMock.java
index 0f9b6b1..5fc0fd6 100644
--- a/src/main/java/com/diffblue/cover/annotations/InTestsMock.java
+++ b/src/main/java/com/diffblue/cover/annotations/InTestsMock.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2024 Diffblue Limited.
+ * Copyright 2024-2025 Diffblue Limited.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PACKAGE;
import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.CLASS;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
@@ -32,29 +32,53 @@
*
* @since Diffblue Cover 2024.04.02
*/
-@Retention(CLASS)
+@Retention(RUNTIME)
@Target({PACKAGE, TYPE, METHOD})
@Repeatable(InTestsMock.Repeatable.class)
public @interface InTestsMock {
/** Collects multiple {@link InTestsMock} annotations. */
- @Retention(CLASS)
+ @Retention(RUNTIME)
@Target({PACKAGE, TYPE, METHOD})
@interface Repeatable {
- /**
- * @return the repeated {@link InTestsMock} annotations.
- */
+ /** @return the repeated {@link InTestsMock} annotations. */
InTestsMock[] value();
}
- /**
- * @return the classes to mock (or not).
- */
+ /** @return the classes to mock (or not). */
Class>[] value();
- /**
- * @return the mocking decision to apply.
- */
+ /** @return the mocking decision to apply. */
MockDecision decision() default RECOMMENDED;
+
+ /** @return name of method to mock */
+ String method() default "";
+
+ /** @return boolean value or values to return from the {@link #method()} */
+ boolean[] booleanReturnValues() default {};
+
+ /** @return byte value or values to return from the {@link #method()} */
+ byte[] byteReturnValues() default {};
+
+ /** @return char value or values to return from the {@link #method()} */
+ char[] charReturnValues() default {};
+
+ /** @return float value or values to return from the {@link #method()} */
+ float[] floatReturnValues() default {};
+
+ /** @return double value or values to return from the {@link #method()} */
+ double[] doubleReturnValues() default {};
+
+ /** @return int value or values to return from the {@link #method()} */
+ int[] intReturnValues() default {};
+
+ /** @return long value or values to return from the {@link #method()} */
+ long[] longReturnValues() default {};
+
+ /** @return short value or values to return from the {@link #method()} */
+ short[] shortReturnValues() default {};
+
+ /** @return String value or values to return from the {@link #method()} */
+ String[] stringReturnValues() default {};
}