Skip to content

Commit

Permalink
HSEARCH-5133 Test metric aggregations
Browse files Browse the repository at this point in the history
  • Loading branch information
fax4ever committed Aug 28, 2024
1 parent de44e4e commit 42b8d77
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class MetricNumericFieldsAggregationsIT {
private final AggregationKey<Double> avgIntegersAsDoubleRaw = AggregationKey.of( "avgIntegersAsDoubleRaw" );
private final AggregationKey<Double> avgIntegersAsDoubleFiltered = AggregationKey.of( "avgIntegersAsDoubleFiltered" );
private final AggregationKey<Double> sumDoubles = AggregationKey.of( "sumDoubles" );
private final AggregationKey<Double> sumDoublesRaw = AggregationKey.of( "sumDoublesRaw" );
private final AggregationKey<Float> sumFloats = AggregationKey.of( "sumFloats" );
private final AggregationKey<BigInteger> sumBigIntegers = AggregationKey.of( "sumBigIntegers" );
private final AggregationKey<BigDecimal> sumBigDecimals = AggregationKey.of( "sumBigDecimals" );
Expand Down Expand Up @@ -172,6 +173,12 @@ private SearchQuery<DocumentReference> defineAggregations(
.isInstanceOf( AssertionFailure.class )
.hasMessageContaining( "Raw projection converter is not supported" );

assertThatThrownBy( () -> {
options.aggregation( sumDoublesRaw, f -> f.sum().field( "doubleF", Double.class, ValueModel.RAW ) );
} )
.isInstanceOf( AssertionFailure.class )
.hasMessageContaining( "Raw projection converter is not supported" );

return options
.aggregation( sumIntegers, f -> f.sum().field( "integer", Integer.class ) )
.aggregation( sumIntegersAsString, f -> f.sum().field( "integer", String.class, ValueModel.STRING ) )
Expand Down

0 comments on commit 42b8d77

Please sign in to comment.