extract utility method

a method to send json over tcp can be used by several tests
This commit is contained in:
2017-04-08 08:21:50 +02:00
parent 81b7cfa7bd
commit 72436e9c8c
3 changed files with 85 additions and 58 deletions

View File

@@ -105,12 +105,12 @@ public class PlotSettings {
public OffsetDateTime dateTo() {
final int period = Integer.parseInt(dateRange.split(" ")[0]);
final ChronoUnit unit = toChronoUnit(dateRange.split(" ")[1]);
if (StringUtils.isEmpty(dateRange)) {
return OffsetDateTime.ofInstant(Instant.ofEpochMilli(Long.MAX_VALUE), ZoneOffset.UTC);
} else {
final int period = Integer.parseInt(dateRange.split(" ")[0]);
final ChronoUnit unit = toChronoUnit(dateRange.split(" ")[1]);
return dateFrom().plus(period, unit);
}
}