use of org.n52.io.type.quantity.generalize.LargestTriangleThreeBucketsGeneralizer in project series-rest-api by 52North.
the class LargestTriangleThreeBucketsGeneralizerTest method when_quotientHasNonterminatingDecimals_then_noArithmeticExceptionIsThrown.
@Test
public void when_quotientHasNonterminatingDecimals_then_noArithmeticExceptionIsThrown() throws GeneralizerException {
// https://github.com/52North/series-rest-api/issues/446
TvpDataCollection<Data<QuantityValue>> collection = new TvpDataCollection<>();
collection.addNewSeries("test", getData(10000));
long threshold = 100L;
IoParameters defaults = IoParameters.createDefaults().extendWith("threshold", Long.toString(threshold));
Generalizer<Data<QuantityValue>> generalizer = new LargestTriangleThreeBucketsGeneralizer(defaults);
DataCollection<Data<QuantityValue>> generalizedData = generalizer.generalize(collection);
assertThat(generalizedData.getSeries("test").size(), Is.is(threshold));
}
Aggregations