use of org.n52.io.request.IoParameters in project series-rest-api by 52North.
the class ChartRendererTest method shouldPrintDefaultOutputTimezoneInDomainAxisLabel.
@Test
public void shouldPrintDefaultOutputTimezoneInDomainAxisLabel() {
IoParameters config = IoParameters.createDefaults();
IoStyleContext context = IoStyleContext.create(config);
String label = new MyChartRenderer(context).getXYPlot().getDomainAxis().getLabel();
assertThat(label, is("Time (UTC)"));
}
use of org.n52.io.request.IoParameters in project series-rest-api by 52North.
the class IoParametersTest method when_timespanWithNow_then_normalizeWithDateString.
@Test
public void when_timespanWithNow_then_normalizeWithDateString() {
DateTimeFormatter dateFormat = DateTimeFormat.forPattern("YYYY-MM-dd");
String now = dateFormat.print(new DateTime());
IoParameters parameters = createDefaults().extendWith(Parameters.TIMESPAN, "PT4h/now");
IntervalWithTimeZone expected = new IntervalWithTimeZone("PT4h/" + now);
assertThat(parameters.getNormalizedTimespan(dateFormat), is(expected.toString()));
}
use of org.n52.io.request.IoParameters in project series-rest-api by 52North.
the class IoParametersTest method when_jsonBbox_then_parsingSpatialFilter.
@Test
public void when_jsonBbox_then_parsingSpatialFilter() throws ParseException {
Map<String, String> map = Collections.singletonMap("bbox", "{\"ll\":{\"type\":\"Point\",\"coordinates\":[6.7,51.7]},\"ur\":{\"type\":\"Point\",\"coordinates\":[7.9,51.9]}}");
IoParameters parameters = createFromSingleValueMap(map);
BoundingBox actual = parameters.getSpatialFilter();
WKTReader wktReader = new WKTReader();
Geometry ll = wktReader.read("POINT (6.7 51.7)");
Geometry ur = wktReader.read("POINT(7.9 51.9)");
Assert.assertTrue(actual.getLowerLeft().equals(ll));
Assert.assertTrue(actual.getUpperRight().equals(ur));
}
Aggregations