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)";
|
||||
await(awaitAlias)
|
||||
.atMost(DEFAULT_WAIT_TIMEOUT_SECONDS, TimeUnit.SECONDS)
|
||||
.until(() -> ResponseCode.VALID.equals(callbackCoap.getResponseCode()) &&
|
||||
.until(() -> ResponseCode.CONTENT.equals(callbackCoap.getResponseCode()) &&
|
||||
callbackCoap.getObserve() != null &&
|
||||
0 == callbackCoap.getObserve().intValue());
|
||||
if (emptyCurrentStateNotification) {
|
||||
@ -286,7 +286,7 @@ public abstract class AbstractCoapAttributesIntegrationTest extends AbstractCoap
|
||||
CoapObserveRelation observeRelation = client.getObserveRelation(callbackCoap);
|
||||
await(awaitAlias)
|
||||
.atMost(DEFAULT_WAIT_TIMEOUT_SECONDS, TimeUnit.SECONDS)
|
||||
.until(() -> ResponseCode.VALID.equals(callbackCoap.getResponseCode()) &&
|
||||
.until(() -> ResponseCode.CONTENT.equals(callbackCoap.getResponseCode()) &&
|
||||
callbackCoap.getObserve() != null &&
|
||||
0 == callbackCoap.getObserve().intValue());
|
||||
|
||||
|
||||
@ -485,9 +485,7 @@ public class DefaultCoapClientContext implements CoapClientContext {
|
||||
TbCoapObservationState attrs = state.getAttrs();
|
||||
if (attrs != null) {
|
||||
try {
|
||||
Response resp = state.getAdaptor().convertToPublish(msg);
|
||||
Response response = new Response(ResponseCode.VALID);
|
||||
response.setPayload(resp.getPayload());
|
||||
Response response = state.getAdaptor().convertToPublish(msg);
|
||||
response.getOptions().setObserve(attrs.getObserveCounter().getAndIncrement());
|
||||
respond(attrs.getExchange(), response, state.getContentFormat());
|
||||
} catch (AdaptorException e) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user