66import io .zenoh .handlers .Handler ;
77import io .zenoh .keyexpr .KeyExpr ;
88import io .zenoh .query .*;
9- import io .zenoh .qos .CongestionControl ;
10- import io .zenoh .qos .Priority ;
119import io .zenoh .qos .QoS ;
1210import io .zenoh .sample .Sample ;
1311import io .zenoh .sample .SampleKind ;
@@ -47,16 +45,6 @@ public void tearDown() throws ZError {
4745 public void queryableRunsWithCallback () throws ZError , InterruptedException {
4846 var timestamp = new TimeStamp (Date .from (Instant .now ()));
4947
50- var sample = new Sample (
51- testKeyExpr ,
52- testPayload ,
53- Encoding .defaultEncoding (),
54- SampleKind .PUT ,
55- timestamp ,
56- new QoS (CongestionControl .BLOCK , Priority .DATA , false ),
57- null
58- );
59-
6048 var queryable = session .declareQueryable (testKeyExpr , query ->
6149 {
6250 try {
@@ -73,7 +61,10 @@ public void queryableRunsWithCallback() throws ZError, InterruptedException {
7361 Thread .sleep (1000 );
7462 assertNotNull (reply [0 ]);
7563 Sample receivedSample = ((Reply .Success ) reply [0 ]).getSample ();
76- assertEquals (sample , receivedSample );
64+ assertEquals (testPayload , receivedSample .getPayload ());
65+ assertEquals (Encoding .defaultEncoding (), receivedSample .getEncoding ());
66+ assertEquals (SampleKind .PUT , receivedSample .getKind ());
67+ assertEquals (timestamp , receivedSample .getTimestamp ());
7768 queryable .close ();
7869 }
7970
@@ -137,8 +128,6 @@ public void queryReplySuccessTest() throws ZError, InterruptedException {
137128 Queryable queryable = session .declareQueryable (testKeyExpr , query -> {
138129 var options = new ReplyOptions ();
139130 options .setTimeStamp (timestamp );
140- options .setPriority (Priority .DATA_HIGH );
141- options .setCongestionControl (CongestionControl .DROP );
142131 options .setExpress (true );
143132 try {
144133 query .reply (testKeyExpr , message , options );
@@ -158,9 +147,7 @@ public void queryReplySuccessTest() throws ZError, InterruptedException {
158147 var sample = ((Reply .Success ) receivedReply [0 ]).getSample ();
159148 assertEquals (message , sample .getPayload ());
160149 assertEquals (timestamp , sample .getTimestamp ());
161- assertEquals (Priority .DATA_HIGH , sample .getPriority ());
162150 assertTrue (sample .getQos ().getExpress ());
163- assertEquals (CongestionControl .DROP , sample .getCongestionControl ());
164151 }
165152
166153 @ Test
0 commit comments