From 54de06be20401d2503307ea8e1e18af9c8fc7590 Mon Sep 17 00:00:00 2001 From: Wouter Born Date: Wed, 21 Oct 2026 10:33:24 +0200 Subject: [PATCH 1/2] Upgrade Spotless to 8.10.4 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 8852092..835b954 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,4 +15,4 @@ releasesRepoUrl=https://ossrh-staging-api.central.sonatype.com/service/local/ projectName = openremote-extensions ideaExtPluginVersion = 1.4.1 -spotlessVersion = 8.10.3 +spotlessVersion = 8.10.4 From 46c230eb2195c0d9520c9dabe5a3c6b039708005 Mon Sep 17 00:00:00 2001 From: Wouter Born Date: Wed, 21 Oct 2026 10:33:39 +0200 Subject: [PATCH 2/2] Apply Spotless --- deployment/build.gradle | 12 ++++---- .../ems/rules/EmsDemoSimulationRules.groovy | 4 +-- .../gopacs/GOPACSHandlerHttpTest.groovy | 14 +++++----- .../energy/EnergyOptimisationAssetTest.groovy | 8 +++--- .../energy/ForecastSolarServiceTest.groovy | 2 +- .../energy/ForecastWindServiceTest.groovy | 2 +- .../agent/protocol/EntsoeProtocolTest.groovy | 28 +++++++++---------- .../manager/HawkbitFirmwareServiceTest.groovy | 4 +-- project.gradle | 10 +++---- settings.gradle | 6 ++-- spotless.gradle | 6 ++-- 11 files changed, 48 insertions(+), 48 deletions(-) diff --git a/deployment/build.gradle b/deployment/build.gradle index 4b699d9..7bdccd9 100644 --- a/deployment/build.gradle +++ b/deployment/build.gradle @@ -59,24 +59,24 @@ def extensionProjects = rootProject.subprojects.findAll { def configureRuntimeAttributes = { configuration -> configuration.attributes { attribute( - Usage.USAGE_ATTRIBUTE, - objects.named(Usage, Usage.JAVA_RUNTIME) + Usage.USAGE_ATTRIBUTE, + objects.named(Usage, Usage.JAVA_RUNTIME) ) attribute( Category.CATEGORY_ATTRIBUTE, objects.named(Category, Category.LIBRARY) - ) + ) attribute( LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements, LibraryElements.JAR) - ) + ) attribute( TargetJvmEnvironment.TARGET_JVM_ENVIRONMENT_ATTRIBUTE, objects.named( TargetJvmEnvironment, TargetJvmEnvironment.STANDARD_JVM ) - ) + ) } } @@ -113,7 +113,7 @@ tasks.register("distributeExtensions", DistributeExtensions) { managerFiles.from(configurations.managerRuntime) destinationDirectory.set( layout.buildDirectory.dir("extensions") - ) + ) } tasks.register("installDist") { diff --git a/ems/src/main/resources/ems/rules/EmsDemoSimulationRules.groovy b/ems/src/main/resources/ems/rules/EmsDemoSimulationRules.groovy index 38314c8..27aa4db 100644 --- a/ems/src/main/resources/ems/rules/EmsDemoSimulationRules.groovy +++ b/ems/src/main/resources/ems/rules/EmsDemoSimulationRules.groovy @@ -243,8 +243,8 @@ rules.add() .then({ facts -> // Get power set-point for each battery def powerSetpointBatteries = facts - .matchAssetState(new AssetQuery().parents(energyOptimisationAssetId).attributeNames("powerSetpoint")) - .toList() + .matchAssetState(new AssetQuery().parents(energyOptimisationAssetId).attributeNames("powerSetpoint")) + .toList() String[] attributeNames = ["energyCapacity", "energyLevel", "energyLevelPercentage"] diff --git a/ems/src/test/groovy/org/openremote/extension/ems/manager/gopacs/GOPACSHandlerHttpTest.groovy b/ems/src/test/groovy/org/openremote/extension/ems/manager/gopacs/GOPACSHandlerHttpTest.groovy index 456a02a..9f0cfee 100644 --- a/ems/src/test/groovy/org/openremote/extension/ems/manager/gopacs/GOPACSHandlerHttpTest.groovy +++ b/ems/src/test/groovy/org/openremote/extension/ems/manager/gopacs/GOPACSHandlerHttpTest.groovy @@ -190,7 +190,7 @@ class GOPACSHandlerHttpTest extends Specification implements ManagerContainerTra and: "verifying the signature fetched an OAuth2 token and resolved the DSO via the address book" conditions.eventually { wireMock.verify(postRequestedFor(urlPathEqualTo(OAUTH_PATH)) - .withRequestBody(containing("grant_type=client_credentials"))) + .withRequestBody(containing("grant_type=client_credentials"))) wireMock.verify(getRequestedFor(urlPathEqualTo(ADDRESS_BOOK_PATH)) .withHeader("Authorization", equalTo("Bearer " + ACCESS_TOKEN))) } @@ -198,8 +198,8 @@ class GOPACSHandlerHttpTest extends Specification implements ManagerContainerTra and: "the FlexRequestResponse and FlexOffer are actually POSTed to the broker as signed XML with a bearer token" conditions.eventually { wireMock.verify(postRequestedFor(urlPathEqualTo(BROKER_PATH)) - .withHeader("Authorization", equalTo("Bearer " + ACCESS_TOKEN)) - .withRequestBody(containing("SignedMessage"))) + .withHeader("Authorization", equalTo("Bearer " + ACCESS_TOKEN)) + .withRequestBody(containing("SignedMessage"))) def payloads = decodedBrokerPayloads() assert payloads.any { it.contains("FlexRequestResponse") } assert payloads.any { it.contains("FlexOffer") } @@ -220,8 +220,8 @@ class GOPACSHandlerHttpTest extends Specification implements ManagerContainerTra and: "a FlexOrderResponse is POSTed to the broker as signed XML with a bearer token" conditions.eventually { wireMock.verify(postRequestedFor(urlPathEqualTo(BROKER_PATH)) - .withHeader("Authorization", equalTo("Bearer " + ACCESS_TOKEN)) - .withRequestBody(containing("SignedMessage"))) + .withHeader("Authorization", equalTo("Bearer " + ACCESS_TOKEN)) + .withRequestBody(containing("SignedMessage"))) assert decodedBrokerPayloads().any { it.contains("FlexOrderResponse") } } } @@ -240,8 +240,8 @@ class GOPACSHandlerHttpTest extends Specification implements ManagerContainerTra and: "a rejected FlexRequestResponse with a reason is delivered to the broker as signed XML" conditions.eventually { wireMock.verify(postRequestedFor(urlPathEqualTo(BROKER_PATH)) - .withHeader("Authorization", equalTo("Bearer " + ACCESS_TOKEN)) - .withRequestBody(containing("SignedMessage"))) + .withHeader("Authorization", equalTo("Bearer " + ACCESS_TOKEN)) + .withRequestBody(containing("SignedMessage"))) assert decodedBrokerPayloads().any { it.contains("FlexRequestResponse") && it.contains('Result="Rejected"') && it.contains("RejectionReason=") } diff --git a/energy/src/test/groovy/org/openremote/extension/energy/EnergyOptimisationAssetTest.groovy b/energy/src/test/groovy/org/openremote/extension/energy/EnergyOptimisationAssetTest.groovy index 0a24db0..e094a60 100644 --- a/energy/src/test/groovy/org/openremote/extension/energy/EnergyOptimisationAssetTest.groovy +++ b/energy/src/test/groovy/org/openremote/extension/energy/EnergyOptimisationAssetTest.groovy @@ -159,7 +159,7 @@ class EnergyOptimisationAssetTest extends Specification implements ManagerContai AssetDatapointIntervalQuery.Formula.AVG, true ) - ) + ) assert setpoints.size() == 7 assert setpoints[0].value == 0d @@ -191,7 +191,7 @@ class EnergyOptimisationAssetTest extends Specification implements ManagerContai AssetDatapointIntervalQuery.Formula.AVG, true ) - ) + ) assert setpoints.size() == 7 assert setpoints[0].value == 0d @@ -223,7 +223,7 @@ class EnergyOptimisationAssetTest extends Specification implements ManagerContai AssetDatapointIntervalQuery.Formula.AVG, true ) - ) + ) assert setpoints.size() == 7 assert setpoints[0].value == 0d @@ -335,7 +335,7 @@ class EnergyOptimisationAssetTest extends Specification implements ManagerContai AssetDatapointIntervalQuery.Formula.AVG, true ) - ) + ) assert setpoints.size() == 7 assert setpoints[0].value == 10d diff --git a/energy/src/test/groovy/org/openremote/extension/energy/ForecastSolarServiceTest.groovy b/energy/src/test/groovy/org/openremote/extension/energy/ForecastSolarServiceTest.groovy index 67bca10..e43dbe9 100644 --- a/energy/src/test/groovy/org/openremote/extension/energy/ForecastSolarServiceTest.groovy +++ b/energy/src/test/groovy/org/openremote/extension/energy/ForecastSolarServiceTest.groovy @@ -139,7 +139,7 @@ class ForecastSolarServiceTest extends Specification implements ManagerContainer def responseBody = ValueUtil.JSON.readValue(content, ForecastSolarService.EstimateResponse.class) requestContext.abortWith( Response.ok(responseBody, MediaType.APPLICATION_JSON_TYPE).build() - ) + ) return } diff --git a/energy/src/test/groovy/org/openremote/extension/energy/ForecastWindServiceTest.groovy b/energy/src/test/groovy/org/openremote/extension/energy/ForecastWindServiceTest.groovy index f48e576..9ab29db 100644 --- a/energy/src/test/groovy/org/openremote/extension/energy/ForecastWindServiceTest.groovy +++ b/energy/src/test/groovy/org/openremote/extension/energy/ForecastWindServiceTest.groovy @@ -650,7 +650,7 @@ class ForecastWindServiceTest extends Specification implements ManagerContainerT def responseBody = ValueUtil.JSON.readValue(content, ForecastWindService.WeatherForecastResponseModel.class) requestContext.abortWith( Response.ok(responseBody, MediaType.APPLICATION_JSON_TYPE).build() - ) + ) return } diff --git a/entsoe/src/test/groovy/org/openremote/extension/entsoe/agent/protocol/EntsoeProtocolTest.groovy b/entsoe/src/test/groovy/org/openremote/extension/entsoe/agent/protocol/EntsoeProtocolTest.groovy index d5cbe24..74adb21 100644 --- a/entsoe/src/test/groovy/org/openremote/extension/entsoe/agent/protocol/EntsoeProtocolTest.groovy +++ b/entsoe/src/test/groovy/org/openremote/extension/entsoe/agent/protocol/EntsoeProtocolTest.groovy @@ -381,7 +381,7 @@ class EntsoeProtocolTest extends Specification implements ManagerContainerTrait .addOrReplaceAttributes( new Attribute<>("energyPrice", NUMBER) .addOrReplaceMeta(new MetaItem<>(AGENT_LINK, entsoeLink)) - ) + ) asset = assetStorageService.merge(asset) def attributeRef = new AttributeRef(asset.id, "energyPrice") @@ -459,7 +459,7 @@ class EntsoeProtocolTest extends Specification implements ManagerContainerTrait .addOrReplaceAttributes( new Attribute<>("energyPrice", NUMBER) .addOrReplaceMeta(new MetaItem<>(AGENT_LINK, entsoeLink)) - ) + ) asset = assetStorageService.merge(asset) def attributeRef = new AttributeRef(asset.id, "energyPrice") @@ -547,7 +547,7 @@ class EntsoeProtocolTest extends Specification implements ManagerContainerTrait .addOrReplaceMeta(new MetaItem<>(AGENT_LINK, beLink)), new Attribute<>("energyPriceNl", NUMBER) .addOrReplaceMeta(new MetaItem<>(AGENT_LINK, nlLink)) - ) + ) asset = assetStorageService.merge(asset) def beRef = new AttributeRef(asset.id, "energyPriceBe") @@ -642,7 +642,7 @@ class EntsoeProtocolTest extends Specification implements ManagerContainerTrait .addOrReplaceMeta(new MetaItem<>(AGENT_LINK, link1)), new Attribute<>("energyPriceTwo", NUMBER) .addOrReplaceMeta(new MetaItem<>(AGENT_LINK, link2)) - ) + ) asset = assetStorageService.merge(asset) def refOne = new AttributeRef(asset.id, "energyPriceOne") @@ -732,7 +732,7 @@ class EntsoeProtocolTest extends Specification implements ManagerContainerTrait .addOrReplaceAttributes( new Attribute<>("energyPrice", NUMBER) .addOrReplaceMeta(new MetaItem<>(AGENT_LINK, errLink)) - ) + ) asset = assetStorageService.merge(asset) def attributeRef = new AttributeRef(asset.id, "energyPrice") @@ -824,7 +824,7 @@ class EntsoeProtocolTest extends Specification implements ManagerContainerTrait .addOrReplaceAttributes( new Attribute<>("energyPrice", NUMBER) .addOrReplaceMeta(new MetaItem<>(AGENT_LINK, noDataLink)) - ) + ) asset = assetStorageService.merge(asset) def attributeRef = new AttributeRef(asset.id, "energyPrice") @@ -895,7 +895,7 @@ class EntsoeProtocolTest extends Specification implements ManagerContainerTrait .addOrReplaceAttributes( new Attribute<>("energyPrice", NUMBER) .addOrReplaceMeta(new MetaItem<>(AGENT_LINK, unsafeXmlLink)) - ) + ) asset = assetStorageService.merge(asset) def attributeRef = new AttributeRef(asset.id, "energyPrice") @@ -958,7 +958,7 @@ class EntsoeProtocolTest extends Specification implements ManagerContainerTrait .addOrReplaceAttributes( new Attribute<>("energyPrice", NUMBER) .addOrReplaceMeta(new MetaItem<>(AGENT_LINK, gapLink)) - ) + ) asset = assetStorageService.merge(asset) def attributeRef = new AttributeRef(asset.id, "energyPrice") @@ -1039,7 +1039,7 @@ class EntsoeProtocolTest extends Specification implements ManagerContainerTrait .addOrReplaceAttributes( new Attribute<>("energyPrice", NUMBER) .addOrReplaceMeta(new MetaItem<>(AGENT_LINK, multiPeriodLink)) - ) + ) asset = assetStorageService.merge(asset) def attributeRef = new AttributeRef(asset.id, "energyPrice") @@ -1152,7 +1152,7 @@ class EntsoeProtocolTest extends Specification implements ManagerContainerTrait .addOrReplaceAttributes( new Attribute<>("energyPrice", NUMBER) .addOrReplaceMeta(new MetaItem<>(AGENT_LINK, link)) - ) + ) asset = assetStorageService.merge(asset) def attributeRef = new AttributeRef(asset.id, "energyPrice") @@ -1174,8 +1174,8 @@ class EntsoeProtocolTest extends Specification implements ManagerContainerTrait conditions.eventually { assert requestLog.any { it.zone == "10YBE----------2" && - it.periodStart == periodFormatter.format(fixedNow) && - it.periodEnd == periodFormatter.format(fixedNow.plus(1, java.time.temporal.ChronoUnit.DAYS)) + it.periodStart == periodFormatter.format(fixedNow) && + it.periodEnd == periodFormatter.format(fixedNow.plus(1, java.time.temporal.ChronoUnit.DAYS)) } } @@ -1189,8 +1189,8 @@ class EntsoeProtocolTest extends Specification implements ManagerContainerTrait conditions.eventually { assert requestLog.any { it.zone == "10YBE----------2" && - it.periodStart == periodFormatter.format(nextNow) && - it.periodEnd == periodFormatter.format(nextNow.plus(1, java.time.temporal.ChronoUnit.DAYS)) + it.periodStart == periodFormatter.format(nextNow) && + it.periodEnd == periodFormatter.format(nextNow.plus(1, java.time.temporal.ChronoUnit.DAYS)) } } diff --git a/hawkbit/src/test/groovy/org/openremote/extension/hawkbit/manager/HawkbitFirmwareServiceTest.groovy b/hawkbit/src/test/groovy/org/openremote/extension/hawkbit/manager/HawkbitFirmwareServiceTest.groovy index e28813f..3904609 100644 --- a/hawkbit/src/test/groovy/org/openremote/extension/hawkbit/manager/HawkbitFirmwareServiceTest.groovy +++ b/hawkbit/src/test/groovy/org/openremote/extension/hawkbit/manager/HawkbitFirmwareServiceTest.groovy @@ -275,8 +275,8 @@ class HawkbitFirmwareServiceTest extends Specification implements ManagerContain then: "the token is forwarded to hawkBit" 1 * service.targets.create({ TargetCreateRequest[] targets -> targets.length == 1 && - targets[0].controllerId() == CONTROLLER_ID && - targets[0].securityToken() == "custom-token" + targets[0].controllerId() == CONTROLLER_ID && + targets[0].securityToken() == "custom-token" }) >> Response.ok(new Target[]{ createdTarget }).build() diff --git a/project.gradle b/project.gradle index 78dba9c..d42845a 100644 --- a/project.gradle +++ b/project.gradle @@ -63,11 +63,11 @@ subprojects { tasks.configureEach { task -> if (task.name in [ - 'findSonatypeStagingRepository', - 'closeSonatypeStagingRepository', - 'releaseSonatypeStagingRepository', - 'closeAndReleaseSonatypeStagingRepository' - ]) { + 'findSonatypeStagingRepository', + 'closeSonatypeStagingRepository', + 'releaseSonatypeStagingRepository', + 'closeAndReleaseSonatypeStagingRepository' + ]) { // See: https://github.com/gradle-nexus/publish-plugin/issues/221 task.notCompatibleWithConfigurationCache("Gradle Nexus Publish plugin task keeps Gradle Task/Project state") } diff --git a/settings.gradle b/settings.gradle index aac2465..b39d7ea 100644 --- a/settings.gradle +++ b/settings.gradle @@ -35,7 +35,7 @@ fileTree( .filter { !new File(it.parentFile, ".buildignore").exists() } .each { include it.parentFile.canonicalPath - .replace(rootDir.canonicalPath, "") - .replace("\\", ":") - .replace("/", ":") + .replace(rootDir.canonicalPath, "") + .replace("\\", ":") + .replace("/", ":") } diff --git a/spotless.gradle b/spotless.gradle index 0658da0..cac19d2 100644 --- a/spotless.gradle +++ b/spotless.gradle @@ -24,9 +24,9 @@ String prettierVersion = devDependencies.prettier def readIgnorePatterns = { File ignoreFile -> List patterns = ignoreFile - .readLines('UTF-8') - .collect { it.trim() } - .findAll { it && !it.startsWith('#') } + .readLines('UTF-8') + .collect { it.trim() } + .findAll { it && !it.startsWith('#') } List unsupported = patterns.findAll { it.startsWith('!') || it.startsWith('/') || it.contains('\\') }