Skip to content

Commit 1ee3483

Browse files
committed
Check validity of time stamp pattern used by factory
1 parent b0aa625 commit 1ee3483

File tree

4 files changed

+105
-51
lines changed

4 files changed

+105
-51
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,8 @@ public TimeBasedValueFactory(
6161
super(valueClasses);
6262
timeUtil = new TimeUtil(timeZone, locale, timeStampPattern);
6363
}
64+
65+
public String getTimeStampPattern() {
66+
return timeUtil.getDtfPattern();
67+
}
6468
}

src/main/java/edu/ie3/datamodel/io/source/influxdb/InfluxDbWeatherSource.java

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
package edu.ie3.datamodel.io.source.influxdb;
77

8+
import edu.ie3.datamodel.exceptions.SourceException;
89
import edu.ie3.datamodel.io.connectors.InfluxDbConnector;
910
import edu.ie3.datamodel.io.factory.timeseries.TimeBasedWeatherValueData;
1011
import edu.ie3.datamodel.io.factory.timeseries.TimeBasedWeatherValueFactory;
@@ -27,6 +28,8 @@
2728

2829
/** InfluxDB Source for weather data */
2930
public class InfluxDbWeatherSource implements WeatherSource {
31+
private static final String RFC3339_PATTERN_STRING = "yyyy-MM-dd'T'HH:mm:ss[.S[S][S]]'Z'";
32+
3033
private static final String BASIC_QUERY_STRING = "Select * from weather";
3134
private static final String WHERE = " where ";
3235
private static final String MEASUREMENT_NAME_WEATHER = "weather";
@@ -53,12 +56,9 @@ public class InfluxDbWeatherSource implements WeatherSource {
5356
public InfluxDbWeatherSource(
5457
InfluxDbConnector connector,
5558
IdCoordinateSource coordinateSource,
56-
TimeBasedWeatherValueFactory weatherValueFactory) {
57-
this.connector = connector;
58-
this.coordinateSource = coordinateSource;
59-
this.namingConvention = DEFAULT_NAMING_CONVENTION;
60-
this.weatherValueFactory = weatherValueFactory;
61-
this.coordinateIdFieldName = weatherValueFactory.getCoordinateIdFieldString();
59+
TimeBasedWeatherValueFactory weatherValueFactory)
60+
throws SourceException {
61+
this(connector, coordinateSource, DEFAULT_NAMING_CONVENTION, weatherValueFactory);
6262
}
6363

6464
/**
@@ -74,14 +74,38 @@ public InfluxDbWeatherSource(
7474
InfluxDbConnector connector,
7575
IdCoordinateSource coordinateSource,
7676
NamingConvention namingConvention,
77-
TimeBasedWeatherValueFactory weatherValueFactory) {
77+
TimeBasedWeatherValueFactory weatherValueFactory)
78+
throws SourceException {
7879
this.connector = connector;
7980
this.coordinateSource = coordinateSource;
8081
this.namingConvention = namingConvention;
8182
this.weatherValueFactory = weatherValueFactory;
83+
if (!isTimestampPatternCompliant(weatherValueFactory.getTimeStampPattern()))
84+
throw new SourceException(
85+
"The given factory uses a time stamp pattern '"
86+
+ weatherValueFactory.getTimeStampPattern()
87+
+ "', that is not compliant with RFC 3339 standard. This causes, that InfluxDB results cannot be parsed. Please use '"
88+
+ RFC3339_PATTERN_STRING
89+
+ "'.");
8290
this.coordinateIdFieldName = weatherValueFactory.getCoordinateIdFieldString();
8391
}
8492

93+
/**
94+
* InfluxDB outputs the time of an entry formatted with the RFC3339 standard. Therefore, it is
95+
* important, that the factory to build entities, is able to parse such kind of a String. This
96+
* method checks, if a given time stamp pattern complies the given standard.
97+
*
98+
* @see <a
99+
* href="https://docs.influxdata.com/influxdb/v2.0/reference/glossary/#rfc3339-timestamp">InfluxDB
100+
* documentation</a>
101+
* @see <a href="https://tools.ietf.org/html/rfc3339">RFC 3339 standard</a>
102+
* @param pattern The pattern to check
103+
* @return true, if it complies the RFC 3339 standard
104+
*/
105+
private boolean isTimestampPatternCompliant(String pattern) {
106+
return pattern.equals(RFC3339_PATTERN_STRING);
107+
}
108+
85109
@Override
86110
public Map<Point, IndividualTimeSeries<WeatherValue>> getWeather(
87111
ClosedInterval<ZonedDateTime> timeInterval) {

src/test/groovy/edu/ie3/datamodel/io/source/influxdb/InfluxDbWeatherSourceCosmoIT.groovy

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
package edu.ie3.datamodel.io.source.influxdb
77

8+
import edu.ie3.datamodel.exceptions.SourceException
89
import edu.ie3.datamodel.io.connectors.InfluxDbConnector
910
import edu.ie3.datamodel.io.factory.timeseries.CosmoTimeBasedWeatherValueFactory
1011
import edu.ie3.datamodel.models.timeseries.individual.IndividualTimeSeries
@@ -40,27 +41,40 @@ class InfluxDbWeatherSourceCosmoIT extends Specification implements WeatherSourc
4041
influxDbContainer.copyFileToContainer(influxWeatherImportFile, "/home/weather.txt")
4142
def execResult = influxDbContainer.execInContainer("influx", "-import", "-path=/home/weather.txt", "-precision=ms")
4243
println "Command \"influx -import -path=/home/weather.txt -precision=ms\" returned:"
43-
if(!execResult.stderr.isEmpty()) println execResult.getStderr()
44-
if(!execResult.stdout.isEmpty()) println execResult.getStdout()
44+
if (!execResult.stderr.isEmpty()) println execResult.getStderr()
45+
if (!execResult.stdout.isEmpty()) println execResult.getStdout()
4546

46-
def connector = new InfluxDbConnector(influxDbContainer.url,"test_weather", "test_scenario")
47+
def connector = new InfluxDbConnector(influxDbContainer.url, "test_weather", "test_scenario")
4748
def weatherFactory = new CosmoTimeBasedWeatherValueFactory()
4849
source = new InfluxDbWeatherSource(connector, CosmoWeatherTestData.coordinateSource, NamingConvention.SNAKE, weatherFactory)
4950
}
5051

52+
def "The source refuses instantiation with not compliant time stamp pattern in factory"() {
53+
given:
54+
def unCompliantPattern = "yyyy-MM-dd"
55+
def weatherFactory = new CosmoTimeBasedWeatherValueFactory(unCompliantPattern)
56+
def connector = new InfluxDbConnector(influxDbContainer.url, "test_weather", "test_scenario")
57+
58+
when:
59+
new InfluxDbWeatherSource(connector, CosmoWeatherTestData.coordinateSource, NamingConvention.SNAKE, weatherFactory)
60+
61+
then:
62+
def exception = thrown(SourceException)
63+
exception.message == "The given factory uses a time stamp pattern '" + unCompliantPattern + "', that is not compliant with RFC 3339 standard. This causes, that InfluxDB results cannot be parsed. Please use 'yyyy-MM-dd'T'HH:mm:ss[.S[S][S]]'Z''."
64+
}
5165

5266
def "The test container can establish a valid connection"() {
5367
when:
54-
def connector = new InfluxDbConnector(influxDbContainer.url,"test_weather", "test_scenario")
68+
def connector = new InfluxDbConnector(influxDbContainer.url, "test_weather", "test_scenario")
5569
then:
5670
connector.connectionValid
5771
}
5872

5973
def "An InfluxDbWeatherSource can read and correctly parse a single value for a specific date and coordinate"() {
6074
given:
61-
def expectedTimeBasedValue = new TimeBasedValue(CosmoWeatherTestData.TIME_15H , CosmoWeatherTestData.WEATHER_VALUE_193186_15H)
75+
def expectedTimeBasedValue = new TimeBasedValue(CosmoWeatherTestData.TIME_15H, CosmoWeatherTestData.WEATHER_VALUE_193186_15H)
6276
when:
63-
def optTimeBasedValue = source.getWeather(CosmoWeatherTestData.TIME_15H , CosmoWeatherTestData.COORDINATE_193186)
77+
def optTimeBasedValue = source.getWeather(CosmoWeatherTestData.TIME_15H, CosmoWeatherTestData.COORDINATE_193186)
6478
then:
6579
optTimeBasedValue.present
6680
equalsIgnoreUUID(optTimeBasedValue.get(), expectedTimeBasedValue)
@@ -72,15 +86,15 @@ class InfluxDbWeatherSourceCosmoIT extends Specification implements WeatherSourc
7286
CosmoWeatherTestData.COORDINATE_193186,
7387
CosmoWeatherTestData.COORDINATE_193187
7488
]
75-
def timeInterval = new ClosedInterval(CosmoWeatherTestData.TIME_16H , CosmoWeatherTestData.TIME_17H)
89+
def timeInterval = new ClosedInterval(CosmoWeatherTestData.TIME_16H, CosmoWeatherTestData.TIME_17H)
7690
def timeseries_193186 = new IndividualTimeSeries(null,
7791
[
78-
new TimeBasedValue(CosmoWeatherTestData.TIME_16H , CosmoWeatherTestData.WEATHER_VALUE_193186_16H),
79-
new TimeBasedValue(CosmoWeatherTestData.TIME_17H , CosmoWeatherTestData.WEATHER_VALUE_193186_17H)]
92+
new TimeBasedValue(CosmoWeatherTestData.TIME_16H, CosmoWeatherTestData.WEATHER_VALUE_193186_16H),
93+
new TimeBasedValue(CosmoWeatherTestData.TIME_17H, CosmoWeatherTestData.WEATHER_VALUE_193186_17H)]
8094
as Set<TimeBasedValue>)
8195
def timeseries_193187 = new IndividualTimeSeries(null,
8296
[
83-
new TimeBasedValue(CosmoWeatherTestData.TIME_16H , CosmoWeatherTestData.WEATHER_VALUE_193187_16H)] as Set<TimeBasedValue>)
97+
new TimeBasedValue(CosmoWeatherTestData.TIME_16H, CosmoWeatherTestData.WEATHER_VALUE_193187_16H)] as Set<TimeBasedValue>)
8498
when:
8599
Map<Point, IndividualTimeSeries<WeatherValue>> coordinateToTimeSeries = source.getWeather(timeInterval, coordinates)
86100
then:
@@ -91,19 +105,19 @@ class InfluxDbWeatherSourceCosmoIT extends Specification implements WeatherSourc
91105

92106
def "An InfluxDbWeatherSource can read all weather data in a given time interval"() {
93107
given:
94-
def timeInterval = new ClosedInterval(CosmoWeatherTestData.TIME_15H , CosmoWeatherTestData.TIME_17H)
108+
def timeInterval = new ClosedInterval(CosmoWeatherTestData.TIME_15H, CosmoWeatherTestData.TIME_17H)
95109
def timeseries_193186 = new IndividualTimeSeries(null,
96110
[
97-
new TimeBasedValue(CosmoWeatherTestData.TIME_15H ,CosmoWeatherTestData.WEATHER_VALUE_193186_15H),
98-
new TimeBasedValue(CosmoWeatherTestData.TIME_16H ,CosmoWeatherTestData.WEATHER_VALUE_193186_16H),
99-
new TimeBasedValue(CosmoWeatherTestData.TIME_17H ,CosmoWeatherTestData.WEATHER_VALUE_193186_17H)] as Set<TimeBasedValue>)
111+
new TimeBasedValue(CosmoWeatherTestData.TIME_15H, CosmoWeatherTestData.WEATHER_VALUE_193186_15H),
112+
new TimeBasedValue(CosmoWeatherTestData.TIME_16H, CosmoWeatherTestData.WEATHER_VALUE_193186_16H),
113+
new TimeBasedValue(CosmoWeatherTestData.TIME_17H, CosmoWeatherTestData.WEATHER_VALUE_193186_17H)] as Set<TimeBasedValue>)
100114
def timeseries_193187 = new IndividualTimeSeries(null,
101115
[
102-
new TimeBasedValue(CosmoWeatherTestData.TIME_15H ,CosmoWeatherTestData.WEATHER_VALUE_193187_15H),
103-
new TimeBasedValue(CosmoWeatherTestData.TIME_16H ,CosmoWeatherTestData.WEATHER_VALUE_193187_16H)] as Set<TimeBasedValue>)
116+
new TimeBasedValue(CosmoWeatherTestData.TIME_15H, CosmoWeatherTestData.WEATHER_VALUE_193187_15H),
117+
new TimeBasedValue(CosmoWeatherTestData.TIME_16H, CosmoWeatherTestData.WEATHER_VALUE_193187_16H)] as Set<TimeBasedValue>)
104118
def timeseries_193188 = new IndividualTimeSeries(null,
105119
[
106-
new TimeBasedValue(CosmoWeatherTestData.TIME_15H ,CosmoWeatherTestData.WEATHER_VALUE_193188_15H)] as Set<TimeBasedValue>)
120+
new TimeBasedValue(CosmoWeatherTestData.TIME_15H, CosmoWeatherTestData.WEATHER_VALUE_193188_15H)] as Set<TimeBasedValue>)
107121
when:
108122
Map<Point, IndividualTimeSeries<WeatherValue>> coordinateToTimeSeries = source.getWeather(timeInterval)
109123
then:
@@ -117,13 +131,13 @@ class InfluxDbWeatherSourceCosmoIT extends Specification implements WeatherSourc
117131
def validCoordinate = CosmoWeatherTestData.COORDINATE_193186
118132
def invalidCoordinate = GeoUtils.xyToPoint(48d, 7d)
119133
def time = CosmoWeatherTestData.TIME_15H
120-
def timeInterval = new ClosedInterval(CosmoWeatherTestData.TIME_15H , CosmoWeatherTestData.TIME_17H)
134+
def timeInterval = new ClosedInterval(CosmoWeatherTestData.TIME_15H, CosmoWeatherTestData.TIME_17H)
121135
def emptyTimeSeries = new IndividualTimeSeries(UUID.randomUUID(), Collections.emptySet())
122136
def timeseries_193186 = new IndividualTimeSeries(null,
123137
[
124-
new TimeBasedValue(CosmoWeatherTestData.TIME_15H ,CosmoWeatherTestData.WEATHER_VALUE_193186_15H),
125-
new TimeBasedValue(CosmoWeatherTestData.TIME_16H ,CosmoWeatherTestData.WEATHER_VALUE_193186_16H),
126-
new TimeBasedValue(CosmoWeatherTestData.TIME_17H ,CosmoWeatherTestData.WEATHER_VALUE_193186_17H)] as Set<TimeBasedValue>)
138+
new TimeBasedValue(CosmoWeatherTestData.TIME_15H, CosmoWeatherTestData.WEATHER_VALUE_193186_15H),
139+
new TimeBasedValue(CosmoWeatherTestData.TIME_16H, CosmoWeatherTestData.WEATHER_VALUE_193186_16H),
140+
new TimeBasedValue(CosmoWeatherTestData.TIME_17H, CosmoWeatherTestData.WEATHER_VALUE_193186_17H)] as Set<TimeBasedValue>)
127141
when:
128142
def coordinateAtDate = source.getWeather(time, invalidCoordinate)
129143
def coordinateInInterval = source.getWeather(timeInterval, invalidCoordinate)

src/test/groovy/edu/ie3/datamodel/io/source/influxdb/InfluxDbWeatherSourceIconIT.groovy

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,16 @@
55
*/
66
package edu.ie3.datamodel.io.source.influxdb
77

8+
import edu.ie3.datamodel.exceptions.SourceException
89
import edu.ie3.datamodel.io.connectors.InfluxDbConnector
9-
import edu.ie3.datamodel.io.factory.timeseries.CosmoTimeBasedWeatherValueFactory
1010
import edu.ie3.datamodel.io.factory.timeseries.IconTimeBasedWeatherValueFactory
1111
import edu.ie3.datamodel.models.timeseries.individual.IndividualTimeSeries
1212
import edu.ie3.datamodel.models.timeseries.individual.TimeBasedValue
13-
import edu.ie3.datamodel.models.value.WeatherValue
1413
import edu.ie3.test.common.IconWeatherTestData
1514
import edu.ie3.test.helper.WeatherSourceTestHelper
1615
import edu.ie3.util.geo.GeoUtils
1716
import edu.ie3.util.interval.ClosedInterval
1817
import edu.ie3.util.naming.NamingConvention
19-
import org.locationtech.jts.geom.Point
2018
import org.testcontainers.containers.InfluxDBContainer
2119
import org.testcontainers.spock.Testcontainers
2220
import org.testcontainers.utility.MountableFile
@@ -41,27 +39,41 @@ class InfluxDbWeatherSourceIconIT extends Specification implements WeatherSource
4139
influxDbContainer.copyFileToContainer(influxWeatherImportFile, "/home/weather.txt")
4240
def execResult = influxDbContainer.execInContainer("influx", "-import", "-path=/home/weather.txt", "-precision=ms")
4341
println "Command \"influx -import -path=/home/weather.txt -precision=ms\" returned:"
44-
if(!execResult.stderr.isEmpty()) println execResult.getStderr()
45-
if(!execResult.stdout.isEmpty()) println execResult.getStdout()
42+
if (!execResult.stderr.isEmpty()) println execResult.getStderr()
43+
if (!execResult.stdout.isEmpty()) println execResult.getStdout()
4644

47-
def connector = new InfluxDbConnector(influxDbContainer.url,"test_weather", "test_scenario")
45+
def connector = new InfluxDbConnector(influxDbContainer.url, "test_weather", "test_scenario")
4846
def weatherFactory = new IconTimeBasedWeatherValueFactory("yyyy-MM-dd'T'HH:mm:ss[.S[S][S]]'Z'")
4947
source = new InfluxDbWeatherSource(connector, IconWeatherTestData.coordinateSource, NamingConvention.SNAKE, weatherFactory)
5048
}
5149

50+
def "The source refuses instantiation with not compliant time stamp pattern in factory"() {
51+
given:
52+
def unCompliantPattern = "yyyy-MM-dd"
53+
def weatherFactory = new IconTimeBasedWeatherValueFactory(unCompliantPattern)
54+
def connector = new InfluxDbConnector(influxDbContainer.url, "test_weather", "test_scenario")
55+
56+
when:
57+
new InfluxDbWeatherSource(connector, IconWeatherTestData.coordinateSource, NamingConvention.SNAKE, weatherFactory)
58+
59+
then:
60+
def exception = thrown(SourceException)
61+
exception.message == "The given factory uses a time stamp pattern '" + unCompliantPattern + "', that is not compliant with RFC 3339 standard. This causes, that InfluxDB results cannot be parsed. Please use 'yyyy-MM-dd'T'HH:mm:ss[.S[S][S]]'Z''."
62+
}
63+
5264
def "The test container can establish a valid connection"() {
5365
when:
54-
def connector = new InfluxDbConnector(influxDbContainer.url,"test_weather", "test_scenario")
66+
def connector = new InfluxDbConnector(influxDbContainer.url, "test_weather", "test_scenario")
5567
then:
5668
connector.connectionValid
5769
}
5870

5971
def "An InfluxDbWeatherSource can read and correctly parse a single value for a specific date and coordinate"() {
6072
given:
61-
def expectedTimeBasedValue = new TimeBasedValue(IconWeatherTestData.TIME_15H , IconWeatherTestData.WEATHER_VALUE_67775_15H)
73+
def expectedTimeBasedValue = new TimeBasedValue(IconWeatherTestData.TIME_15H, IconWeatherTestData.WEATHER_VALUE_67775_15H)
6274

6375
when:
64-
def optTimeBasedValue = source.getWeather(IconWeatherTestData.TIME_15H , IconWeatherTestData.COORDINATE_67775)
76+
def optTimeBasedValue = source.getWeather(IconWeatherTestData.TIME_15H, IconWeatherTestData.COORDINATE_67775)
6577

6678
then:
6779
optTimeBasedValue.present
@@ -74,15 +86,15 @@ class InfluxDbWeatherSourceIconIT extends Specification implements WeatherSource
7486
IconWeatherTestData.COORDINATE_67775,
7587
IconWeatherTestData.COORDINATE_67776
7688
]
77-
def timeInterval = new ClosedInterval(IconWeatherTestData.TIME_16H , IconWeatherTestData.TIME_17H)
89+
def timeInterval = new ClosedInterval(IconWeatherTestData.TIME_16H, IconWeatherTestData.TIME_17H)
7890
def timeseries67775 = new IndividualTimeSeries(null,
7991
[
80-
new TimeBasedValue(IconWeatherTestData.TIME_16H , IconWeatherTestData.WEATHER_VALUE_67775_16H),
81-
new TimeBasedValue(IconWeatherTestData.TIME_17H , IconWeatherTestData.WEATHER_VALUE_67775_17H)]
92+
new TimeBasedValue(IconWeatherTestData.TIME_16H, IconWeatherTestData.WEATHER_VALUE_67775_16H),
93+
new TimeBasedValue(IconWeatherTestData.TIME_17H, IconWeatherTestData.WEATHER_VALUE_67775_17H)]
8294
as Set<TimeBasedValue>)
8395
def timeseries67776 = new IndividualTimeSeries(null,
8496
[
85-
new TimeBasedValue(IconWeatherTestData.TIME_16H , IconWeatherTestData.WEATHER_VALUE_67776_16H)] as Set<TimeBasedValue>)
97+
new TimeBasedValue(IconWeatherTestData.TIME_16H, IconWeatherTestData.WEATHER_VALUE_67776_16H)] as Set<TimeBasedValue>)
8698

8799
when:
88100
def coordinateToTimeSeries = source.getWeather(timeInterval, coordinates)
@@ -95,16 +107,16 @@ class InfluxDbWeatherSourceIconIT extends Specification implements WeatherSource
95107

96108
def "An InfluxDbWeatherSource can read all weather data in a given time interval"() {
97109
given:
98-
def timeInterval = new ClosedInterval(IconWeatherTestData.TIME_15H , IconWeatherTestData.TIME_17H)
110+
def timeInterval = new ClosedInterval(IconWeatherTestData.TIME_15H, IconWeatherTestData.TIME_17H)
99111
def timeseries_67775 = new IndividualTimeSeries(null,
100112
[
101-
new TimeBasedValue(IconWeatherTestData.TIME_15H ,IconWeatherTestData.WEATHER_VALUE_67775_15H),
102-
new TimeBasedValue(IconWeatherTestData.TIME_16H ,IconWeatherTestData.WEATHER_VALUE_67775_16H),
103-
new TimeBasedValue(IconWeatherTestData.TIME_17H ,IconWeatherTestData.WEATHER_VALUE_67775_17H)] as Set<TimeBasedValue>)
113+
new TimeBasedValue(IconWeatherTestData.TIME_15H, IconWeatherTestData.WEATHER_VALUE_67775_15H),
114+
new TimeBasedValue(IconWeatherTestData.TIME_16H, IconWeatherTestData.WEATHER_VALUE_67775_16H),
115+
new TimeBasedValue(IconWeatherTestData.TIME_17H, IconWeatherTestData.WEATHER_VALUE_67775_17H)] as Set<TimeBasedValue>)
104116
def timeseries_67776 = new IndividualTimeSeries(null,
105117
[
106-
new TimeBasedValue(IconWeatherTestData.TIME_15H ,IconWeatherTestData.WEATHER_VALUE_67776_15H),
107-
new TimeBasedValue(IconWeatherTestData.TIME_16H ,IconWeatherTestData.WEATHER_VALUE_67776_16H)] as Set<TimeBasedValue>)
118+
new TimeBasedValue(IconWeatherTestData.TIME_15H, IconWeatherTestData.WEATHER_VALUE_67776_15H),
119+
new TimeBasedValue(IconWeatherTestData.TIME_16H, IconWeatherTestData.WEATHER_VALUE_67776_16H)] as Set<TimeBasedValue>)
108120

109121
when:
110122
def coordinateToTimeSeries = source.getWeather(timeInterval)
@@ -119,13 +131,13 @@ class InfluxDbWeatherSourceIconIT extends Specification implements WeatherSource
119131
def validCoordinate = IconWeatherTestData.COORDINATE_67775
120132
def invalidCoordinate = GeoUtils.xyToPoint(48d, 7d)
121133
def time = IconWeatherTestData.TIME_15H
122-
def timeInterval = new ClosedInterval(IconWeatherTestData.TIME_15H , IconWeatherTestData.TIME_17H)
134+
def timeInterval = new ClosedInterval(IconWeatherTestData.TIME_15H, IconWeatherTestData.TIME_17H)
123135
def emptyTimeSeries = new IndividualTimeSeries(UUID.randomUUID(), Collections.emptySet())
124136
def timeseries_67775 = new IndividualTimeSeries(null,
125137
[
126-
new TimeBasedValue(IconWeatherTestData.TIME_15H ,IconWeatherTestData.WEATHER_VALUE_67775_15H),
127-
new TimeBasedValue(IconWeatherTestData.TIME_16H ,IconWeatherTestData.WEATHER_VALUE_67775_16H),
128-
new TimeBasedValue(IconWeatherTestData.TIME_17H ,IconWeatherTestData.WEATHER_VALUE_67775_17H)] as Set<TimeBasedValue>)
138+
new TimeBasedValue(IconWeatherTestData.TIME_15H, IconWeatherTestData.WEATHER_VALUE_67775_15H),
139+
new TimeBasedValue(IconWeatherTestData.TIME_16H, IconWeatherTestData.WEATHER_VALUE_67775_16H),
140+
new TimeBasedValue(IconWeatherTestData.TIME_17H, IconWeatherTestData.WEATHER_VALUE_67775_17H)] as Set<TimeBasedValue>)
129141

130142
when:
131143
def coordinateAtDate = source.getWeather(time, invalidCoordinate)

0 commit comments

Comments
 (0)