Response code fix
This commit is contained in:
parent
42ae98023b
commit
a89802e801
@ -239,7 +239,7 @@ public abstract class AbstractCoapAttributesIntegrationTest extends AbstractCoap
|
|||||||
String awaitAlias = "await Json Test Subscribe To AttributesUpdates (client.getObserveRelation)";
|
String awaitAlias = "await Json Test Subscribe To AttributesUpdates (client.getObserveRelation)";
|
||||||
await(awaitAlias)
|
await(awaitAlias)
|
||||||
.atMost(DEFAULT_WAIT_TIMEOUT_SECONDS, TimeUnit.SECONDS)
|
.atMost(DEFAULT_WAIT_TIMEOUT_SECONDS, TimeUnit.SECONDS)
|
||||||
.until(() -> ResponseCode.VALID.equals(callbackCoap.getResponseCode()) &&
|
.until(() -> ResponseCode.CONTENT.equals(callbackCoap.getResponseCode()) &&
|
||||||
callbackCoap.getObserve() != null &&
|
callbackCoap.getObserve() != null &&
|
||||||
0 == callbackCoap.getObserve().intValue());
|
0 == callbackCoap.getObserve().intValue());
|
||||||
if (emptyCurrentStateNotification) {
|
if (emptyCurrentStateNotification) {
|
||||||
@ -286,7 +286,7 @@ public abstract class AbstractCoapAttributesIntegrationTest extends AbstractCoap
|
|||||||
CoapObserveRelation observeRelation = client.getObserveRelation(callbackCoap);
|
CoapObserveRelation observeRelation = client.getObserveRelation(callbackCoap);
|
||||||
await(awaitAlias)
|
await(awaitAlias)
|
||||||
.atMost(DEFAULT_WAIT_TIMEOUT_SECONDS, TimeUnit.SECONDS)
|
.atMost(DEFAULT_WAIT_TIMEOUT_SECONDS, TimeUnit.SECONDS)
|
||||||
.until(() -> ResponseCode.VALID.equals(callbackCoap.getResponseCode()) &&
|
.until(() -> ResponseCode.CONTENT.equals(callbackCoap.getResponseCode()) &&
|
||||||
callbackCoap.getObserve() != null &&
|
callbackCoap.getObserve() != null &&
|
||||||
0 == callbackCoap.getObserve().intValue());
|
0 == callbackCoap.getObserve().intValue());
|
||||||
|
|
||||||
|
|||||||
@ -485,9 +485,7 @@ public class DefaultCoapClientContext implements CoapClientContext {
|
|||||||
TbCoapObservationState attrs = state.getAttrs();
|
TbCoapObservationState attrs = state.getAttrs();
|
||||||
if (attrs != null) {
|
if (attrs != null) {
|
||||||
try {
|
try {
|
||||||
Response resp = state.getAdaptor().convertToPublish(msg);
|
Response response = state.getAdaptor().convertToPublish(msg);
|
||||||
Response response = new Response(ResponseCode.VALID);
|
|
||||||
response.setPayload(resp.getPayload());
|
|
||||||
response.getOptions().setObserve(attrs.getObserveCounter().getAndIncrement());
|
response.getOptions().setObserve(attrs.getObserveCounter().getAndIncrement());
|
||||||
respond(attrs.getExchange(), response, state.getContentFormat());
|
respond(attrs.getExchange(), response, state.getContentFormat());
|
||||||
} catch (AdaptorException e) {
|
} catch (AdaptorException e) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user