Skip to content

Commit

Permalink
#814 Correct parsing for InfluxDB timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
dcoraboeuf committed Oct 13, 2020
1 parent e248f85 commit 37ab158
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import org.influxdb.dto.Query
import org.influxdb.impl.InfluxDBResultMapper
import org.junit.Test

import java.text.DateFormat
import java.text.SimpleDateFormat

import static net.nemerosa.ontrack.test.TestUtils.uid

/**
Expand Down Expand Up @@ -102,7 +105,7 @@ class ACCInfluxDBValidationData extends AcceptanceTestClient {
ValidationDataMeasurement
)
assert !measurements.empty
def timestamps = measurements.collect {new Date(it.time).getTime() }
def timestamps = measurements.collect { new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS").parse(it.time).getTime() }
assert timestamps[1] > timestamps[0]: "Second validation has a different timestamp"
}

Expand Down

0 comments on commit 37ab158

Please sign in to comment.