Skip to content

Commit b2ab382

Browse files
committed
Updating spock-core to 2.4-groovy-5.0
1 parent 0c39153 commit b2ab382

File tree

88 files changed

+1203
-1208
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1203
-1208
lines changed

build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ plugins {
1717
ext {
1818
//version (changing these should be considered thoroughly!)
1919
javaVersion = JavaVersion.VERSION_21
20-
groovyVersion = "4.0"
2120
groovyBinaryVersion = "5.0.3"
2221

2322
junitVersion = '6.0.1'
@@ -80,7 +79,7 @@ dependencies {
8079

8180
testImplementation "org.junit.platform:junit-platform-launcher:$junitVersion"
8281
testImplementation "org.junit.jupiter:junit-jupiter:$junitVersion"
83-
testImplementation "org.spockframework:spock-core:2.3-groovy-$groovyVersion"
82+
testImplementation "org.spockframework:spock-core:2.4-groovy-5.0"
8483
testImplementation 'org.objenesis:objenesis:3.4' // Mock creation with constructor parameters
8584
testImplementation 'net.bytebuddy:byte-buddy:1.18.2' // Mocks of classes
8685

src/main/java/edu/ie3/datamodel/io/factory/timeseries/TimeBasedSimpleValueFactory.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
public class TimeBasedSimpleValueFactory<V extends Value>
1919
extends TimeBasedValueFactory<SimpleTimeBasedValueData<V>, V> {
20-
private static final String TIME = "time";
2120
/* Energy price */
2221
private static final String PRICE = "price";
2322
/* Energy / Power */

src/test/groovy/edu/ie3/datamodel/io/connectors/SqlConnectorIT.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ class SqlConnectorIT extends Specification implements TestContainerHelper {
3939
def "A SQL connector is instantiated correctly"() {
4040
expect:
4141
connector.with {
42-
assert it.jdbcUrl == postgreSQLContainer.jdbcUrl
43-
assert it.connectionProps.getProperty("user") == postgreSQLContainer.username
44-
assert it.connectionProps.getProperty("password") == postgreSQLContainer.password
42+
it.jdbcUrl == postgreSQLContainer.jdbcUrl
43+
it.connectionProps.getProperty("user") == postgreSQLContainer.username
44+
it.connectionProps.getProperty("password") == postgreSQLContainer.password
4545
/* SQL connection should be null, but we cannot test it here, as it would fire the default getter, which
4646
* initializes a connection, if it is not yet initialized. */
4747
}

src/test/groovy/edu/ie3/datamodel/io/csv/BufferedCsvWriterTest.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ class BufferedCsvWriterTest extends Specification {
4040

4141
then:
4242
actual.with {
43-
assert it.headLineElements == ["a", "b", "c"] as String[]
44-
assert it.csvSep == ","
43+
it.headLineElements == ["a", "b", "c"] as String[]
44+
it.csvSep == ","
4545
}
4646
expectedFile.exists()
4747
expectedFile.file // is it a file?

src/test/groovy/edu/ie3/datamodel/io/csv/CsvFileDefinitionTest.groovy

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ class CsvFileDefinitionTest extends Specification {
6565

6666
then:
6767
actual.with {
68-
assert it.filePath.fileName == Path.of(this.fileName)
69-
assert it.directoryPath == this.directory
70-
assert it.headLineElements() == this.headLineElements
71-
assert it.csvSep() == this.csvSep
68+
it.filePath.fileName == Path.of(this.fileName)
69+
it.directoryPath == this.directory
70+
it.headLineElements() == this.headLineElements
71+
it.csvSep() == this.csvSep
7272
}
7373
}
7474

@@ -81,10 +81,10 @@ class CsvFileDefinitionTest extends Specification {
8181

8282
then:
8383
actual.with {
84-
assert it.filePath.fileName == Path.of(this.fileName)
85-
assert it.directoryPath == this.directory
86-
assert it.headLineElements() == this.headLineElements
87-
assert it.csvSep() == this.csvSep
84+
it.filePath.fileName == Path.of(this.fileName)
85+
it.directoryPath == this.directory
86+
it.headLineElements() == this.headLineElements
87+
it.csvSep() == this.csvSep
8888
}
8989
}
9090

@@ -98,9 +98,9 @@ class CsvFileDefinitionTest extends Specification {
9898

9999
then:
100100
actual.with {
101-
assert it.filePath == expected.filePath
102-
assert it.headLineElements() == expected.headLineElements()
103-
assert it.csvSep() == expected.csvSep()
101+
it.filePath == expected.filePath
102+
it.headLineElements() == expected.headLineElements()
103+
it.csvSep() == expected.csvSep()
104104
}
105105
}
106106

@@ -115,9 +115,9 @@ class CsvFileDefinitionTest extends Specification {
115115

116116
then:
117117
actual.with {
118-
assert it.filePath == expected.filePath
119-
assert it.headLineElements() == expected.headLineElements()
120-
assert it.csvSep() == expected.csvSep()
118+
it.filePath == expected.filePath
119+
it.headLineElements() == expected.headLineElements()
120+
it.csvSep() == expected.csvSep()
121121
}
122122
}
123123

@@ -154,9 +154,9 @@ class CsvFileDefinitionTest extends Specification {
154154

155155
then:
156156
actual.with {
157-
assert it.filePath == expected.filePath
158-
assert it.headLineElements() == expected.headLineElements()
159-
assert it.csvSep() == expected.csvSep()
157+
it.filePath == expected.filePath
158+
it.headLineElements() == expected.headLineElements()
159+
it.csvSep() == expected.csvSep()
160160
}
161161
}
162162

@@ -179,9 +179,9 @@ class CsvFileDefinitionTest extends Specification {
179179

180180
then:
181181
actual.with {
182-
assert it.filePath == expected.filePath
183-
assert it.headLineElements() == expected.headLineElements()
184-
assert it.csvSep() == expected.csvSep()
182+
it.filePath == expected.filePath
183+
it.headLineElements() == expected.headLineElements()
184+
it.csvSep() == expected.csvSep()
185185
}
186186
}
187187
}

src/test/groovy/edu/ie3/datamodel/io/factory/graphics/LineGraphicInputFactoryTest.groovy

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ class LineGraphicInputFactoryTest extends Specification implements FactoryTestHe
4747
input.success
4848
input.data.get().getClass() == inputClass
4949
input.data.get().with {
50-
assert uuid == UUID.fromString(parameter["uuid"])
51-
assert path == getGeometry(parameter["path"])
52-
assert graphicLayer == parameter["graphiclayer"]
53-
assert line == lineInput
50+
uuid == UUID.fromString(parameter["uuid"])
51+
path == getGeometry(parameter["path"])
52+
graphicLayer == parameter["graphiclayer"]
53+
line == lineInput
5454
}
5555
}
5656
def "A LineGraphicInputFactory should parse a valid LineGraphicInput with different geoPosition strings correctly"() {
@@ -73,7 +73,7 @@ class LineGraphicInputFactoryTest extends Specification implements FactoryTestHe
7373
input.success
7474
input.data.get().getClass() == inputClass
7575
input.data.get().with {
76-
assert path == GridAndGeoUtils.buildSafeLineString(getGeometry(parameter["path"]) as LineString)
76+
path == GridAndGeoUtils.buildSafeLineString(getGeometry(parameter["path"]) as LineString)
7777
}
7878

7979
where:

src/test/groovy/edu/ie3/datamodel/io/factory/graphics/NodeGraphicInputFactoryTest.groovy

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ class NodeGraphicInputFactoryTest extends Specification implements FactoryTestHe
4848
input.success
4949
input.data.get().getClass() == inputClass
5050
input.data.get().with {
51-
assert uuid == UUID.fromString(parameter["uuid"])
52-
assert point == getGeometry(parameter["point"])
53-
assert path == getGeometry(parameter["path"])
54-
assert graphicLayer == parameter["graphiclayer"]
55-
assert node == nodeInput
51+
uuid == UUID.fromString(parameter["uuid"])
52+
point == getGeometry(parameter["point"])
53+
path == getGeometry(parameter["path"])
54+
graphicLayer == parameter["graphiclayer"]
55+
node == nodeInput
5656
}
5757
}
5858

@@ -77,7 +77,7 @@ class NodeGraphicInputFactoryTest extends Specification implements FactoryTestHe
7777
input.success
7878
input.data.get().getClass() == inputClass
7979
input.data.get().with {
80-
assert path == GridAndGeoUtils.buildSafeLineString(getGeometry(parameter["path"]) as LineString)
80+
path == GridAndGeoUtils.buildSafeLineString(getGeometry(parameter["path"]) as LineString)
8181
}
8282
where:
8383
geoLineString | _

src/test/groovy/edu/ie3/datamodel/io/factory/input/AssetInputEntityFactoryTest.groovy

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ class AssetInputEntityFactoryTest extends Specification implements FactoryTestHe
4747
input.success
4848
input.data.get().getClass() == inputClass
4949
input.data.get().with {
50-
assert uuid == UUID.fromString(parameter["uuid"])
51-
assert operationTime == OperationTime.notLimited()
52-
assert operator == operatorInput
53-
assert id == parameter["id"]
50+
uuid == UUID.fromString(parameter["uuid"])
51+
operationTime == OperationTime.notLimited()
52+
operator == operatorInput
53+
id == parameter["id"]
5454
}
5555
}
5656
@@ -73,10 +73,10 @@ class AssetInputEntityFactoryTest extends Specification implements FactoryTestHe
7373
input.success
7474
input.data.get().getClass() == inputClass
7575
input.data.get().with {
76-
assert uuid == UUID.fromString(parameter["uuid"])
77-
assert operationTime == OperationTime.notLimited()
78-
assert operator == operatorInput
79-
assert id == parameter["id"]
76+
uuid == UUID.fromString(parameter["uuid"])
77+
operationTime == OperationTime.notLimited()
78+
operator == operatorInput
79+
id == parameter["id"]
8080
}
8181
8282
where:
@@ -106,12 +106,12 @@ class AssetInputEntityFactoryTest extends Specification implements FactoryTestHe
106106
input.success
107107
input.data.get().getClass() == inputClass
108108
input.data.get().with {
109-
assert uuid == UUID.fromString(parameter["uuid"])
110-
assert operationTime.startDate.present
111-
assert operationTime.startDate.get() == ZonedDateTime.parse(parameter["operatesfrom"])
112-
assert !operationTime.endDate.present
113-
assert operator == operatorInput
114-
assert id == parameter["id"]
109+
uuid == UUID.fromString(parameter["uuid"])
110+
operationTime.startDate.present
111+
operationTime.startDate.get() == ZonedDateTime.parse(parameter["operatesfrom"])
112+
!operationTime.endDate.present
113+
operator == operatorInput
114+
id == parameter["id"]
115115
}
116116
}
117117
@@ -133,12 +133,12 @@ class AssetInputEntityFactoryTest extends Specification implements FactoryTestHe
133133
input.success
134134
input.data.get().getClass() == inputClass
135135
input.data.get().with {
136-
assert uuid == UUID.fromString(parameter["uuid"])
137-
assert !operationTime.startDate.present
138-
assert operationTime.endDate.present
139-
assert operationTime.endDate.get() == ZonedDateTime.parse(parameter["operatesuntil"])
140-
assert operator == operatorInput
141-
assert id == parameter["id"]
136+
uuid == UUID.fromString(parameter["uuid"])
137+
!operationTime.startDate.present
138+
operationTime.endDate.present
139+
operationTime.endDate.get() == ZonedDateTime.parse(parameter["operatesuntil"])
140+
operator == operatorInput
141+
id == parameter["id"]
142142
}
143143
}
144144
@@ -161,13 +161,13 @@ class AssetInputEntityFactoryTest extends Specification implements FactoryTestHe
161161
input.success
162162
input.data.get().getClass() == inputClass
163163
input.data.get().with {
164-
assert uuid == UUID.fromString(parameter["uuid"])
165-
assert operationTime.startDate.present
166-
assert operationTime.startDate.get() == ZonedDateTime.parse(parameter["operatesfrom"])
167-
assert operationTime.endDate.present
168-
assert operationTime.endDate.get() == ZonedDateTime.parse(parameter["operatesuntil"])
169-
assert operator == operatorInput
170-
assert id == parameter["id"]
164+
uuid == UUID.fromString(parameter["uuid"])
165+
operationTime.startDate.present
166+
operationTime.startDate.get() == ZonedDateTime.parse(parameter["operatesfrom"])
167+
operationTime.endDate.present
168+
operationTime.endDate.get() == ZonedDateTime.parse(parameter["operatesuntil"])
169+
operator == operatorInput
170+
id == parameter["id"]
171171
}
172172
}
173173
@@ -187,10 +187,10 @@ class AssetInputEntityFactoryTest extends Specification implements FactoryTestHe
187187
input.success
188188
input.data.get().getClass() == inputClass
189189
input.data.get().with {
190-
assert uuid == UUID.fromString(parameter["uuid"])
191-
assert operationTime == OperationTime.notLimited()
192-
assert operator == OperatorInput.NO_OPERATOR_ASSIGNED
193-
assert id == parameter["id"]
190+
uuid == UUID.fromString(parameter["uuid"])
191+
operationTime == OperationTime.notLimited()
192+
operator == OperatorInput.NO_OPERATOR_ASSIGNED
193+
id == parameter["id"]
194194
}
195195
}
196196
@@ -211,12 +211,12 @@ class AssetInputEntityFactoryTest extends Specification implements FactoryTestHe
211211
input.success
212212
input.data.get().getClass() == inputClass
213213
input.data.get().with {
214-
assert uuid == UUID.fromString(parameter["uuid"])
215-
assert operationTime.startDate.present
216-
assert operationTime.startDate.get() == ZonedDateTime.parse(parameter["operatesfrom"])
217-
assert !operationTime.endDate.present
218-
assert operator == OperatorInput.NO_OPERATOR_ASSIGNED
219-
assert id == parameter["id"]
214+
uuid == UUID.fromString(parameter["uuid"])
215+
operationTime.startDate.present
216+
operationTime.startDate.get() == ZonedDateTime.parse(parameter["operatesfrom"])
217+
!operationTime.endDate.present
218+
operator == OperatorInput.NO_OPERATOR_ASSIGNED
219+
id == parameter["id"]
220220
}
221221
}
222222
@@ -237,12 +237,12 @@ class AssetInputEntityFactoryTest extends Specification implements FactoryTestHe
237237
input.success
238238
input.data.get().getClass() == inputClass
239239
input.data.get().with {
240-
assert uuid == UUID.fromString(parameter["uuid"])
241-
assert !operationTime.startDate.present
242-
assert operationTime.endDate.present
243-
assert operationTime.endDate.get() == ZonedDateTime.parse(parameter["operatesuntil"])
244-
assert operator == OperatorInput.NO_OPERATOR_ASSIGNED
245-
assert id == parameter["id"]
240+
uuid == UUID.fromString(parameter["uuid"])
241+
!operationTime.startDate.present
242+
operationTime.endDate.present
243+
operationTime.endDate.get() == ZonedDateTime.parse(parameter["operatesuntil"])
244+
operator == OperatorInput.NO_OPERATOR_ASSIGNED
245+
id == parameter["id"]
246246
}
247247
}
248248
@@ -264,13 +264,13 @@ class AssetInputEntityFactoryTest extends Specification implements FactoryTestHe
264264
input.success
265265
input.data.get().getClass() == inputClass
266266
input.data.get().with {
267-
assert uuid == UUID.fromString(parameter["uuid"])
268-
assert operationTime.startDate.present
269-
assert operationTime.startDate.get() == ZonedDateTime.parse(parameter["operatesfrom"])
270-
assert operationTime.endDate.present
271-
assert operationTime.endDate.get() == ZonedDateTime.parse(parameter["operatesuntil"])
272-
assert operator == OperatorInput.NO_OPERATOR_ASSIGNED
273-
assert id == parameter["id"]
267+
uuid == UUID.fromString(parameter["uuid"])
268+
operationTime.startDate.present
269+
operationTime.startDate.get() == ZonedDateTime.parse(parameter["operatesfrom"])
270+
operationTime.endDate.present
271+
operationTime.endDate.get() == ZonedDateTime.parse(parameter["operatesuntil"])
272+
operator == OperatorInput.NO_OPERATOR_ASSIGNED
273+
id == parameter["id"]
274274
}
275275
}
276276

src/test/groovy/edu/ie3/datamodel/io/factory/input/CylindricalStorageInputFactoryTest.groovy

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,16 @@ class CylindricalStorageInputFactoryTest extends Specification implements Facto
4747
input.success
4848
input.data.get().getClass() == inputClass
4949
input.data.get().with {
50-
assert uuid == UUID.fromString(parameter["uuid"])
51-
assert operationTime == OperationTime.notLimited()
52-
assert operator == OperatorInput.NO_OPERATOR_ASSIGNED
53-
assert id == parameter["id"]
54-
assert thermalBus == thermalBusInput
55-
assert storageVolumeLvl == getQuant(parameter["storagevolumelvl"], StandardUnits.VOLUME)
56-
assert inletTemp == getQuant(parameter["inlettemp"], StandardUnits.TEMPERATURE)
57-
assert returnTemp == getQuant(parameter["returntemp"], StandardUnits.TEMPERATURE)
58-
assert c == getQuant(parameter["c"], StandardUnits.SPECIFIC_HEAT_CAPACITY)
59-
assert pThermalMax == getQuant(parameter["pThermalMax"], StandardUnits.ACTIVE_POWER_IN)
50+
uuid == UUID.fromString(parameter["uuid"])
51+
operationTime == OperationTime.notLimited()
52+
operator == OperatorInput.NO_OPERATOR_ASSIGNED
53+
id == parameter["id"]
54+
thermalBus == thermalBusInput
55+
storageVolumeLvl == getQuant(parameter["storagevolumelvl"], StandardUnits.VOLUME)
56+
inletTemp == getQuant(parameter["inlettemp"], StandardUnits.TEMPERATURE)
57+
returnTemp == getQuant(parameter["returntemp"], StandardUnits.TEMPERATURE)
58+
c == getQuant(parameter["c"], StandardUnits.SPECIFIC_HEAT_CAPACITY)
59+
pThermalMax == getQuant(parameter["pThermalMax"], StandardUnits.ACTIVE_POWER_IN)
6060
}
6161
}
6262
}

src/test/groovy/edu/ie3/datamodel/io/factory/input/DomesticHotWaterStorageInputFactoryTest.groovy

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,16 @@ class DomesticHotWaterStorageInputFactoryTest extends Specification implements F
4747
input.success
4848
input.data.get().getClass() == inputClass
4949
input.data.get().with {
50-
assert uuid == UUID.fromString(parameter["uuid"])
51-
assert operationTime == OperationTime.notLimited()
52-
assert operator == OperatorInput.NO_OPERATOR_ASSIGNED
53-
assert id == parameter["id"]
54-
assert thermalBus == thermalBusInput
55-
assert storageVolumeLvl == getQuant(parameter["storagevolumelvl"], StandardUnits.VOLUME)
56-
assert inletTemp == getQuant(parameter["inlettemp"], StandardUnits.TEMPERATURE)
57-
assert returnTemp == getQuant(parameter["returntemp"], StandardUnits.TEMPERATURE)
58-
assert c == getQuant(parameter["c"], StandardUnits.SPECIFIC_HEAT_CAPACITY)
59-
assert pThermalMax == getQuant(parameter["pThermalMax"], StandardUnits.ACTIVE_POWER_IN)
50+
uuid == UUID.fromString(parameter["uuid"])
51+
operationTime == OperationTime.notLimited()
52+
operator == OperatorInput.NO_OPERATOR_ASSIGNED
53+
id == parameter["id"]
54+
thermalBus == thermalBusInput
55+
storageVolumeLvl == getQuant(parameter["storagevolumelvl"], StandardUnits.VOLUME)
56+
inletTemp == getQuant(parameter["inlettemp"], StandardUnits.TEMPERATURE)
57+
returnTemp == getQuant(parameter["returntemp"], StandardUnits.TEMPERATURE)
58+
c == getQuant(parameter["c"], StandardUnits.SPECIFIC_HEAT_CAPACITY)
59+
pThermalMax == getQuant(parameter["pThermalMax"], StandardUnits.ACTIVE_POWER_IN)
6060
}
6161
}
6262
}

0 commit comments

Comments
 (0)