@@ -465,28 +465,28 @@ private void assertUnsupported(Runnable runnable, String exceptionMessage) {
465
465
@ Test
466
466
public void avg_notSupported () {
467
467
Query <TestEntity > query = box .query ().build ();
468
- String exceptionMessage = "Property does not allow avg" ;
469
- assertUnsupported (() -> query .property (simpleBoolean ).avg (), exceptionMessage );
468
+ String exceptionMessage = "Cannot calculate sum. This function is for integer types only. This operation is not supported for Property " ;
470
469
assertUnsupported (() -> query .property (simpleByteArray ).avg (), exceptionMessage );
471
470
assertUnsupported (() -> query .property (simpleString ).avg (), exceptionMessage );
472
471
}
473
472
474
473
@ Test
475
474
public void min_notSupported () {
476
475
Query <TestEntity > query = box .query ().build ();
477
- String exceptionMessage = "Property does not allow max" ; // Note: currently JNI returns wrong error message.
476
+ String exceptionMessage = "This operation is not supported for Property " ;
478
477
assertUnsupported (() -> query .property (simpleBoolean ).min (), exceptionMessage );
479
478
assertUnsupported (() -> query .property (simpleByteArray ).min (), exceptionMessage );
480
479
assertUnsupported (() -> query .property (simpleString ).min (), exceptionMessage );
481
480
482
- assertUnsupported (() -> query .property (simpleFloat ).min (), exceptionMessage );
483
- assertUnsupported (() -> query .property (simpleDouble ).min (), exceptionMessage );
481
+ String exceptionMessage2 = "Use double based min (e.g. `minDouble()`) instead. This operation is not supported for Property " ;
482
+ assertUnsupported (() -> query .property (simpleFloat ).min (), exceptionMessage2 );
483
+ assertUnsupported (() -> query .property (simpleDouble ).min (), exceptionMessage2 );
484
484
}
485
485
486
486
@ Test
487
487
public void minDouble_notSupported () {
488
488
Query <TestEntity > query = box .query ().build ();
489
- String exceptionMessage = "Property does not allow min (double) " ;
489
+ String exceptionMessage = "Not a floating point type. This operation is not supported for Property " ;
490
490
assertUnsupported (() -> query .property (simpleBoolean ).minDouble (), exceptionMessage );
491
491
assertUnsupported (() -> query .property (simpleByteArray ).minDouble (), exceptionMessage );
492
492
assertUnsupported (() -> query .property (simpleString ).minDouble (), exceptionMessage );
@@ -500,19 +500,20 @@ public void minDouble_notSupported() {
500
500
@ Test
501
501
public void max_notSupported () {
502
502
Query <TestEntity > query = box .query ().build ();
503
- String exceptionMessage = "Property does not allow max " ;
503
+ String exceptionMessage = "This operation is not supported for Property " ;
504
504
assertUnsupported (() -> query .property (simpleBoolean ).max (), exceptionMessage );
505
505
assertUnsupported (() -> query .property (simpleByteArray ).max (), exceptionMessage );
506
506
assertUnsupported (() -> query .property (simpleString ).max (), exceptionMessage );
507
507
508
- assertUnsupported (() -> query .property (simpleFloat ).max (), exceptionMessage );
509
- assertUnsupported (() -> query .property (simpleDouble ).max (), exceptionMessage );
508
+ String exceptionMessage2 = "Use double based max (e.g. `maxDouble()`) instead. This operation is not supported for Property " ;
509
+ assertUnsupported (() -> query .property (simpleFloat ).max (), exceptionMessage2 );
510
+ assertUnsupported (() -> query .property (simpleDouble ).max (), exceptionMessage2 );
510
511
}
511
512
512
513
@ Test
513
514
public void maxDouble_notSupported () {
514
515
Query <TestEntity > query = box .query ().build ();
515
- String exceptionMessage = "Property does not allow max (double) " ;
516
+ String exceptionMessage = "Not a floating point type. This operation is not supported for Property " ;
516
517
assertUnsupported (() -> query .property (simpleBoolean ).maxDouble (), exceptionMessage );
517
518
assertUnsupported (() -> query .property (simpleByteArray ).maxDouble (), exceptionMessage );
518
519
assertUnsupported (() -> query .property (simpleString ).maxDouble (), exceptionMessage );
@@ -526,11 +527,11 @@ public void maxDouble_notSupported() {
526
527
@ Test
527
528
public void sum_notSupported () {
528
529
Query <TestEntity > query = box .query ().build ();
529
- String exceptionMessage = "Property does not allow sum " ;
530
+ String exceptionMessage = "Cannot calculate sum. This function is for integer types only. This operation is not supported for Property " ;
530
531
assertUnsupported (() -> query .property (simpleByteArray ).sum (), exceptionMessage );
531
532
assertUnsupported (() -> query .property (simpleString ).sum (), exceptionMessage );
532
533
533
- String exceptionMessage2 = "Please use double based sum (e.g. `sumDouble()`) instead for property " ;
534
+ String exceptionMessage2 = "Please use the double based sum instead. This operation is not supported for Property " ;
534
535
assertUnsupported (() -> query .property (simpleFloat ).sum (), exceptionMessage2 );
535
536
assertUnsupported (() -> query .property (simpleDouble ).sum (), exceptionMessage2 );
536
537
}
0 commit comments