Search in sources :

Example 26 with Code

use of org.eclipse.californium.core.coap.CoAP.Code in project mule-coap-connector by teslanet-nl.

the class InsecureClientTest method testInsecureClientPost.

@Test(timeout = 15000)
public void testInsecureClientPost() throws Exception {
    MuleEventSpy spy = spyMessage();
    Code call = Code.POST;
    CoapClient client = getClient(getPath(call));
    Request request = new Request(call);
    request.setPayload("nothing important");
    CoapResponse response = client.advanced(request);
    assertNull("should not receive a response", response);
    assertSpy(spy);
    client.shutdown();
}
Also used : CoapResponse(org.eclipse.californium.core.CoapResponse) Request(org.eclipse.californium.core.coap.Request) Code(org.eclipse.californium.core.coap.CoAP.Code) MuleEventSpy(nl.teslanet.mule.connectors.coap.test.utils.MuleEventSpy) CoapClient(org.eclipse.californium.core.CoapClient) Test(org.junit.Test)

Aggregations

Code (org.eclipse.californium.core.coap.CoAP.Code)26 Request (org.eclipse.californium.core.coap.Request)18 ResponseCode (org.eclipse.californium.core.coap.CoAP.ResponseCode)14 CoapResponse (org.eclipse.californium.core.CoapResponse)12 CoapClient (org.eclipse.californium.core.CoapClient)11 Test (org.junit.Test)11 Future (io.vertx.core.Future)8 OptionSet (org.eclipse.californium.core.coap.OptionSet)8 Test (org.junit.jupiter.api.Test)8 URI (java.net.URI)7 Truth.assertThat (com.google.common.truth.Truth.assertThat)6 Handler (io.vertx.core.Handler)6 Promise (io.vertx.core.Promise)6 Timeout (io.vertx.junit5.Timeout)6 VertxTestContext (io.vertx.junit5.VertxTestContext)6 URISyntaxException (java.net.URISyntaxException)6 StandardCharsets (java.nio.charset.StandardCharsets)6 X509Certificate (java.security.cert.X509Certificate)6 List (java.util.List)6 TimeUnit (java.util.concurrent.TimeUnit)6