@Test
public void syncRequest() throws Exception {

    doAnswer(m -> {
        cliReceive(newCoapPacket(LOCAL_5683).mid(100).payload("AAA").ack(Code.C205_CONTENT).build());
        return null;
    }).when(coapTransport).sendPacket0(eq(newCoapPacket(LOCAL_5683).mid(100).uriPath("/test").get().build()), any(), any());
    assertNotNull(client.resource("/test").sync().invokeMethod(Method.GET));
    //PUT
    doAnswer(m -> {
        cliReceive(newCoapPacket(LOCAL_5683).mid(101).payload("AAA").ack(Code.C205_CONTENT).build());
        return null;
    }).when(coapTransport).sendPacket0(eq(newCoapPacket(LOCAL_5683).mid(101).uriPath("/test").put().build()), any(), any());
    assertNotNull(client.resource("/test").sync().invokeMethod(Method.PUT));
    //POST
    doAnswer(m -> {
        cliReceive(newCoapPacket(LOCAL_5683).mid(102).payload("AAA").ack(Code.C205_CONTENT).build());
        return null;
    }).when(coapTransport).sendPacket0(eq(newCoapPacket(LOCAL_5683).mid(102).uriPath("/test").post().build()), any(), any());
    assertNotNull(client.resource("/test").sync().invokeMethod(Method.POST));
    //DELETE
    doAnswer(m -> {
        cliReceive(newCoapPacket(LOCAL_5683).mid(103).payload("AAA").ack(Code.C205_CONTENT).build());
        return null;
    }).when(coapTransport).sendPacket0(eq(newCoapPacket(LOCAL_5683).mid(103).uriPath("/test").delete().build()), any(), any());
    assertNotNull(client.resource("/test").sync().invokeMethod(Method.DELETE));
}