File tree Expand file tree Collapse file tree 5 files changed +55
-12
lines changed
src/main/java/com/diffblue/cover/annotations Expand file tree Collapse file tree 5 files changed +55
-12
lines changed Original file line number Diff line number Diff line change 8
8
<passphrase >${env.GPG_PASSPHRASE}</passphrase >
9
9
</server >
10
10
<server >
11
- <id >ossrh </id >
12
- <username >${env.MAVEN_USERNAME}</username >
13
- <password >${env.MAVEN_PASSWORD}</password >
11
+ <id >central </id >
12
+ <username >${env.MAVEN_USERNAME}</username >
13
+ <password >${env.MAVEN_PASSWORD}</password >
14
14
</server >
15
15
</servers >
16
16
<profiles >
Original file line number Diff line number Diff line change @@ -36,9 +36,9 @@ For installation into a Gradle project the `compileOnly` and `testImplementation
36
36
37
37
```
38
38
dependencies {
39
- compileOnly("com.diffblue.cover:cover-annotations:1.5 .0")
39
+ compileOnly("com.diffblue.cover:cover-annotations:1.6 .0")
40
40
41
- testImplementation("com.diffblue.cover:cover-annotations:1.5 .0")
41
+ testImplementation("com.diffblue.cover:cover-annotations:1.6 .0")
42
42
}
43
43
```
44
44
Original file line number Diff line number Diff line change 16
16
<modelVersion >4.0.0</modelVersion >
17
17
<groupId >com.diffblue.cover</groupId >
18
18
<artifactId >cover-annotations</artifactId >
19
- <version >1.5 .0</version >
19
+ <version >1.6 .0</version >
20
20
<packaging >jar</packaging >
21
21
22
22
<name >Cover Annotations</name >
71
71
<build >
72
72
<plugins >
73
73
<plugin >
74
- <groupId >org.sonatype.plugins </groupId >
75
- <artifactId >nexus-staging -maven-plugin</artifactId >
76
- <version >1.6.13 </version >
74
+ <groupId >org.sonatype.central </groupId >
75
+ <artifactId >central-publishing -maven-plugin</artifactId >
76
+ <version >0.7.0 </version >
77
77
<extensions >true</extensions >
78
78
<configuration >
79
- <serverId >ossrh</serverId >
80
- <nexusUrl >https://oss.sonatype.org/</nexusUrl >
81
- <autoReleaseAfterClose >true</autoReleaseAfterClose >
79
+ <publishingServerId >central</publishingServerId >
80
+ <autoPublish >true</autoPublish >
82
81
</configuration >
83
82
</plugin >
84
83
</plugins >
Original file line number Diff line number Diff line change 20
20
import static java .lang .annotation .ElementType .TYPE ;
21
21
import static java .lang .annotation .RetentionPolicy .RUNTIME ;
22
22
23
+ import com .diffblue .cover .annotations .exceptions .NoException ;
23
24
import java .lang .annotation .Repeatable ;
24
25
import java .lang .annotation .Retention ;
25
26
import java .lang .annotation .Target ;
81
82
82
83
/** @return String value or values to return from the {@link #method()} */
83
84
String [] stringReturnValues () default {};
85
+
86
+ /**
87
+ * @return name of the factory method used to create the object returned by the mocked {@link
88
+ * #method()}
89
+ */
90
+ String returnValueFactory () default "" ;
91
+
92
+ /**
93
+ * @return exception type to throw when the mocked {@link #method()} is called. Defaults to {@link
94
+ * NoException} to indicate no exception should be thrown.
95
+ */
96
+ Class <? extends Throwable > throwException () default NoException .class ;
97
+
98
+ /**
99
+ * @return fully qualified name of the factory method used to create the exception to throw when
100
+ * the mocked {@link #method()} is called.
101
+ */
102
+ String throwExceptionFactory () default "" ;
84
103
}
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2025 Diffblue Limited.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License").
5
+ * You may not use this file except in compliance with the License.
6
+ * A copy of the License is located at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * or in the "license" file accompanying this file. This file is distributed
11
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12
+ * express or implied. See the License for the specific language governing
13
+ * permissions and limitations under the License.
14
+ */
15
+ package com .diffblue .cover .annotations .exceptions ;
16
+
17
+ /**
18
+ * Marker class used to indicate that no exception should be thrown by default in {@link
19
+ * com.diffblue.cover.annotations.InTestsMock#throwException()}.
20
+ */
21
+ public final class NoException extends Throwable {
22
+ private NoException () {
23
+ // This class should not be instantiated.
24
+ }
25
+ }
You can’t perform that action at this time.
0 commit comments