diff --git a/leshan-integration-tests/src/test/java/org/eclipse/leshan/integration/tests/send/DynamicIPSendTest.java b/leshan-integration-tests/src/test/java/org/eclipse/leshan/integration/tests/send/DynamicIPSendTest.java index 68299080ae..bc1da25cd5 100644 --- a/leshan-integration-tests/src/test/java/org/eclipse/leshan/integration/tests/send/DynamicIPSendTest.java +++ b/leshan-integration-tests/src/test/java/org/eclipse/leshan/integration/tests/send/DynamicIPSendTest.java @@ -16,7 +16,7 @@ package org.eclipse.leshan.integration.tests.send; import static org.assertj.core.api.Assertions.assertThat; -import static org.eclipse.leshan.core.ResponseCode.NOT_FOUND; +import static org.eclipse.leshan.core.ResponseCode.BAD_REQUEST; import static org.eclipse.leshan.integration.tests.util.Credentials.GOOD_PSK_ID; import static org.eclipse.leshan.integration.tests.util.Credentials.GOOD_PSK_KEY; import static org.eclipse.leshan.integration.tests.util.Credentials.clientPrivateKey; @@ -142,7 +142,7 @@ public void can_not_send_if_client_ip_changes(Protocol givenProtocol, String giv Arrays.asList("/3/0/1", "/3/0/2"), 1000); // it should failed ! - assertThat(response).hasCode(NOT_FOUND); + assertThat(response).hasCode(BAD_REQUEST); } // TODO OSCORE implement a test with OSCORE diff --git a/leshan-server-cf/src/main/java/org/eclipse/leshan/server/californium/send/SendResource.java b/leshan-server-cf/src/main/java/org/eclipse/leshan/server/californium/send/SendResource.java index 0805b72db7..cde6de88e9 100644 --- a/leshan-server-cf/src/main/java/org/eclipse/leshan/server/californium/send/SendResource.java +++ b/leshan-server-cf/src/main/java/org/eclipse/leshan/server/californium/send/SendResource.java @@ -61,7 +61,7 @@ public void handlePOST(CoapExchange exchange) { // check we have a registration for this identity if (clientProfile == null) { - exchange.respond(ResponseCode.NOT_FOUND, "no registration found"); + exchange.respond(ResponseCode.BAD_REQUEST, "no registration found"); return; }