@Test public void testFakeCodeRequet() { Request request = Request.newGet(); Request faked = OptionJuggle.setFakeCodeRequest(request); assertEquals(CoAP.Code.POST, faked.getCode()); }
public static Request setFakeCodeRequest(Request request) { Code fakeCode = request.getOptions().hasObserve() ? Code.FETCH : Code.POST; return requestWithNewCode(request, fakeCode); }
OptionJuggle { public static Request setFakeCodeRequest(Request request) { Code fakeCode = request.getOptions().hasObserve() ? Code.FETCH : Code.POST; return requestWithNewCode(request, fakeCode); } }
OptionJuggle { public static Request setFakeCodeRequest(Request request) { Code fakeCode = request.getOptions().hasObserve() ? Code.FETCH : Code.POST; return requestWithNewCode(request, fakeCode); }  }
OptionJuggle { public static Request setFakeCodeRequest(Request request) { Code fakeCode = request.getOptions().hasObserve() ? Code.FETCH : Code.POST; return requestWithNewCode(request, fakeCode); }  static OptionSet prepareUoptions(OptionSet options); static OptionSet prepareEoptions(OptionSet options); static OptionSet discardEOptions(OptionSet optionSet); static Request setFakeCodeRequest(Request request); static Request setRealCodeRequest(Request request, Code realCode); static Response setFakeCodeResponse(Response response); static Response setRealCodeResponse(Response response, ResponseCode realCode); static OptionSet merge(OptionSet eOptions, OptionSet uOptions); }
OptionJuggle { public static Request setFakeCodeRequest(Request request) { Code fakeCode = request.getOptions().hasObserve() ? Code.FETCH : Code.POST; return requestWithNewCode(request, fakeCode); }  static OptionSet prepareUoptions(OptionSet options); static OptionSet prepareEoptions(OptionSet options); static OptionSet discardEOptions(OptionSet optionSet); static Request setFakeCodeRequest(Request request); static Request setRealCodeRequest(Request request, Code realCode); static Response setFakeCodeResponse(Response response); static Response setRealCodeResponse(Response response, ResponseCode realCode); static OptionSet merge(OptionSet eOptions, OptionSet uOptions);  }