@Test public void getWindowTest() throws InterruptedException, ExecutionException { assertNormalBehavior( () -> CompletableFuture.completedFuture(new ResponseMessage(1, null, new MessagePackExtensionType((byte) NeovimCustomType.WINDOW.getTypeId(), new byte[]{3}))), () -> tabpageStreamApi.getWindow(), request -> assertMethodAndArguments(request, NeovimTabpageApi.GET_WINDOW), result -> assertEquals(3, result.get().getId()) ); assertErrorBehavior( () -> tabpageStreamApi.getWindow(), request -> assertMethodAndArguments(request, NeovimTabpageApi.GET_WINDOW) ); }
@Override public CompletableFuture<NeovimWindowApi> getWindow() { return sendWithResponseOfMsgPackType(prepareMessage(GET_WINDOW), Window.class) .thenApply(window -> new WindowStreamApi(reactiveRpcStreamer, window)); }
TabpageStreamApi extends BaseStreamApi implements NeovimTabpageApi { @Override public CompletableFuture<NeovimWindowApi> getWindow() { return sendWithResponseOfMsgPackType(prepareMessage(GET_WINDOW), Window.class) .thenApply(window -> new WindowStreamApi(reactiveRpcStreamer, window)); } }
TabpageStreamApi extends BaseStreamApi implements NeovimTabpageApi { @Override public CompletableFuture<NeovimWindowApi> getWindow() { return sendWithResponseOfMsgPackType(prepareMessage(GET_WINDOW), Window.class) .thenApply(window -> new WindowStreamApi(reactiveRpcStreamer, window)); } TabpageStreamApi(ReactiveRpcStreamer reactiveRpcStreamer, Tabpage model); }
TabpageStreamApi extends BaseStreamApi implements NeovimTabpageApi { @Override public CompletableFuture<NeovimWindowApi> getWindow() { return sendWithResponseOfMsgPackType(prepareMessage(GET_WINDOW), Window.class) .thenApply(window -> new WindowStreamApi(reactiveRpcStreamer, window)); } TabpageStreamApi(ReactiveRpcStreamer reactiveRpcStreamer, Tabpage model); @Override Tabpage get(); @Override CompletableFuture<List<NeovimWindowApi>> getWindows(); @Override CompletableFuture<NeovimWindowApi> getWindow(); @Override CompletableFuture<Object> getVar(String name); @Override CompletableFuture<Void> setVar(String name, Object value); @Override CompletableFuture<Void> deleteVar(String name); @Override CompletableFuture<Integer> getNumber(); @Override CompletableFuture<Boolean> isValid(); @Override String toString(); }
TabpageStreamApi extends BaseStreamApi implements NeovimTabpageApi { @Override public CompletableFuture<NeovimWindowApi> getWindow() { return sendWithResponseOfMsgPackType(prepareMessage(GET_WINDOW), Window.class) .thenApply(window -> new WindowStreamApi(reactiveRpcStreamer, window)); } TabpageStreamApi(ReactiveRpcStreamer reactiveRpcStreamer, Tabpage model); @Override Tabpage get(); @Override CompletableFuture<List<NeovimWindowApi>> getWindows(); @Override CompletableFuture<NeovimWindowApi> getWindow(); @Override CompletableFuture<Object> getVar(String name); @Override CompletableFuture<Void> setVar(String name, Object value); @Override CompletableFuture<Void> deleteVar(String name); @Override CompletableFuture<Integer> getNumber(); @Override CompletableFuture<Boolean> isValid(); @Override String toString();  }