From 7f98bbde64b1f63f141c7fd02aa697ec4dfd2c55 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Thu, 4 Jan 2024 12:39:39 +0100 Subject: [PATCH] fix pitest, spotless and cleanup --- build.gradle | 12 +++++++++--- .../HsOfficeCoopAssetsTransactionEntity.java | 2 -- .../HsOfficeCoopAssetsTransactionRepository.java | 1 - .../HsOfficeCoopSharesTransactionEntity.java | 2 -- .../office/membership/HsOfficeMembershipEntity.java | 1 - .../hs/office/person/HsOfficePersonEntity.java | 2 -- .../relationship/HsOfficeRelationshipEntity.java | 2 -- .../hsadminng/test/cust/TestCustomerController.java | 1 - .../office/bankaccount/TestHsOfficeBankAccount.java | 1 - .../hs/office/contact/TestHsOfficeContact.java | 1 - .../hs/office/debitor/TestHsOfficeDebitor.java | 1 - .../hs/office/membership/TestHsMembership.java | 1 - .../hs/office/partner/TestHsOfficePartner.java | 1 - .../hs/office/person/TestHsOfficePerson.java | 1 - .../HsOfficeSepaMandateEntityUnitTest.java | 1 - .../hsadminng/test/cust/TestCustomer.java | 1 - 16 files changed, 9 insertions(+), 22 deletions(-) diff --git a/build.gradle b/build.gradle index 47dae2ac..968b80d1 100644 --- a/build.gradle +++ b/build.gradle @@ -182,7 +182,7 @@ openApiGenerate.dependsOn processSpring // Spotless Code Formatting spotless { java { - // removeUnusedImports() TODO: reactivate once it can deal with multi-line-strings + removeUnusedImports() indentWithSpaces(4) endWithNewline() toggleOffOn() @@ -193,8 +193,14 @@ spotless { } } } -project.tasks.spotlessJava.dependsOn(tasks.generateLicenseReport, tasks.processResources, tasks.processTestResources) project.tasks.check.dependsOn(spotlessCheck) +// HACK: no idea why spotless uses the output of these tasks, but we get warnings without those +project.tasks.spotlessJava.dependsOn( + tasks.generateLicenseReport, + tasks.pitest, + tasks.jacocoTestReport, + tasks.processResources, + tasks.processTestResources) // OWASP Dependency Security Test dependencyCheck { @@ -302,7 +308,7 @@ pitest { targetTests = ['net.hostsharing.hsadminng.**.*UnitTest', 'net.hostsharing.hsadminng.**.*RestTest'] excludedTestClasses = ['**AcceptanceTest*', '**IntegrationTest*'] - pitestVersion = '1.9.9' + pitestVersion = '1.15.3' junit5PluginVersion = '1.1.0' threads = 4 diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionEntity.java b/src/main/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionEntity.java index 9f8bc335..e699fb5c 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionEntity.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionEntity.java @@ -1,13 +1,11 @@ package net.hostsharing.hsadminng.hs.office.coopassets; -import com.vladmihalcea.hibernate.type.basic.PostgreSQLEnumType; import lombok.*; import net.hostsharing.hsadminng.errors.DisplayName; import net.hostsharing.hsadminng.hs.office.membership.HsOfficeMembershipEntity; import net.hostsharing.hsadminng.stringify.Stringify; import net.hostsharing.hsadminng.stringify.Stringifyable; import org.hibernate.annotations.GenericGenerator; -import org.hibernate.annotations.Type; import jakarta.persistence.*; import java.math.BigDecimal; diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionRepository.java b/src/main/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionRepository.java index 1a14abde..256933b9 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionRepository.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/coopassets/HsOfficeCoopAssetsTransactionRepository.java @@ -1,6 +1,5 @@ package net.hostsharing.hsadminng.hs.office.coopassets; -import net.hostsharing.hsadminng.hs.office.coopshares.HsOfficeCoopSharesTransactionEntity; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.Repository; diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionEntity.java b/src/main/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionEntity.java index db664ada..b5d4979b 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionEntity.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/coopshares/HsOfficeCoopSharesTransactionEntity.java @@ -1,12 +1,10 @@ package net.hostsharing.hsadminng.hs.office.coopshares; -import com.vladmihalcea.hibernate.type.basic.PostgreSQLEnumType; import lombok.*; import net.hostsharing.hsadminng.errors.DisplayName; import net.hostsharing.hsadminng.hs.office.membership.HsOfficeMembershipEntity; import net.hostsharing.hsadminng.stringify.Stringify; import net.hostsharing.hsadminng.stringify.Stringifyable; -import org.hibernate.annotations.Type; import jakarta.persistence.*; import java.time.LocalDate; diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipEntity.java b/src/main/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipEntity.java index fe88d066..671ae7f7 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipEntity.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/membership/HsOfficeMembershipEntity.java @@ -1,6 +1,5 @@ package net.hostsharing.hsadminng.hs.office.membership; -import com.vladmihalcea.hibernate.type.basic.PostgreSQLEnumType; import com.vladmihalcea.hibernate.type.range.PostgreSQLRangeType; import com.vladmihalcea.hibernate.type.range.Range; import lombok.*; diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonEntity.java b/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonEntity.java index 665f3e5c..a76d4130 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonEntity.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonEntity.java @@ -1,13 +1,11 @@ package net.hostsharing.hsadminng.hs.office.person; -import com.vladmihalcea.hibernate.type.basic.PostgreSQLEnumType; import lombok.*; import lombok.experimental.FieldNameConstants; import net.hostsharing.hsadminng.errors.DisplayName; import net.hostsharing.hsadminng.stringify.Stringify; import net.hostsharing.hsadminng.stringify.Stringifyable; import org.apache.commons.lang3.StringUtils; -import org.hibernate.annotations.Type; import jakarta.persistence.*; import java.util.UUID; diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipEntity.java b/src/main/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipEntity.java index 3b32fb72..383c6853 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipEntity.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/relationship/HsOfficeRelationshipEntity.java @@ -1,12 +1,10 @@ package net.hostsharing.hsadminng.hs.office.relationship; -import com.vladmihalcea.hibernate.type.basic.PostgreSQLEnumType; import lombok.*; import lombok.experimental.FieldNameConstants; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactEntity; import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity; import net.hostsharing.hsadminng.stringify.Stringify; -import org.hibernate.annotations.Type; import jakarta.persistence.*; import java.util.UUID; diff --git a/src/main/java/net/hostsharing/hsadminng/test/cust/TestCustomerController.java b/src/main/java/net/hostsharing/hsadminng/test/cust/TestCustomerController.java index 530a7006..1bd000ba 100644 --- a/src/main/java/net/hostsharing/hsadminng/test/cust/TestCustomerController.java +++ b/src/main/java/net/hostsharing/hsadminng/test/cust/TestCustomerController.java @@ -11,7 +11,6 @@ import org.springframework.web.bind.annotation.RestController; import org.springframework.web.servlet.mvc.method.annotation.MvcUriComponentsBuilder; import java.util.List; -import java.util.UUID; @RestController public class TestCustomerController implements TestCustomersApi { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/bankaccount/TestHsOfficeBankAccount.java b/src/test/java/net/hostsharing/hsadminng/hs/office/bankaccount/TestHsOfficeBankAccount.java index 7bb7de7e..7b7505f4 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/bankaccount/TestHsOfficeBankAccount.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/bankaccount/TestHsOfficeBankAccount.java @@ -1,6 +1,5 @@ package net.hostsharing.hsadminng.hs.office.bankaccount; -import java.util.UUID; public class TestHsOfficeBankAccount { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/contact/TestHsOfficeContact.java b/src/test/java/net/hostsharing/hsadminng/hs/office/contact/TestHsOfficeContact.java index 58284258..b42ef8e5 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/contact/TestHsOfficeContact.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/contact/TestHsOfficeContact.java @@ -1,6 +1,5 @@ package net.hostsharing.hsadminng.hs.office.contact; -import java.util.UUID; public class TestHsOfficeContact { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/TestHsOfficeDebitor.java b/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/TestHsOfficeDebitor.java index 9d2c6b7f..d9d482ba 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/TestHsOfficeDebitor.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/debitor/TestHsOfficeDebitor.java @@ -2,7 +2,6 @@ package net.hostsharing.hsadminng.hs.office.debitor; import lombok.experimental.UtilityClass; -import java.util.UUID; import static net.hostsharing.hsadminng.hs.office.contact.TestHsOfficeContact.TEST_CONTACT; import static net.hostsharing.hsadminng.hs.office.partner.TestHsOfficePartner.TEST_PARTNER; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/membership/TestHsMembership.java b/src/test/java/net/hostsharing/hsadminng/hs/office/membership/TestHsMembership.java index 1b40a4ce..d9245fc8 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/membership/TestHsMembership.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/membership/TestHsMembership.java @@ -3,7 +3,6 @@ package net.hostsharing.hsadminng.hs.office.membership; import com.vladmihalcea.hibernate.type.range.Range; import java.time.LocalDate; -import java.util.UUID; import static net.hostsharing.hsadminng.hs.office.partner.TestHsOfficePartner.TEST_PARTNER; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/partner/TestHsOfficePartner.java b/src/test/java/net/hostsharing/hsadminng/hs/office/partner/TestHsOfficePartner.java index 21756b6d..19235167 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/partner/TestHsOfficePartner.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/partner/TestHsOfficePartner.java @@ -3,7 +3,6 @@ package net.hostsharing.hsadminng.hs.office.partner; import net.hostsharing.hsadminng.hs.office.contact.HsOfficeContactEntity; import net.hostsharing.hsadminng.hs.office.person.HsOfficePersonEntity; -import java.util.UUID; import static net.hostsharing.hsadminng.hs.office.person.HsOfficePersonType.LEGAL; diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/person/TestHsOfficePerson.java b/src/test/java/net/hostsharing/hsadminng/hs/office/person/TestHsOfficePerson.java index f4d10fda..d394ee56 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/person/TestHsOfficePerson.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/person/TestHsOfficePerson.java @@ -1,6 +1,5 @@ package net.hostsharing.hsadminng.hs.office.person; -import java.util.UUID; public class TestHsOfficePerson { diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/sepamandate/HsOfficeSepaMandateEntityUnitTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/sepamandate/HsOfficeSepaMandateEntityUnitTest.java index 7ba77e0e..5d8fa5b5 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/sepamandate/HsOfficeSepaMandateEntityUnitTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/sepamandate/HsOfficeSepaMandateEntityUnitTest.java @@ -1,6 +1,5 @@ package net.hostsharing.hsadminng.hs.office.sepamandate; -import com.vladmihalcea.hibernate.type.range.Range; import net.hostsharing.hsadminng.hs.office.bankaccount.HsOfficeBankAccountEntity; import org.junit.jupiter.api.Test; diff --git a/src/test/java/net/hostsharing/hsadminng/test/cust/TestCustomer.java b/src/test/java/net/hostsharing/hsadminng/test/cust/TestCustomer.java index 7d5b0b43..bb00975f 100644 --- a/src/test/java/net/hostsharing/hsadminng/test/cust/TestCustomer.java +++ b/src/test/java/net/hostsharing/hsadminng/test/cust/TestCustomer.java @@ -1,6 +1,5 @@ package net.hostsharing.hsadminng.test.cust; -import static java.util.UUID.randomUUID; public class TestCustomer {