Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions deployment/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
)
)
}
}

Expand Down Expand Up @@ -113,7 +113,7 @@ tasks.register("distributeExtensions", DistributeExtensions) {
managerFiles.from(configurations.managerRuntime)
destinationDirectory.set(
layout.buildDirectory.dir("extensions")
)
)
}

tasks.register("installDist") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,16 +190,16 @@ 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)))
}

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") }
Expand All @@ -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") }
}
}
Expand All @@ -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=")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class EnergyOptimisationAssetTest extends Specification implements ManagerContai
AssetDatapointIntervalQuery.Formula.AVG,
true
)
)
)

assert setpoints.size() == 7
assert setpoints[0].value == 0d
Expand Down Expand Up @@ -191,7 +191,7 @@ class EnergyOptimisationAssetTest extends Specification implements ManagerContai
AssetDatapointIntervalQuery.Formula.AVG,
true
)
)
)

assert setpoints.size() == 7
assert setpoints[0].value == 0d
Expand Down Expand Up @@ -223,7 +223,7 @@ class EnergyOptimisationAssetTest extends Specification implements ManagerContai
AssetDatapointIntervalQuery.Formula.AVG,
true
)
)
)

assert setpoints.size() == 7
assert setpoints[0].value == 0d
Expand Down Expand Up @@ -335,7 +335,7 @@ class EnergyOptimisationAssetTest extends Specification implements ManagerContai
AssetDatapointIntervalQuery.Formula.AVG,
true
)
)
)

assert setpoints.size() == 7
assert setpoints[0].value == 10d
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand All @@ -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))
}
}

Expand All @@ -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))
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
10 changes: 5 additions & 5 deletions project.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
6 changes: 3 additions & 3 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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("/", ":")
}
6 changes: 3 additions & 3 deletions spotless.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ String prettierVersion = devDependencies.prettier

def readIgnorePatterns = { File ignoreFile ->
List<String> patterns = ignoreFile
.readLines('UTF-8')
.collect { it.trim() }
.findAll { it && !it.startsWith('#') }
.readLines('UTF-8')
.collect { it.trim() }
.findAll { it && !it.startsWith('#') }
List<String> unsupported = patterns.findAll {
it.startsWith('!') || it.startsWith('/') || it.contains('\\')
}
Expand Down
Loading