use of com.axibase.tsd.api.model.series.query.transformation.AggregationInterpolate in project atsd-api-test by axibase.
the class SeriesQueryHorizonTest method generateAggregationSettings.
private Aggregate generateAggregationSettings() {
Aggregate aggregate = new Aggregate();
List<AggregationType> aggregationType = new ArrayList<>();
aggregationType.add(AggregationType.AVG);
Period period = new Period(AGGREGATION_PERIOD, TimeUnit.MINUTE, PeriodAlignment.START_TIME);
AggregationInterpolate interp = new AggregationInterpolate(AggregationInterpolateType.LINEAR, true);
aggregate.setPeriod(period).setInterpolate(interp).setTypes(aggregationType);
return aggregate;
}
use of com.axibase.tsd.api.model.series.query.transformation.AggregationInterpolate in project atsd-api-test by axibase.
the class SeriesQueryTest method testAggregateInterpolateNoTypeRaiseError.
@Issue("3324")
@Test
public void testAggregateInterpolateNoTypeRaiseError() throws Exception {
SeriesQuery query = new SeriesQuery("mock-entity", "mock-metric", MIN_QUERYABLE_DATE, MAX_QUERYABLE_DATE);
Aggregate aggregate = new Aggregate(AggregationType.SUM, new Period(99999, TimeUnit.QUARTER));
aggregate.setInterpolate(new AggregationInterpolate());
query.setAggregate(aggregate);
Response response = querySeries(query);
assertEquals("Query with interpolation but without type should fail", BAD_REQUEST.getStatusCode(), response.getStatus());
assertEquals("Error message mismatch", INTERPOLATE_TYPE_REQUIRED, extractErrorMessage(response));
}
Aggregations