diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ad77feb7d..cb14edb6f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,22 +14,18 @@ jobs: build: name: "Build" runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - java-version: [ '17.0.x' ] steps: - uses: actions/checkout@v4.1.1 - - name: Set up JDK ${{ matrix.java-version }} + - name: "Set up JDK" uses: actions/setup-java@v4 with: distribution: 'zulu' - java-version: ${{ matrix.java-version }} + java-version: 21 - - name: Build with Gradle + - name: "Build with Gradle" run: ./gradlew build -x test --scan - - name: Run tests + - name: "Run tests" if: always() run: ./gradlew --no-build-cache cleanTest test diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 75b78957e..28af62d51 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,11 +10,11 @@ jobs: steps: - uses: actions/checkout@v4.1.1 - - name: "Set up JDK 17.0.x" + - name: "Set up JDK" uses: actions/setup-java@v4 with: distribution: 'zulu' - java-version: '17.0.x' + java-version: '21' - name: Set up GPG run: echo -n "${GPG_PRIVATE_KEY}" | base64 --decode > ${GITHUB_WORKSPACE}/${GPG_KEY_ID}.gpg diff --git a/allure-awaitility/build.gradle.kts b/allure-awaitility/build.gradle.kts index 2426a93bc..587ca0308 100644 --- a/allure-awaitility/build.gradle.kts +++ b/allure-awaitility/build.gradle.kts @@ -2,7 +2,7 @@ description = "Allure Awaitlity Integration" val agent: Configuration by configurations.creating -val awaitilityVersion = "4.2.0" +val awaitilityVersion = "4.2.1" dependencies { agent("org.aspectj:aspectjweaver") diff --git a/allure-awaitility/src/main/java/io/qameta/allure/awaitility/AllureAwaitilityListener.java b/allure-awaitility/src/main/java/io/qameta/allure/awaitility/AllureAwaitilityListener.java index 93f6c0ee8..01b793cf5 100644 --- a/allure-awaitility/src/main/java/io/qameta/allure/awaitility/AllureAwaitilityListener.java +++ b/allure-awaitility/src/main/java/io/qameta/allure/awaitility/AllureAwaitilityListener.java @@ -77,7 +77,8 @@ public class AllureAwaitilityListener implements ConditionEvaluationListener lifecycle = new InheritableThreadLocal() { + private static final InheritableThreadLocal LIFECYCLE + = new InheritableThreadLocal() { @Override protected AllureLifecycle initialValue() { return Allure.getLifecycle(); @@ -85,7 +86,7 @@ protected AllureLifecycle initialValue() { }; public static AllureLifecycle getLifecycle() { - return lifecycle.get(); + return LIFECYCLE.get(); } /** @@ -250,7 +251,7 @@ public void exceptionIgnored(final IgnoredException ignoredException) { * @param allure allure lifecycle to set */ public static void setLifecycle(final AllureLifecycle allure) { - lifecycle.set(allure); + LIFECYCLE.set(allure); } } diff --git a/allure-awaitility/src/main/java/io/qameta/allure/awaitility/TemporalDuration.java b/allure-awaitility/src/main/java/io/qameta/allure/awaitility/TemporalDuration.java index b9f58879d..d549ee811 100644 --- a/allure-awaitility/src/main/java/io/qameta/allure/awaitility/TemporalDuration.java +++ b/allure-awaitility/src/main/java/io/qameta/allure/awaitility/TemporalDuration.java @@ -60,10 +60,7 @@ public class TemporalDuration implements TemporalAccessor { @Override public boolean isSupported(final TemporalField field) { - if (!temporal.isSupported(field)) { - return false; - } - return temporal.getLong(field) - BASE.getLong(field) != 0L; + return temporal.isSupported(field) && temporal.getLong(field) - BASE.getLong(field) != 0L; } @Override diff --git a/allure-cucumber4-jvm/src/main/java/io/qameta/allure/cucumber4jvm/TagParser.java b/allure-cucumber4-jvm/src/main/java/io/qameta/allure/cucumber4jvm/TagParser.java index 0c7417c05..0c6f76e44 100644 --- a/allure-cucumber4-jvm/src/main/java/io/qameta/allure/cucumber4jvm/TagParser.java +++ b/allure-cucumber4-jvm/src/main/java/io/qameta/allure/cucumber4jvm/TagParser.java @@ -52,13 +52,13 @@ public boolean isKnown() { private boolean getStatusDetailByTag(final String tagName) { return scenario.getTags().stream() - .anyMatch(tag -> tag.getName().equalsIgnoreCase(tagName)) - || feature.getTags().stream() - .anyMatch(tag -> tag.getName().equalsIgnoreCase(tagName)); + .anyMatch(tag -> tag.getName().equalsIgnoreCase(tagName)) + || feature.getTags().stream() + .anyMatch(tag -> tag.getName().equalsIgnoreCase(tagName)); } public boolean isResultTag(final PickleTag tag) { - return Arrays.asList(new String[]{FLAKY, KNOWN, MUTED}) + return Arrays.asList(FLAKY, KNOWN, MUTED) .contains(tag.getName().toUpperCase()); } diff --git a/allure-cucumber5-jvm/src/main/java/io/qameta/allure/cucumber5jvm/AllureCucumber5Jvm.java b/allure-cucumber5-jvm/src/main/java/io/qameta/allure/cucumber5jvm/AllureCucumber5Jvm.java index 546838100..f7fc242e7 100644 --- a/allure-cucumber5-jvm/src/main/java/io/qameta/allure/cucumber5jvm/AllureCucumber5Jvm.java +++ b/allure-cucumber5-jvm/src/main/java/io/qameta/allure/cucumber5jvm/AllureCucumber5Jvm.java @@ -395,15 +395,8 @@ private void createDataTableAttachment(final DataTableArgument dataTableArgument final StringBuilder dataTableCsv = new StringBuilder(); for (List columns : rowsInTable) { if (!columns.isEmpty()) { - for (int i = 0; i < columns.size(); i++) { - if (i == columns.size() - 1) { - dataTableCsv.append(columns.get(i)); - } else { - dataTableCsv.append(columns.get(i)); - dataTableCsv.append('\t'); - } - } - dataTableCsv.append('\n'); + final String rowValue = columns.stream().collect(Collectors.joining("\t", "", "\n")); + dataTableCsv.append(rowValue); } } final String attachmentSource = lifecycle diff --git a/allure-cucumber5-jvm/src/main/java/io/qameta/allure/cucumber5jvm/TagParser.java b/allure-cucumber5-jvm/src/main/java/io/qameta/allure/cucumber5jvm/TagParser.java index 211939586..ced0a37f1 100644 --- a/allure-cucumber5-jvm/src/main/java/io/qameta/allure/cucumber5jvm/TagParser.java +++ b/allure-cucumber5-jvm/src/main/java/io/qameta/allure/cucumber5jvm/TagParser.java @@ -51,13 +51,13 @@ public boolean isKnown() { private boolean getStatusDetailByTag(final String tagName) { return scenario.getTags().stream() - .anyMatch(tag -> tag.equalsIgnoreCase(tagName)) - || feature.getTags().stream() - .anyMatch(tag -> tag.getName().equalsIgnoreCase(tagName)); + .anyMatch(tag -> tag.equalsIgnoreCase(tagName)) + || feature.getTags().stream() + .anyMatch(tag -> tag.getName().equalsIgnoreCase(tagName)); } public boolean isResultTag(final String tag) { - return Arrays.asList(new String[]{FLAKY, KNOWN, MUTED}) + return Arrays.asList(FLAKY, KNOWN, MUTED) .contains(tag.toUpperCase()); } diff --git a/allure-cucumber6-jvm/src/main/java/io/qameta/allure/cucumber6jvm/AllureCucumber6Jvm.java b/allure-cucumber6-jvm/src/main/java/io/qameta/allure/cucumber6jvm/AllureCucumber6Jvm.java index bb0e513bf..6dd1dacfb 100644 --- a/allure-cucumber6-jvm/src/main/java/io/qameta/allure/cucumber6jvm/AllureCucumber6Jvm.java +++ b/allure-cucumber6-jvm/src/main/java/io/qameta/allure/cucumber6jvm/AllureCucumber6Jvm.java @@ -380,15 +380,8 @@ private void createDataTableAttachment(final DataTableArgument dataTableArgument final StringBuilder dataTableCsv = new StringBuilder(); for (List columns : rowsInTable) { if (!columns.isEmpty()) { - for (int i = 0; i < columns.size(); i++) { - if (i == columns.size() - 1) { - dataTableCsv.append(columns.get(i)); - } else { - dataTableCsv.append(columns.get(i)); - dataTableCsv.append('\t'); - } - } - dataTableCsv.append('\n'); + final String rowValue = columns.stream().collect(Collectors.joining("\t", "", "\n")); + dataTableCsv.append(rowValue); } } final String attachmentSource = lifecycle diff --git a/allure-cucumber6-jvm/src/main/java/io/qameta/allure/cucumber6jvm/TagParser.java b/allure-cucumber6-jvm/src/main/java/io/qameta/allure/cucumber6jvm/TagParser.java index a594d97d9..ada27215b 100644 --- a/allure-cucumber6-jvm/src/main/java/io/qameta/allure/cucumber6jvm/TagParser.java +++ b/allure-cucumber6-jvm/src/main/java/io/qameta/allure/cucumber6jvm/TagParser.java @@ -51,13 +51,13 @@ public boolean isKnown() { private boolean getStatusDetailByTag(final String tagName) { return scenario.getTags().stream() - .anyMatch(tag -> tag.equalsIgnoreCase(tagName)) - || feature.getTagsList().stream() - .anyMatch(tag -> tag.getName().equalsIgnoreCase(tagName)); + .anyMatch(tag -> tag.equalsIgnoreCase(tagName)) + || feature.getTagsList().stream() + .anyMatch(tag -> tag.getName().equalsIgnoreCase(tagName)); } public boolean isResultTag(final String tag) { - return Arrays.asList(new String[]{FLAKY, KNOWN, MUTED}) + return Arrays.asList(FLAKY, KNOWN, MUTED) .contains(tag.toUpperCase()); } diff --git a/allure-cucumber7-jvm/src/main/java/io/qameta/allure/cucumber7jvm/AllureCucumber7Jvm.java b/allure-cucumber7-jvm/src/main/java/io/qameta/allure/cucumber7jvm/AllureCucumber7Jvm.java index 5f85512fd..9d7c89b34 100644 --- a/allure-cucumber7-jvm/src/main/java/io/qameta/allure/cucumber7jvm/AllureCucumber7Jvm.java +++ b/allure-cucumber7-jvm/src/main/java/io/qameta/allure/cucumber7jvm/AllureCucumber7Jvm.java @@ -393,15 +393,8 @@ private void createDataTableAttachment(final DataTableArgument dataTableArgument final StringBuilder dataTableCsv = new StringBuilder(); for (List columns : rowsInTable) { if (!columns.isEmpty()) { - for (int i = 0; i < columns.size(); i++) { - if (i == columns.size() - 1) { - dataTableCsv.append(columns.get(i)); - } else { - dataTableCsv.append(columns.get(i)); - dataTableCsv.append('\t'); - } - } - dataTableCsv.append('\n'); + final String rowValue = columns.stream().collect(Collectors.joining("\t", "", "\n")); + dataTableCsv.append(rowValue); } } final String attachmentSource = lifecycle diff --git a/allure-cucumber7-jvm/src/main/java/io/qameta/allure/cucumber7jvm/TagParser.java b/allure-cucumber7-jvm/src/main/java/io/qameta/allure/cucumber7jvm/TagParser.java index 8efb825a4..a20ad07bf 100644 --- a/allure-cucumber7-jvm/src/main/java/io/qameta/allure/cucumber7jvm/TagParser.java +++ b/allure-cucumber7-jvm/src/main/java/io/qameta/allure/cucumber7jvm/TagParser.java @@ -51,13 +51,13 @@ public boolean isKnown() { private boolean getStatusDetailByTag(final String tagName) { return scenario.getTags().stream() - .anyMatch(tag -> tag.equalsIgnoreCase(tagName)) - || feature.getTags().stream() - .anyMatch(tag -> tag.getName().equalsIgnoreCase(tagName)); + .anyMatch(tag -> tag.equalsIgnoreCase(tagName)) + || feature.getTags().stream() + .anyMatch(tag -> tag.getName().equalsIgnoreCase(tagName)); } public boolean isResultTag(final String tag) { - return Arrays.asList(new String[]{FLAKY, KNOWN, MUTED}) + return Arrays.asList(FLAKY, KNOWN, MUTED) .contains(tag.toUpperCase()); } diff --git a/allure-cucumber7-jvm/src/main/java/io/qameta/allure/cucumber7jvm/testsourcemodel/TestSourcesModel.java b/allure-cucumber7-jvm/src/main/java/io/qameta/allure/cucumber7jvm/testsourcemodel/TestSourcesModel.java index 37d2fb7ff..8b3533d65 100644 --- a/allure-cucumber7-jvm/src/main/java/io/qameta/allure/cucumber7jvm/testsourcemodel/TestSourcesModel.java +++ b/allure-cucumber7-jvm/src/main/java/io/qameta/allure/cucumber7jvm/testsourcemodel/TestSourcesModel.java @@ -124,7 +124,7 @@ private void processScenarioDefinition( for (Step step : child.getSteps()) { nodeMap.put(step.getLocation().getLine(), createAstNode(step, childNode)); } - if (child.getExamples().size() > 0) { + if (!child.getExamples().isEmpty()) { processScenarioOutlineExamples(nodeMap, child, childNode); } } diff --git a/allure-descriptions-javadoc/src/main/java/io/qameta/allure/description/JavaDocDescriptionsProcessor.java b/allure-descriptions-javadoc/src/main/java/io/qameta/allure/description/JavaDocDescriptionsProcessor.java index b4487310e..320ffe841 100644 --- a/allure-descriptions-javadoc/src/main/java/io/qameta/allure/description/JavaDocDescriptionsProcessor.java +++ b/allure-descriptions-javadoc/src/main/java/io/qameta/allure/description/JavaDocDescriptionsProcessor.java @@ -82,7 +82,7 @@ public boolean process(final Set annotations, final Round } final String docs = rawDocs.trim(); - if ("".equals(docs)) { + if (docs.isEmpty()) { return; } diff --git a/allure-grpc/build.gradle.kts b/allure-grpc/build.gradle.kts index 1205a6caf..cd1ddfd34 100644 --- a/allure-grpc/build.gradle.kts +++ b/allure-grpc/build.gradle.kts @@ -9,7 +9,7 @@ description = "Allure gRPC Integration" val agent: Configuration by configurations.creating val grpcVersion = "1.57.2" -val protobufVersion = "3.22.4" +val protobufVersion = "4.27.2" dependencies { agent("org.aspectj:aspectjweaver") diff --git a/allure-grpc/src/main/java/io/qameta/allure/grpc/AllureGrpc.java b/allure-grpc/src/main/java/io/qameta/allure/grpc/AllureGrpc.java index 1217dcf92..caf8612d5 100644 --- a/allure-grpc/src/main/java/io/qameta/allure/grpc/AllureGrpc.java +++ b/allure-grpc/src/main/java/io/qameta/allure/grpc/AllureGrpc.java @@ -85,22 +85,21 @@ public AllureGrpc interceptResponseMetadata(final boolean value) { return this; } - @SuppressWarnings({"PMD.MethodArgumentCouldBeFinal", "PMD.NPathComplexity"}) + @SuppressWarnings({"PMD.NPathComplexity"}) @Override - public ClientCall interceptCall(MethodDescriptor method, - CallOptions callOptions, - Channel next) { + public ClientCall interceptCall(final MethodDescriptor method, + final CallOptions callOptions, + final Channel next) { final AttachmentProcessor processor = new DefaultAttachmentProcessor(); return new ForwardingClientCall.SimpleForwardingClientCall( next.newCall(method, callOptions.withoutWaitForReady())) { private String stepUuid; - private List parsedResponses = new ArrayList<>(); + private final List parsedResponses = new ArrayList<>(); - @SuppressWarnings("PMD.MethodArgumentCouldBeFinal") @Override - public void sendMessage(T message) { + public void sendMessage(final T message) { stepUuid = UUID.randomUUID().toString(); Allure.getLifecycle().startStep(stepUuid, (new StepResult()).setName( "Send gRPC request to " @@ -126,18 +125,17 @@ public void sendMessage(T message) { } } - @SuppressWarnings("PMD.MethodArgumentCouldBeFinal") + @SuppressWarnings({"PMD.NcssCount"}) @Override - public void start(Listener responseListener, Metadata headers) { + public void start(final Listener responseListener, final Metadata headers) { final ClientCall.Listener listener = new ForwardingClientCallListener() { @Override protected Listener delegate() { return responseListener; } - @SuppressWarnings({"PMD.MethodArgumentCouldBeFinal", "PMD.AvoidLiteralsInIfCondition"}) @Override - public void onClose(io.grpc.Status status, Metadata trailers) { + public void onClose(final io.grpc.Status status, final Metadata trailers) { GrpcResponseAttachment.Builder responseAttachmentBuilder = null; if (parsedResponses.size() == 1) { @@ -183,9 +181,8 @@ public void onClose(io.grpc.Status status, Metadata trailers) { super.onClose(status, trailers); } - @SuppressWarnings("PMD.MethodArgumentCouldBeFinal") @Override - public void onMessage(A message) { + public void onMessage(final A message) { try { parsedResponses.add(JSON_PRINTER.print((MessageOrBuilder) message)); super.onMessage(message); diff --git a/allure-httpclient5/src/main/java/io/qameta/allure/httpclient5/AllureHttpClient5Request.java b/allure-httpclient5/src/main/java/io/qameta/allure/httpclient5/AllureHttpClient5Request.java index 2e4ab5584..14167a41d 100644 --- a/allure-httpclient5/src/main/java/io/qameta/allure/httpclient5/AllureHttpClient5Request.java +++ b/allure-httpclient5/src/main/java/io/qameta/allure/httpclient5/AllureHttpClient5Request.java @@ -34,7 +34,6 @@ /** * @author a-simeshin (Simeshin Artem) */ -@SuppressWarnings("PMD.MethodArgumentCouldBeFinal") public class AllureHttpClient5Request implements HttpRequestInterceptor { private final AttachmentRenderer renderer; @@ -62,7 +61,9 @@ public AllureHttpClient5Request(final AttachmentRenderer rendere * @param context the HTTP context */ @Override - public void process(HttpRequest request, EntityDetails entity, HttpContext context) { + public void process(final HttpRequest request, + final EntityDetails entity, + final HttpContext context) { final String attachmentName = getAttachmentName(request); final HttpRequestAttachment.Builder builder = create(attachmentName, request.getRequestUri()); builder.setMethod(request.getMethod()); diff --git a/allure-httpclient5/src/main/java/io/qameta/allure/httpclient5/AllureHttpClient5Response.java b/allure-httpclient5/src/main/java/io/qameta/allure/httpclient5/AllureHttpClient5Response.java index bf5bff643..f4e53c931 100644 --- a/allure-httpclient5/src/main/java/io/qameta/allure/httpclient5/AllureHttpClient5Response.java +++ b/allure-httpclient5/src/main/java/io/qameta/allure/httpclient5/AllureHttpClient5Response.java @@ -39,7 +39,6 @@ */ @SuppressWarnings({ "checkstyle:ParameterAssignment", - "PMD.MethodArgumentCouldBeFinal", "PMD.AvoidReassigningParameters"}) public class AllureHttpClient5Response implements HttpResponseInterceptor { private final AttachmentRenderer renderer; @@ -69,7 +68,9 @@ public AllureHttpClient5Response(final AttachmentRenderer render * @throws IOException if an I/O error occurs */ @Override - public void process(HttpResponse response, EntityDetails entity, HttpContext context) throws IOException { + public void process(final HttpResponse response, + EntityDetails entity, + final HttpContext context) throws IOException { final HttpResponseAttachment.Builder builder = create("Response"); builder.setResponseCode(response.getCode()); diff --git a/allure-java-commons/build.gradle.kts b/allure-java-commons/build.gradle.kts index 65c5ae82d..34a9a2ed3 100644 --- a/allure-java-commons/build.gradle.kts +++ b/allure-java-commons/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("com.github.johnrengelman.shadow") + id("io.github.goooler.shadow") } description = "Allure Java Commons" diff --git a/allure-java-commons/src/main/java/io/qameta/allure/internal/AllureThreadContext.java b/allure-java-commons/src/main/java/io/qameta/allure/internal/AllureThreadContext.java index bbf94fd4e..e052c8d11 100644 --- a/allure-java-commons/src/main/java/io/qameta/allure/internal/AllureThreadContext.java +++ b/allure-java-commons/src/main/java/io/qameta/allure/internal/AllureThreadContext.java @@ -15,6 +15,7 @@ */ package io.qameta.allure.internal; +import java.util.Deque; import java.util.LinkedList; import java.util.Objects; import java.util.Optional; @@ -32,7 +33,7 @@ public class AllureThreadContext { * Returns last (most recent) uuid. */ public Optional getCurrent() { - final LinkedList uuids = context.get(); + final Deque uuids = context.get(); return uuids.isEmpty() ? Optional.empty() : Optional.of(uuids.getFirst()); @@ -42,7 +43,7 @@ public Optional getCurrent() { * Returns first (oldest) uuid. */ public Optional getRoot() { - final LinkedList uuids = context.get(); + final Deque uuids = context.get(); return uuids.isEmpty() ? Optional.empty() : Optional.of(uuids.getLast()); @@ -62,7 +63,7 @@ public void start(final String uuid) { * @return removed uuid. */ public Optional stop() { - final LinkedList uuids = context.get(); + final Deque uuids = context.get(); if (!uuids.isEmpty()) { return Optional.of(uuids.pop()); } @@ -79,15 +80,15 @@ public void clear() { /** * Thread local context that stores information about not finished tests and steps. */ - private static final class Context extends InheritableThreadLocal> { + private static final class Context extends InheritableThreadLocal> { @Override - public LinkedList initialValue() { + public Deque initialValue() { return new LinkedList<>(); } @Override - protected LinkedList childValue(final LinkedList parentStepContext) { + protected Deque childValue(final Deque parentStepContext) { return new LinkedList<>(parentStepContext); } diff --git a/allure-jooq/build.gradle.kts b/allure-jooq/build.gradle.kts index d7aeab402..b0b1c7884 100644 --- a/allure-jooq/build.gradle.kts +++ b/allure-jooq/build.gradle.kts @@ -1,21 +1,21 @@ description = "Allure JOOQ Integration" -val jooqVersion = "3.18.4" +val jooqVersion = "3.19.10" dependencies { api(project(":allure-java-commons")) implementation("org.jooq:jooq:${jooqVersion}") - testImplementation("io.zonky.test:embedded-postgres:2.0.4") + testImplementation("io.zonky.test:embedded-postgres:2.0.7") testImplementation("org.assertj:assertj-core") testImplementation("org.junit.jupiter:junit-jupiter-api") testImplementation("org.mockito:mockito-core") testImplementation("org.slf4j:slf4j-simple") - testImplementation(platform("io.zonky.test.postgres:embedded-postgres-binaries-bom:15.3.0")) + testImplementation(platform("io.zonky.test.postgres:embedded-postgres-binaries-bom:16.2.0")) testImplementation(project(":allure-assertj")) testImplementation(project(":allure-java-commons-test")) testImplementation(project(":allure-junit-platform")) testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine") - testRuntimeOnly("org.postgresql:postgresql:42.7.1") + testRuntimeOnly("org.postgresql:postgresql:42.7.3") } java { diff --git a/allure-jsonunit/src/main/java/io/qameta/allure/jsonunit/AbstractJsonPatchMatcher.java b/allure-jsonunit/src/main/java/io/qameta/allure/jsonunit/AbstractJsonPatchMatcher.java index 6a940d4dc..329dbc6c8 100644 --- a/allure-jsonunit/src/main/java/io/qameta/allure/jsonunit/AbstractJsonPatchMatcher.java +++ b/allure-jsonunit/src/main/java/io/qameta/allure/jsonunit/AbstractJsonPatchMatcher.java @@ -20,13 +20,15 @@ import org.hamcrest.Matcher; import net.javacrumbs.jsonunit.core.Configuration; +import net.javacrumbs.jsonunit.core.ConfigurationWhen.ApplicableForPath; +import net.javacrumbs.jsonunit.core.ConfigurationWhen.PathsParam; import net.javacrumbs.jsonunit.core.Option; import net.javacrumbs.jsonunit.core.internal.Diff; import net.javacrumbs.jsonunit.core.internal.Options; import net.javacrumbs.jsonunit.core.listener.DifferenceListener; /** - * Сontains basic matcher functionality and implementation of methods for matching configuration. + * Contains basic matcher functionality and implementation of methods for matching configuration. * * @param the type */ @@ -54,6 +56,11 @@ public T when(final Option first, final Option... next) { return (T) this; } + public T when(final PathsParam pathsParam, final ApplicableForPath... applicableForPaths) { + this.configuration = this.configuration.when(pathsParam, applicableForPaths); + return (T) this; + } + public T withOptions(final Options options) { this.configuration = configuration.withOptions(options); return (T) this; diff --git a/allure-jsonunit/src/main/java/io/qameta/allure/jsonunit/AllureConfigurableJsonMatcher.java b/allure-jsonunit/src/main/java/io/qameta/allure/jsonunit/AllureConfigurableJsonMatcher.java index 07851666f..3b95e3348 100644 --- a/allure-jsonunit/src/main/java/io/qameta/allure/jsonunit/AllureConfigurableJsonMatcher.java +++ b/allure-jsonunit/src/main/java/io/qameta/allure/jsonunit/AllureConfigurableJsonMatcher.java @@ -25,7 +25,9 @@ /** * @param the type of matcher * @see net.javacrumbs.jsonunit.ConfigurableJsonMatcher + * @deprecated Use {@link net.javacrumbs.jsonunit.ConfigurableJsonMatcher} */ +@Deprecated public interface AllureConfigurableJsonMatcher extends Matcher { AllureConfigurableJsonMatcher withTolerance(BigDecimal tolerance); diff --git a/allure-jsonunit/src/main/java/io/qameta/allure/jsonunit/JsonPatchMatcher.java b/allure-jsonunit/src/main/java/io/qameta/allure/jsonunit/JsonPatchMatcher.java index b9f53b131..78bed71ed 100644 --- a/allure-jsonunit/src/main/java/io/qameta/allure/jsonunit/JsonPatchMatcher.java +++ b/allure-jsonunit/src/main/java/io/qameta/allure/jsonunit/JsonPatchMatcher.java @@ -17,6 +17,7 @@ import io.qameta.allure.attachment.DefaultAttachmentProcessor; import io.qameta.allure.attachment.FreemarkerAttachmentRenderer; +import net.javacrumbs.jsonunit.ConfigurableJsonMatcher; import net.javacrumbs.jsonunit.core.listener.DifferenceListener; import org.hamcrest.Description; @@ -28,8 +29,8 @@ * @param the type */ @SuppressWarnings("unused") -public final class JsonPatchMatcher extends AbstractJsonPatchMatcher> - implements AllureConfigurableJsonMatcher { +public final class JsonPatchMatcher extends AbstractJsonPatchMatcher> + implements ConfigurableJsonMatcher { private final Object expected; @@ -37,7 +38,7 @@ private JsonPatchMatcher(final Object expected) { this.expected = expected; } - public static AllureConfigurableJsonMatcher jsonEquals(final Object expected) { + public static ConfigurableJsonMatcher jsonEquals(final Object expected) { return new JsonPatchMatcher(expected); } diff --git a/allure-junit-platform/src/main/java/io/qameta/allure/junitplatform/AllureJunitPlatform.java b/allure-junit-platform/src/main/java/io/qameta/allure/junitplatform/AllureJunitPlatform.java index 5bd8211d9..137e24df5 100644 --- a/allure-junit-platform/src/main/java/io/qameta/allure/junitplatform/AllureJunitPlatform.java +++ b/allure-junit-platform/src/main/java/io/qameta/allure/junitplatform/AllureJunitPlatform.java @@ -310,6 +310,7 @@ public void reportingEntryPublished(final TestIdentifier testIdentifier, } + @SuppressWarnings("PMD.InefficientEmptyStringCheck") private Map unwrap(final Map data) { final Map res = new HashMap<>(); data.forEach((key, value) -> { diff --git a/allure-junit4/src/main/java/io/qameta/allure/junit4/AllureJunit4.java b/allure-junit4/src/main/java/io/qameta/allure/junit4/AllureJunit4.java index ed594591b..b652feb08 100644 --- a/allure-junit4/src/main/java/io/qameta/allure/junit4/AllureJunit4.java +++ b/allure-junit4/src/main/java/io/qameta/allure/junit4/AllureJunit4.java @@ -180,7 +180,6 @@ private Optional getDisplayName(final Description result) { .map(DisplayName::value); } - @SuppressWarnings("PMD.AvoidLiteralsInIfCondition") private Optional getDescription(final Description result) { final io.qameta.allure.Description annotation = result .getAnnotation(io.qameta.allure.Description.class); diff --git a/allure-junit4/src/main/java/io/qameta/allure/junit4/AllureJunit4Utils.java b/allure-junit4/src/main/java/io/qameta/allure/junit4/AllureJunit4Utils.java index ebe87e56b..24fa2a8a2 100644 --- a/allure-junit4/src/main/java/io/qameta/allure/junit4/AllureJunit4Utils.java +++ b/allure-junit4/src/main/java/io/qameta/allure/junit4/AllureJunit4Utils.java @@ -78,10 +78,7 @@ static class CucumberCheck implements Serializable { @Override public boolean equals(final Object obj) { - if (Objects.isNull(obj)) { - return false; - } - return "io.cucumber.junit.PickleRunners.PickleId" + return !Objects.isNull(obj) && "io.cucumber.junit.PickleRunners.PickleId" .equals(obj.getClass().getCanonicalName()); } diff --git a/allure-junit5/src/main/java/io/qameta/allure/junit5/AllureJunit5.java b/allure-junit5/src/main/java/io/qameta/allure/junit5/AllureJunit5.java index 6ede30ed2..7413d70a2 100644 --- a/allure-junit5/src/main/java/io/qameta/allure/junit5/AllureJunit5.java +++ b/allure-junit5/src/main/java/io/qameta/allure/junit5/AllureJunit5.java @@ -187,6 +187,7 @@ public Map buildFailureEvent(final String type, return map; } + @SuppressWarnings("PMD.InefficientEmptyStringCheck") public Map wrap(final Map data) { final Map res = new HashMap<>(); data.forEach((key, value) -> { diff --git a/allure-karate/build.gradle.kts b/allure-karate/build.gradle.kts index f300ed9fd..f30a20467 100644 --- a/allure-karate/build.gradle.kts +++ b/allure-karate/build.gradle.kts @@ -1,6 +1,6 @@ description = "Allure Karate Integration" -val karateVersion = "1.4.0" +val karateVersion = "1.4.1" configurations { testImplementation { diff --git a/allure-karate/src/main/java/io/qameta/allure/karate/AllureKarate.java b/allure-karate/src/main/java/io/qameta/allure/karate/AllureKarate.java index 310d6c75d..2c629a9f2 100644 --- a/allure-karate/src/main/java/io/qameta/allure/karate/AllureKarate.java +++ b/allure-karate/src/main/java/io/qameta/allure/karate/AllureKarate.java @@ -26,7 +26,6 @@ import com.intuit.karate.core.StepResult; import io.qameta.allure.Allure; import io.qameta.allure.AllureLifecycle; -import io.qameta.allure.model.Attachment; import io.qameta.allure.model.Label; import io.qameta.allure.model.Link; import io.qameta.allure.model.Parameter; @@ -50,8 +49,6 @@ import java.util.Optional; import java.util.Set; import java.util.UUID; -import java.util.concurrent.locks.ReadWriteLock; -import java.util.concurrent.locks.ReentrantReadWriteLock; import java.util.stream.Collectors; import static io.qameta.allure.util.ResultsUtils.createLabel; @@ -71,11 +68,6 @@ public class AllureKarate implements RuntimeHook { private final AllureLifecycle lifecycle; - private final ReadWriteLock lock = new ReentrantReadWriteLock(); - - private final Map stepsAndTcUuids = new HashMap<>(); - private final Map stepAndUuids = new HashMap<>(); - private final List tcUuids = new ArrayList<>(); public AllureKarate() { @@ -221,14 +213,6 @@ public void afterStep(final StepResult result, }); lifecycle.stopStep(uuid); - if (stepResult.isFailed() - && sr.engine.getConfig().getDriverOptions() != null - && (Boolean) sr.engine.getConfig().getDriverOptions().get("screenshotOnFailure") - ) { - addToStepsAndTcUuids(uuid, lifecycle.getCurrentTestCase().get()); - addToStepAndUuids(uuid, step); - } - if (Objects.nonNull(result.getEmbeds())) { result.getEmbeds().forEach(embed -> { try (InputStream is = new BufferedInputStream(Files.newInputStream(embed.getFile().toPath()))) { @@ -248,30 +232,6 @@ public void afterStep(final StepResult result, @Override public void afterFeature(final FeatureRuntime fr) { - - if (!stepsAndTcUuids.isEmpty()) { - fr.result.getScenarioResults() - .forEach(sc -> { - if (Objects.nonNull(sc.getFailedStep())) { - getKeySetFromStepAndUuids().forEach(uuid -> { - if (getValueFromStepAndUuids(uuid) == sc.getFailedStep().getStep()) { - final List attachments = new ArrayList<>(); - sc.getFailedStep().getEmbeds().forEach(e -> attachments.add( - new Attachment() - .setSource(e.getFile().getPath()) - .setType(e.getResourceType().contentType) - .setName(e.getFile().getName()) - ) - ); - lifecycle.updateTestCase(getValueFromStepsAndTcUuids(uuid), result -> - result.setAttachments(attachments) - ); - } - }); - } - }); - } - tcUuids.forEach(lifecycle::writeTestCase); } @@ -321,49 +281,4 @@ private List getLinks(final List labels) { } return allureLinks; } - - private void addToStepsAndTcUuids(final String stepUuid, final String tcUuid) { - lock.writeLock().lock(); - try { - stepsAndTcUuids.put(stepUuid, tcUuid); - } finally { - lock.writeLock().unlock(); - } - } - - private void addToStepAndUuids(final String stepUuid, final Step step) { - lock.writeLock().lock(); - try { - stepAndUuids.put(stepUuid, step); - } finally { - lock.writeLock().unlock(); - } - } - - private String getValueFromStepsAndTcUuids(final String stepUuid) { - lock.readLock().lock(); - try { - return stepsAndTcUuids.get(stepUuid); - } finally { - lock.readLock().unlock(); - } - } - - private Step getValueFromStepAndUuids(final String stepUuid) { - lock.readLock().lock(); - try { - return stepAndUuids.get(stepUuid); - } finally { - lock.readLock().unlock(); - } - } - - private Set getKeySetFromStepAndUuids() { - lock.readLock().lock(); - try { - return stepAndUuids.keySet(); - } finally { - lock.readLock().unlock(); - } - } } diff --git a/allure-model/src/main/java/io/qameta/allure/model/Stage.java b/allure-model/src/main/java/io/qameta/allure/model/Stage.java index 697478122..ff08a6149 100644 --- a/allure-model/src/main/java/io/qameta/allure/model/Stage.java +++ b/allure-model/src/main/java/io/qameta/allure/model/Stage.java @@ -57,7 +57,7 @@ public enum Stage { * @return the stage */ public static Stage fromValue(final String v) { - for (Stage c : Stage.values()) { + for (Stage c : values()) { if (c.value.equals(v)) { return c; } diff --git a/allure-model/src/main/java/io/qameta/allure/model/Status.java b/allure-model/src/main/java/io/qameta/allure/model/Status.java index 15c275bd2..37ed668f2 100644 --- a/allure-model/src/main/java/io/qameta/allure/model/Status.java +++ b/allure-model/src/main/java/io/qameta/allure/model/Status.java @@ -54,7 +54,7 @@ public enum Status { * @return the status */ public static Status fromValue(final String v) { - for (Status c : Status.values()) { + for (Status c : values()) { if (c.value.equals(v)) { return c; } diff --git a/allure-rest-assured/build.gradle.kts b/allure-rest-assured/build.gradle.kts index ba734a063..809f433b5 100644 --- a/allure-rest-assured/build.gradle.kts +++ b/allure-rest-assured/build.gradle.kts @@ -1,6 +1,6 @@ description = "Allure Rest-Assured Integration" -val restAssuredVersion = "5.3.1" +val restAssuredVersion = "5.5.0" dependencies { api(project(":allure-attachments")) diff --git a/allure-scalatest/build.gradle.kts b/allure-scalatest/build.gradle.kts index 910d28ad2..aae6abbc4 100644 --- a/allure-scalatest/build.gradle.kts +++ b/allure-scalatest/build.gradle.kts @@ -1,87 +1,90 @@ -import org.gradle.jvm.tasks.Jar - description = "Allure ScalaTest Integration" -apply(plugin = "scala") - -val availableScalaVersions = listOf("2.11", "2.12", "2.13") -val defaultScala211Version = "2.11.12" -val defaultScala212Version = "2.12.8" -val defaultScala213Version = "2.13.1" - -var selectedScalaVersion = defaultScala213Version - -if (hasProperty("scalaVersion")) { - val scalaVersion: String by project - selectedScalaVersion = when (scalaVersion) { - "2.11" -> defaultScala211Version - "2.12" -> defaultScala212Version - "2.13" -> defaultScala213Version - else -> scalaVersion - } +plugins { + scala + id("com.github.prokod.gradle-crossbuild") version "0.16.0" } -val baseScalaVersion = selectedScalaVersion.substring(0, selectedScalaVersion.lastIndexOf(".")) -project.base.archivesName.set("allure-scalatest_$baseScalaVersion") - -for (sv in availableScalaVersions) { - val taskSuffix = sv.replace('.', '_') - - tasks.create("jarScala_$taskSuffix", GradleBuild::class) { - startParameter = project.gradle.startParameter.newInstance() - startParameter.projectProperties["scalaVersion"] = sv - tasks = listOf("jar") - } - - tasks.create("testScala_$taskSuffix", GradleBuild::class) { - startParameter = project.gradle.startParameter.newInstance() - startParameter.projectProperties["scalaVersion"] = sv - tasks = listOf("test") - } - - tasks.create("sourceJarScala_$taskSuffix", GradleBuild::class) { - startParameter = project.gradle.startParameter.newInstance() - startParameter.projectProperties["scalaVersion"] = sv - tasks = listOf("sourceJar") - } +val scala212 = "2.12" +val scala213 = "2.13" - tasks.create("scaladocJarScala_$taskSuffix", GradleBuild::class) { - startParameter = project.gradle.startParameter.newInstance() - startParameter.projectProperties["scalaVersion"] = sv - tasks = listOf("scaladocJar") - } +project.base.archivesName.set("allure-scalatest") - tasks.create("installScala_$taskSuffix", GradleBuild::class) { - startParameter = project.gradle.startParameter.newInstance() - startParameter.projectProperties["scalaVersion"] = sv - tasks = listOf("install") +crossBuild { + scalaVersionsCatalog = mapOf( + scala212 to "2.12.19", + scala213 to "2.13.14" + ) + builds { + register("scala") { + scalaVersions = setOf(scala212, scala213) + } } } -val jarAll by tasks.creating { - dependsOn(availableScalaVersions.map { "jarScala_${it.replace('.', '_')}" }) +tasks.publishMavenPublicationToMavenLocal { + enabled = false } - -val testAll by tasks.creating { - dependsOn(availableScalaVersions.map { "testScala_${it.replace('.', '_')}" }) +tasks.publishMavenPublicationToSonatypeRepository { + enabled = false } - -val sourceJarAll by tasks.creating { - dependsOn(availableScalaVersions.map { "sourceJarScala_${it.replace('.', '_')}" }) +tasks.signMavenPublication { + enabled = false +} +tasks.sourcesJar { + enabled = false } -val scaladocJarAll by tasks.creating { - dependsOn(availableScalaVersions.map { "scaladocJarScala_${it.replace('.', '_')}" }) +publishing { + publications { + create("crossBuildScala_212") { + from(components["crossBuildScala_212"]) + + val crossBuildScala_212SourcesJar by tasks.creating(Jar::class) { + from(sourceSets["crossBuildScala_212"].allSource) + archiveBaseName.set("allure-scalatest_$scala212") + archiveClassifier.set("sources") + } + artifact(crossBuildScala_212SourcesJar) + + val crossBuildScala_212ScaladocJar by tasks.creating(Jar::class) { + from(tasks.scaladoc) + archiveBaseName.set("allure-scalatest_$scala212") + archiveClassifier.set("javadoc") + } + artifact(crossBuildScala_212ScaladocJar) + } + create("crossBuildScala_213") { + from(components["crossBuildScala_213"]) + + val crossBuildScala_213SourcesJar by tasks.creating(Jar::class) { + from(sourceSets["crossBuildScala_213"].allSource) + archiveBaseName.set("allure-scalatest_$scala213") + archiveClassifier.set("sources") + } + artifact(crossBuildScala_213SourcesJar) + + val crossBuildScala_213ScaladocJar by tasks.creating(Jar::class) { + from(tasks.scaladoc) + archiveBaseName.set("allure-scalatest_$scala213") + archiveClassifier.set("javadoc") + } + artifact(crossBuildScala_213ScaladocJar) + } + } } -val installAll by tasks.creating { - dependsOn(availableScalaVersions.map { "installScala_${it.replace('.', '_')}" }) +signing { + sign( + publishing.publications["crossBuildScala_212"], + publishing.publications["crossBuildScala_213"] + ) } dependencies { api(project(":allure-java-commons")) - implementation("org.scalatest:scalatest_$baseScalaVersion:3.1.1") - implementation("org.scala-lang.modules:scala-collection-compat_$baseScalaVersion:2.1.4") + implementation("org.scalatest:scalatest_$scala213:3.2.19") + implementation("org.scala-lang.modules:scala-collection-compat_$scala213:2.12.0") testAnnotationProcessor(project(":allure-descriptions-javadoc")) testImplementation("io.github.glytching:junit-extensions") testImplementation("org.assertj:assertj-core") @@ -94,18 +97,13 @@ dependencies { testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine") } -val scaladocJar by tasks.creating(Jar::class) { - from(tasks.getByName("scaladoc")) - archiveClassifier.set("scaladoc") -} - -artifacts.add("archives", scaladocJar) - tasks.jar { manifest { - attributes(mapOf( + attributes( + mapOf( "Automatic-Module-Name" to "io.qameta.allure.scalatest" - )) + ) + ) } } diff --git a/allure-selenide/build.gradle.kts b/allure-selenide/build.gradle.kts index 39ca99aa1..9e086e1d8 100644 --- a/allure-selenide/build.gradle.kts +++ b/allure-selenide/build.gradle.kts @@ -1,6 +1,6 @@ description = "Allure Selenide Integration" -val selenideVersion = "6.17.1" +val selenideVersion = "7.3.3" dependencies { api(project(":allure-java-commons")) @@ -15,14 +15,23 @@ dependencies { testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine") } -tasks.jar { - manifest { - attributes(mapOf( - "Automatic-Module-Name" to "io.qameta.allure.selenide" - )) +tasks { + compileJava { + options.release.set(17) + } + compileTestJava { + options.release.set(17) + } + jar { + manifest { + attributes( + mapOf( + "Automatic-Module-Name" to "io.qameta.allure.selenide" + ) + ) + } + } + test { + useJUnitPlatform() } -} - -tasks.test { - useJUnitPlatform() } diff --git a/allure-selenide/src/main/java/io/qameta/allure/selenide/AllureSelenide.java b/allure-selenide/src/main/java/io/qameta/allure/selenide/AllureSelenide.java index ca06a32b4..1f320f68b 100644 --- a/allure-selenide/src/main/java/io/qameta/allure/selenide/AllureSelenide.java +++ b/allure-selenide/src/main/java/io/qameta/allure/selenide/AllureSelenide.java @@ -31,7 +31,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.HashMap; +import java.util.EnumMap; import java.util.Map; import java.util.Optional; import java.util.UUID; @@ -52,7 +52,7 @@ public class AllureSelenide implements LogEventListener { private boolean saveScreenshots = true; private boolean savePageHtml = true; private boolean includeSelenideLocatorsSteps = true; - private final Map logTypesToSave = new HashMap<>(); + private final Map logTypesToSave = new EnumMap<>(LogType.class); private final AllureLifecycle lifecycle; public AllureSelenide() { @@ -93,8 +93,8 @@ public AllureSelenide disableLogs(final LogType logType) { private static Optional getScreenshotBytes() { try { return WebDriverRunner.hasWebDriverStarted() - ? Optional.of(((TakesScreenshot) WebDriverRunner.getWebDriver()).getScreenshotAs(OutputType.BYTES)) - : Optional.empty(); + ? Optional.of(((TakesScreenshot) WebDriverRunner.getWebDriver()).getScreenshotAs(OutputType.BYTES)) + : Optional.empty(); } catch (WebDriverException e) { LOGGER.warn("Could not get screen shot", e); return Optional.empty(); @@ -104,8 +104,8 @@ private static Optional getScreenshotBytes() { private static Optional getPageSourceBytes() { try { return WebDriverRunner.hasWebDriverStarted() - ? Optional.of(WebDriverRunner.getWebDriver().getPageSource().getBytes(UTF_8)) - : Optional.empty(); + ? Optional.of(WebDriverRunner.getWebDriver().getPageSource().getBytes(UTF_8)) + : Optional.empty(); } catch (WebDriverException e) { LOGGER.warn("Could not get page source", e); return Optional.empty(); diff --git a/allure-spock/build.gradle.kts b/allure-spock/build.gradle.kts index 9fbbe98ae..f65503f4d 100644 --- a/allure-spock/build.gradle.kts +++ b/allure-spock/build.gradle.kts @@ -3,7 +3,7 @@ description = "Allure Spock Framework Integration" apply(plugin = "groovy") val spockFrameworkVersion = "1.3-groovy-2.5" -val groovyVersion = "2.5.19" +val groovyVersion = "2.5.23" dependencies { api(project(":allure-java-commons")) diff --git a/allure-spock2/build.gradle.kts b/allure-spock2/build.gradle.kts index 50c5c4ba9..fbbe45a55 100644 --- a/allure-spock2/build.gradle.kts +++ b/allure-spock2/build.gradle.kts @@ -5,7 +5,7 @@ plugins { } val spockFrameworkVersion = "2.3-groovy-3.0" -val groovyVersion = "3.0.13" +val groovyVersion = "3.0.22" dependencies { api(project(":allure-java-commons")) diff --git a/allure-spring-web/build.gradle.kts b/allure-spring-web/build.gradle.kts index 5d7d4fcda..07f258185 100644 --- a/allure-spring-web/build.gradle.kts +++ b/allure-spring-web/build.gradle.kts @@ -1,6 +1,6 @@ description = "Allure Spring Web Integration" -val springWebVersion = "5.3.20" +val springWebVersion = "5.3.37" dependencies { api(project(":allure-attachments")) diff --git a/allure-test-filter/build.gradle.kts b/allure-test-filter/build.gradle.kts index 547df0125..b2198ce39 100644 --- a/allure-test-filter/build.gradle.kts +++ b/allure-test-filter/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("com.github.johnrengelman.shadow") + id("io.github.goooler.shadow") } description = "Allure Test Filter" diff --git a/build.gradle.kts b/build.gradle.kts index 69a89cf1b..ce3370c87 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -27,7 +27,7 @@ plugins { java { toolchain { - languageVersion.set(JavaLanguageVersion.of(17)) + languageVersion.set(JavaLanguageVersion.of(21)) } } @@ -56,13 +56,7 @@ configure(subprojects) { publishing { publications { - create("maven") { - suppressAllPomMetadataWarnings() - versionMapping { - allVariants { - fromResolutionResult() - } - } + withType().configureEach { pom { name.set(project.name) description.set("Module ${project.name} of Allure Framework.") @@ -106,6 +100,14 @@ configure(subprojects) { } } } + create("maven") { + suppressAllPomMetadataWarnings() + versionMapping { + allVariants { + fromResolutionResult() + } + } + } } } @@ -139,38 +141,38 @@ configure(libs) { apply(plugin = "java") apply(plugin = "java-library") - val orgSlf4jVersion = "1.7.36" - val assertJVersion = "1.9.9.1" + val orgSlf4jVersion = "2.0.13" + val assertJVersion = "1.9.22.1" dependencyManagement { imports { - mavenBom("com.fasterxml.jackson:jackson-bom:2.14.1") - mavenBom("org.junit:junit-bom:5.9.2") + mavenBom("com.fasterxml.jackson:jackson-bom:2.17.2") + mavenBom("org.junit:junit-bom:5.10.3") } dependencies { - dependency("com.github.spotbugs:spotbugs:4.8.3") + dependency("com.github.spotbugs:spotbugs:4.8.6") dependency("com.github.tomakehurst:wiremock:3.0.1") - dependency("com.google.inject:guice:5.1.0") - dependency("com.google.testing.compile:compile-testing:0.19") - dependency("com.puppycrawl.tools:checkstyle:10.13.0") - dependency("com.squareup.retrofit2:retrofit:2.9.0") - dependency("commons-io:commons-io:2.11.0") + dependency("com.google.inject:guice:7.0.0") + dependency("com.google.testing.compile:compile-testing:0.21.0") + dependency("com.puppycrawl.tools:checkstyle:10.17.0") + dependency("com.squareup.retrofit2:retrofit:2.11.0") + dependency("commons-io:commons-io:2.16.1") dependency("io.github.benas:random-beans:3.9.0") dependency("io.github.glytching:junit-extensions:2.6.0") dependency("javax.annotation:javax.annotation-api:1.3.2") - dependency("net.sourceforge.pmd:pmd-java:6.55.0") - dependency("org.apache.commons:commons-lang3:3.12.0") - dependency("org.apache.httpcomponents:httpclient:4.5.13") - dependency("org.apache.httpcomponents.client5:httpclient5:5.2.1") + dependency("net.sourceforge.pmd:pmd-java:7.3.0") + dependency("org.apache.commons:commons-lang3:3.15.0") + dependency("org.apache.httpcomponents:httpclient:4.5.14") + dependency("org.apache.httpcomponents.client5:httpclient5:5.3.1") dependency("org.aspectj:aspectjrt:${assertJVersion}") dependency("org.aspectj:aspectjweaver:${assertJVersion}") - dependency("org.assertj:assertj-core:3.23.1") - dependency("org.freemarker:freemarker:2.3.31") + dependency("org.assertj:assertj-core:3.26.3") + dependency("org.freemarker:freemarker:2.3.33") dependency("org.grpcmock:grpcmock-junit5:0.8.0") dependency("org.hamcrest:hamcrest:2.2") - dependency("org.jboss.resteasy:resteasy-client:6.2.1.Final") + dependency("org.jboss.resteasy:resteasy-client:6.2.9.Final") dependency("org.mock-server:mockserver-netty:5.15.0") - dependency("org.mockito:mockito-core:5.10.0") + dependency("org.mockito:mockito-core:5.12.0") dependency("org.slf4j:slf4j-api:${orgSlf4jVersion}") dependency("org.slf4j:slf4j-nop:${orgSlf4jVersion}") dependency("org.slf4j:slf4j-simple:${orgSlf4jVersion}") @@ -193,6 +195,7 @@ configure(libs) { tasks { compileJava { + options.compilerArgs.add("-Xlint:-options") if (JavaVersion.current().isJava8) { java.targetCompatibility = JavaVersion.VERSION_1_8 } else { diff --git a/gradle.properties b/gradle.properties index c5f5a795d..23a27d98f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -version=2.27.0 +version=2.28.1 org.gradle.daemon=true org.gradle.parallel=true diff --git a/gradle/quality-configs/checkstyle/checkstyle.xml b/gradle/quality-configs/checkstyle/checkstyle.xml index f1bbd4945..8e3f80a29 100644 --- a/gradle/quality-configs/checkstyle/checkstyle.xml +++ b/gradle/quality-configs/checkstyle/checkstyle.xml @@ -44,7 +44,7 @@ - + @@ -86,7 +86,9 @@ - + + + @@ -152,10 +154,10 @@ - - + + - + @@ -211,7 +213,7 @@ - + diff --git a/gradle/quality-configs/pmd/pmd.xml b/gradle/quality-configs/pmd/pmd.xml index 7a26c293e..adc57b64f 100644 --- a/gradle/quality-configs/pmd/pmd.xml +++ b/gradle/quality-configs/pmd/pmd.xml @@ -26,9 +26,7 @@ - - @@ -45,6 +43,7 @@ + @@ -57,17 +56,15 @@ + + - - - - @@ -112,13 +109,13 @@ - + + - diff --git a/gradle/quality-configs/spotbugs/exclude.xml b/gradle/quality-configs/spotbugs/exclude.xml index 0b8a2de89..f942c310b 100644 --- a/gradle/quality-configs/spotbugs/exclude.xml +++ b/gradle/quality-configs/spotbugs/exclude.xml @@ -6,6 +6,9 @@ + + + diff --git a/settings.gradle.kts b/settings.gradle.kts index 487d5b0ad..063c8ebcc 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -47,32 +47,33 @@ pluginManagement { gradlePluginPortal() } plugins { - id("com.diffplug.spotless") version "6.11.0" - id("com.github.johnrengelman.shadow") version "8.1.1" - id("com.gradle.enterprise") version "3.12.5" - id("io.github.gradle-nexus.publish-plugin") version "1.1.0" + id("com.diffplug.spotless") version "6.25.0" + id("io.github.goooler.shadow") version "8.1.8" + id("com.gradle.enterprise") version "3.17.5" + id("io.github.gradle-nexus.publish-plugin") version "2.0.0" id("io.qameta.allure-adapter") version "2.11.2" id("io.qameta.allure-aggregate-report") version "2.11.2" id("io.qameta.allure-download") version "2.11.2" id("io.qameta.allure-report") version "2.11.2" - id("io.spring.dependency-management") version "1.1.0" - id("com.google.protobuf") version "0.9.1" - id("com.github.spotbugs") version "6.0.6" - kotlin("jvm") version "1.7.10" + id("io.spring.dependency-management") version "1.1.6" + id("com.google.protobuf") version "0.9.4" + id("com.github.spotbugs") version "6.0.19" + kotlin("jvm") version "2.0.0" } } plugins { - id("com.gradle.enterprise") + id("com.gradle.develocity") version "3.17.5" apply false } val isCiServer = System.getenv().containsKey("CI") if (isCiServer) { - gradleEnterprise { + apply(plugin = "com.gradle.develocity") + develocity { buildScan { - termsOfServiceUrl = "https://gradle.com/terms-of-service" - termsOfServiceAgree = "yes" + termsOfUseUrl = "https://gradle.com/terms-of-service" + termsOfUseAgree = "yes" tag("CI") } }