Skip to content

Commit 7fd8378

Browse files
use object equals
1 parent 5636f00 commit 7fd8378

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/test/groovy/edu/ie3/datamodel/io/factory/timeseries/TimeBasedSimpleValueFactoryTest.groovy

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ import spock.lang.Shared
1717
import spock.lang.Specification
1818
import tech.units.indriya.quantity.Quantities
1919

20-
import java.time.ZoneId
21-
2220
class TimeBasedSimpleValueFactoryTest extends Specification {
2321
@Shared
2422
TimeUtil defaultTimeUtil
@@ -109,7 +107,7 @@ class TimeBasedSimpleValueFactoryTest extends Specification {
109107
)
110108

111109
expect:
112-
factory.buildModel(data).equals(expected)
110+
Objects.equals(factory.buildModel(data),expected)
113111
}
114112

115113
def "The simple time based value factory builds correct heat and apparent power value"() {
@@ -129,7 +127,7 @@ class TimeBasedSimpleValueFactoryTest extends Specification {
129127
)
130128

131129
expect:
132-
factory.buildModel(data).equals(expected)
130+
Object.equals(factory.buildModel(data), expected)
133131
}
134132

135133
def "The simple time based value factory builds correct heat and active power value"() {
@@ -147,7 +145,7 @@ class TimeBasedSimpleValueFactoryTest extends Specification {
147145
)
148146

149147
expect:
150-
factory.buildModel(data).equals(expected)
148+
Object.equals(factory.buildModel(data), expected)
151149
}
152150

153151
def "The simple time based value factory builds correct heat demand value"() {
@@ -164,7 +162,7 @@ class TimeBasedSimpleValueFactoryTest extends Specification {
164162
)
165163

166164
expect:
167-
factory.buildModel(data).equals(expected)
165+
Object.equals(factory.buildModel(data), expected)
168166
}
169167

170168
def "The simple time based value factory builds correct apparent power value"() {
@@ -182,7 +180,7 @@ class TimeBasedSimpleValueFactoryTest extends Specification {
182180
)
183181

184182
expect:
185-
factory.buildModel(data).equals(expected)
183+
Object.equals(factory.buildModel(data), expected)
186184
}
187185

188186
def "The simple time based value factory builds correct active power value"() {
@@ -198,8 +196,11 @@ class TimeBasedSimpleValueFactoryTest extends Specification {
198196
new PValue(Quantities.getQuantity(500.0, StandardUnits.ACTIVE_POWER_IN))
199197
)
200198

199+
200+
def obj = factory.buildModel(data)
201+
201202
expect:
202-
factory.buildModel(data).equals(expected)
203+
Object.equals(obj, expected)
203204
}
204205

205206
def "The simple time based value factory throws a FactoryException upon build request, if a class is not supported"() {

0 commit comments

Comments
 (0)