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 88 <passphrase >${env.GPG_PASSPHRASE}</passphrase >
99 </server >
1010 <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 >
1414 </server >
1515 </servers >
1616 <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
3636
3737```
3838dependencies {
39- compileOnly("com.diffblue.cover:cover-annotations:1.5 .0")
39+ compileOnly("com.diffblue.cover:cover-annotations:1.6 .0")
4040
41- testImplementation("com.diffblue.cover:cover-annotations:1.5 .0")
41+ testImplementation("com.diffblue.cover:cover-annotations:1.6 .0")
4242}
4343```
4444
Original file line number Diff line number Diff line change 1616 <modelVersion >4.0.0</modelVersion >
1717 <groupId >com.diffblue.cover</groupId >
1818 <artifactId >cover-annotations</artifactId >
19- <version >1.5 .0</version >
19+ <version >1.6 .0</version >
2020 <packaging >jar</packaging >
2121
2222 <name >Cover Annotations</name >
7171 <build >
7272 <plugins >
7373 <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 >
7777 <extensions >true</extensions >
7878 <configuration >
79- <serverId >ossrh</serverId >
80- <nexusUrl >https://oss.sonatype.org/</nexusUrl >
81- <autoReleaseAfterClose >true</autoReleaseAfterClose >
79+ <publishingServerId >central</publishingServerId >
80+ <autoPublish >true</autoPublish >
8281 </configuration >
8382 </plugin >
8483 </plugins >
Original file line number Diff line number Diff line change 2020import static java .lang .annotation .ElementType .TYPE ;
2121import static java .lang .annotation .RetentionPolicy .RUNTIME ;
2222
23+ import com .diffblue .cover .annotations .exceptions .NoException ;
2324import java .lang .annotation .Repeatable ;
2425import java .lang .annotation .Retention ;
2526import java .lang .annotation .Target ;
8182
8283 /** @return String value or values to return from the {@link #method()} */
8384 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 "" ;
84103}
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