Merge pull request #11846 from thingsboard/fix_bug_coap_tests_rc
Fix bug coap tests
This commit is contained in:
commit
22b3cf1499
@ -114,6 +114,13 @@ public abstract class AbstractCoapServerSideRpcIntegrationTest extends AbstractC
|
|||||||
CoapTestCallback callbackCoap = new TestCoapCallbackForRPC(client, false, protobuf);
|
CoapTestCallback callbackCoap = new TestCoapCallbackForRPC(client, false, protobuf);
|
||||||
|
|
||||||
CoapObserveRelation observeRelation = client.getObserveRelation(callbackCoap);
|
CoapObserveRelation observeRelation = client.getObserveRelation(callbackCoap);
|
||||||
|
String awaitAlias = "await Two Way Rpc (client.getObserveRelation)";
|
||||||
|
await(awaitAlias)
|
||||||
|
.atMost(DEFAULT_WAIT_TIMEOUT_SECONDS, TimeUnit.SECONDS)
|
||||||
|
.until(() -> processTwoWayRpcTestWithAwait(callbackCoap, observeRelation, expectedResponseResult));
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean processTwoWayRpcTestWithAwait(CoapTestCallback callbackCoap, CoapObserveRelation observeRelation, String expectedResponseResult) throws Exception {
|
||||||
String awaitAlias = "await Two Way Rpc (client.getObserveRelation)";
|
String awaitAlias = "await Two Way Rpc (client.getObserveRelation)";
|
||||||
await(awaitAlias)
|
await(awaitAlias)
|
||||||
.atMost(DEFAULT_WAIT_TIMEOUT_SECONDS, TimeUnit.SECONDS)
|
.atMost(DEFAULT_WAIT_TIMEOUT_SECONDS, TimeUnit.SECONDS)
|
||||||
@ -146,7 +153,7 @@ public abstract class AbstractCoapServerSideRpcIntegrationTest extends AbstractC
|
|||||||
validateTwoWayStateChangedNotification(callbackCoap, expectedResponseResult, actualResult);
|
validateTwoWayStateChangedNotification(callbackCoap, expectedResponseResult, actualResult);
|
||||||
|
|
||||||
observeRelation.proactiveCancel();
|
observeRelation.proactiveCancel();
|
||||||
assertTrue(observeRelation.isCanceled());
|
return observeRelation.isCanceled();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void processOnLoadResponse(CoapResponse response, CoapTestClient client) {
|
protected void processOnLoadResponse(CoapResponse response, CoapTestClient client) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user