Skip to content

Commit 90c8d92

Browse files
authored
Merge pull request #32 from diffblue/develop
Release 1.5.0
2 parents 496e571 + 6058d76 commit 90c8d92

File tree

3 files changed

+41
-17
lines changed

3 files changed

+41
-17
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ For installation into a Maven project the `provided` scope is recommended so tha
2424
<dependency>
2525
<groupId>com.diffblue.cover</groupId>
2626
<artifactId>cover-annotations</artifactId>
27-
<version>1.4.0</version>
27+
<version>1.5.0</version>
2828
<scope>provided</scope>
2929
</dependency>
3030
</dependencies>
@@ -36,9 +36,9 @@ For installation into a Gradle project the `compileOnly` and `testImplementation
3636

3737
```
3838
dependencies {
39-
compileOnly("com.diffblue.cover:cover-annotations:1.4.0")
39+
compileOnly("com.diffblue.cover:cover-annotations:1.5.0")
4040
41-
testImplementation("com.diffblue.cover:cover-annotations:1.4.0")
41+
testImplementation("com.diffblue.cover:cover-annotations:1.5.0")
4242
}
4343
```
4444

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<modelVersion>4.0.0</modelVersion>
1717
<groupId>com.diffblue.cover</groupId>
1818
<artifactId>cover-annotations</artifactId>
19-
<version>1.4.0</version>
19+
<version>1.5.0</version>
2020
<packaging>jar</packaging>
2121

2222
<name>Cover Annotations</name>

src/main/java/com/diffblue/cover/annotations/InTestsMock.java

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024 Diffblue Limited.
2+
* Copyright 2024-2025 Diffblue Limited.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@
1818
import static java.lang.annotation.ElementType.METHOD;
1919
import static java.lang.annotation.ElementType.PACKAGE;
2020
import static java.lang.annotation.ElementType.TYPE;
21-
import static java.lang.annotation.RetentionPolicy.CLASS;
21+
import static java.lang.annotation.RetentionPolicy.RUNTIME;
2222

2323
import java.lang.annotation.Repeatable;
2424
import java.lang.annotation.Retention;
@@ -32,29 +32,53 @@
3232
*
3333
* @since Diffblue Cover 2024.04.02
3434
*/
35-
@Retention(CLASS)
35+
@Retention(RUNTIME)
3636
@Target({PACKAGE, TYPE, METHOD})
3737
@Repeatable(InTestsMock.Repeatable.class)
3838
public @interface InTestsMock {
3939

4040
/** Collects multiple {@link InTestsMock} annotations. */
41-
@Retention(CLASS)
41+
@Retention(RUNTIME)
4242
@Target({PACKAGE, TYPE, METHOD})
4343
@interface Repeatable {
4444

45-
/**
46-
* @return the repeated {@link InTestsMock} annotations.
47-
*/
45+
/** @return the repeated {@link InTestsMock} annotations. */
4846
InTestsMock[] value();
4947
}
5048

51-
/**
52-
* @return the classes to mock (or not).
53-
*/
49+
/** @return the classes to mock (or not). */
5450
Class<?>[] value();
5551

56-
/**
57-
* @return the mocking decision to apply.
58-
*/
52+
/** @return the mocking decision to apply. */
5953
MockDecision decision() default RECOMMENDED;
54+
55+
/** @return name of method to mock */
56+
String method() default "";
57+
58+
/** @return boolean value or values to return from the {@link #method()} */
59+
boolean[] booleanReturnValues() default {};
60+
61+
/** @return byte value or values to return from the {@link #method()} */
62+
byte[] byteReturnValues() default {};
63+
64+
/** @return char value or values to return from the {@link #method()} */
65+
char[] charReturnValues() default {};
66+
67+
/** @return float value or values to return from the {@link #method()} */
68+
float[] floatReturnValues() default {};
69+
70+
/** @return double value or values to return from the {@link #method()} */
71+
double[] doubleReturnValues() default {};
72+
73+
/** @return int value or values to return from the {@link #method()} */
74+
int[] intReturnValues() default {};
75+
76+
/** @return long value or values to return from the {@link #method()} */
77+
long[] longReturnValues() default {};
78+
79+
/** @return short value or values to return from the {@link #method()} */
80+
short[] shortReturnValues() default {};
81+
82+
/** @return String value or values to return from the {@link #method()} */
83+
String[] stringReturnValues() default {};
6084
}

0 commit comments

Comments
 (0)