54
54
import java .util .concurrent .atomic .AtomicReference ;
55
55
import java .util .function .BiConsumer ;
56
56
import java .util .stream .IntStream ;
57
+ import net .jqwik .api .Arbitraries ;
57
58
import org .junit .jupiter .api .*;
58
59
import org .junit .jupiter .params .ParameterizedTest ;
59
60
import org .junit .jupiter .params .provider .CsvSource ;
@@ -785,8 +786,24 @@ void types(TestInfo info) {
785
786
publishSync .down ();
786
787
}
787
788
};
789
+ float fValue = Arbitraries .floats ().sample ();
790
+ double dValue = Arbitraries .doubles ().sample ();
788
791
Publisher publisher = connection .publisherBuilder ().queue (q ).build ();
789
- publisher .publish (publisher .message ().property ("key1" , -1L ), callback );
792
+ publisher .publish (
793
+ publisher
794
+ .message ()
795
+ .property ("key1" , -1L )
796
+ .property ("float" , fValue )
797
+ .property ("fMin" , Float .MIN_VALUE )
798
+ .property ("fMax" , Float .MAX_VALUE )
799
+ .property ("fNegInf" , Float .NEGATIVE_INFINITY )
800
+ .property ("fPosInf" , Float .POSITIVE_INFINITY )
801
+ .property ("double" , dValue )
802
+ .property ("dMin" , Double .MIN_VALUE )
803
+ .property ("dMax" , Double .MAX_VALUE )
804
+ .property ("dNegInf" , Double .NEGATIVE_INFINITY )
805
+ .property ("dPosInf" , Double .POSITIVE_INFINITY ),
806
+ callback );
790
807
assertThat (publishSync ).completes ();
791
808
AtomicReference <Message > message = new AtomicReference <>();
792
809
Sync consumeSync = sync ();
@@ -801,7 +818,18 @@ void types(TestInfo info) {
801
818
})
802
819
.build ();
803
820
assertThat (consumeSync ).completes ();
804
- assertThat (message .get ()).hasProperty ("key1" , -1L );
821
+ assertThat (message .get ())
822
+ .hasProperty ("key1" , -1L )
823
+ .hasProperty ("float" , fValue )
824
+ .hasProperty ("fMin" , Float .MIN_VALUE )
825
+ .hasProperty ("fMax" , Float .MAX_VALUE )
826
+ .hasProperty ("fNegInf" , Float .NEGATIVE_INFINITY )
827
+ .hasProperty ("fPosInf" , Float .POSITIVE_INFINITY )
828
+ .hasProperty ("double" , dValue )
829
+ .hasProperty ("dMin" , Double .MIN_VALUE )
830
+ .hasProperty ("dMax" , Double .MAX_VALUE )
831
+ .hasProperty ("dNegInf" , Double .NEGATIVE_INFINITY )
832
+ .hasProperty ("dPosInf" , Double .POSITIVE_INFINITY );
805
833
}
806
834
807
835
@ Test
0 commit comments