Skip to content

Commit a47eeb8

Browse files
authored
Merge pull request #38 from diffblue/develop
Release 1.6.0.
2 parents 90c8d92 + 5e59637 commit a47eeb8

File tree

5 files changed

+55
-12
lines changed

5 files changed

+55
-12
lines changed

.github/settings.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
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>

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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.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

pom.xml

Lines changed: 6 additions & 7 deletions
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.5.0</version>
19+
<version>1.6.0</version>
2020
<packaging>jar</packaging>
2121

2222
<name>Cover Annotations</name>
@@ -71,14 +71,13 @@
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>

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import static java.lang.annotation.ElementType.TYPE;
2121
import static java.lang.annotation.RetentionPolicy.RUNTIME;
2222

23+
import com.diffblue.cover.annotations.exceptions.NoException;
2324
import java.lang.annotation.Repeatable;
2425
import java.lang.annotation.Retention;
2526
import java.lang.annotation.Target;
@@ -81,4 +82,22 @@
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
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
}

0 commit comments

Comments
 (0)