From 1ef4d3d3a0ee293d709acaaf8db34df0635a8acd Mon Sep 17 00:00:00 2001 From: ThomasPerkins1123 Date: Thu, 12 Jun 2025 13:47:07 +0100 Subject: [PATCH 1/4] Make release wait for publish This prevents the job from instantly finishing as soon as the upload has completed. As if you do not have access to view the maven central portal you will not know if anything failed --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 4752e23..1808962 100644 --- a/pom.xml +++ b/pom.xml @@ -78,6 +78,7 @@ central true + published From 757608cbaaab5eeca99291bf1e536f36f713de8b Mon Sep 17 00:00:00 2001 From: Paul Crane Date: Tue, 23 Sep 2025 14:49:09 +0100 Subject: [PATCH 2/4] Add new annotation This allows users to add a list of factory methods to supply different arguments to the methods under test. --- .../annotations/InTestsUseFactories.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/main/java/com/diffblue/cover/annotations/InTestsUseFactories.java diff --git a/src/main/java/com/diffblue/cover/annotations/InTestsUseFactories.java b/src/main/java/com/diffblue/cover/annotations/InTestsUseFactories.java new file mode 100644 index 0000000..03d6903 --- /dev/null +++ b/src/main/java/com/diffblue/cover/annotations/InTestsUseFactories.java @@ -0,0 +1,48 @@ +/* + * 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. + * A copy of the License is located at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ +package com.diffblue.cover.annotations; + +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import java.lang.annotation.Repeatable; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +/** + * Identifies factories that should be considered when writing tests for the annotated method. + * + * @since Diffblue Cover 2024.10.01 + */ +@Retention(RUNTIME) +@Target(METHOD) +@Repeatable(InTestsUseFactories.Repeatable.class) +public @interface InTestsUseFactories { + + /** Collects multiple {@link InTestsUseFactories} annotations. */ + @Retention(RUNTIME) + @Target(METHOD) + @interface Repeatable { + + /** @return the repeated {@link InTestsUseFactories} annotations. */ + InTestsUseFactories[] value(); + } + + /** @return The name of the class containing the factory methods. */ + String className(); + + /** @return The method names to use for factory methods. */ + String[] methodNames(); +} From 52d238aa2a86c40072f5e22b69220dadd0147c1b Mon Sep 17 00:00:00 2001 From: Paul Crane Date: Tue, 23 Sep 2025 14:49:40 +0100 Subject: [PATCH 3/4] Bump version to 1.7.0 --- README.md | 6 +++--- pom.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 87331f2..012a678 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.5.0 + 1.7.0 provided @@ -36,9 +36,9 @@ For installation into a Gradle project the `compileOnly` and `testImplementation ``` dependencies { - compileOnly("com.diffblue.cover:cover-annotations:1.6.0") + compileOnly("com.diffblue.cover:cover-annotations:1.7.0") - testImplementation("com.diffblue.cover:cover-annotations:1.6.0") + testImplementation("com.diffblue.cover:cover-annotations:1.7.0") } ``` diff --git a/pom.xml b/pom.xml index 1808962..0347d9e 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ 4.0.0 com.diffblue.cover cover-annotations - 1.6.0 + 1.7.0 jar Cover Annotations From 1969e1cd112ccb106861b5b4cbc023ad5fed2878 Mon Sep 17 00:00:00 2001 From: Paul Crane Date: Tue, 23 Sep 2025 15:00:17 +0100 Subject: [PATCH 4/4] Use batch mode in mvn commands This prevents the progress bar from being displayed in the log files. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc1c742..e560962 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: java-version: '8' - name: Run Spotless Check - run: mvn spotless:check + run: mvn --batch-mode spotless:check - name: Compile Project - run: mvn compile + run: mvn --batch-mode compile