@Test public void getWindowsTest() throws InterruptedException, ExecutionException { var windows = List.of( new MessagePackExtensionType((byte) NeovimCustomType.WINDOW.getTypeId(), new byte[]{1}), new MessagePackExtensionType((byte) NeovimCustomType.WINDOW.getTypeId(), new byte[]{2}), new MessagePackExtensionType((byte) NeovimCustomType.WINDOW.getTypeId(), new byte[]{3}) ); assertNormalBehavior( () -> CompletableFuture.completedFuture(new ResponseMessage(1, null, windows)), () -> tabpageStreamApi.getWindows(), request -> assertMethodAndArguments(request, NeovimTabpageApi.LIST_WINDOWS), result -> { assertEquals(1, result.get(0).get().getId()); assertEquals(2, result.get(1).get().getId()); assertEquals(3, result.get(2).get().getId()); } ); assertErrorBehavior( () -> tabpageStreamApi.getWindows(), request -> assertMethodAndArguments(request, NeovimTabpageApi.LIST_WINDOWS) ); }
@Override public CompletableFuture<List<NeovimWindowApi>> getWindows() { return sendWithResponseOfListOfMsgPackType(prepareMessage(LIST_WINDOWS), Window.class) .thenApply(windows -> windows.stream() .map(window -> new WindowStreamApi(reactiveRpcStreamer, window)).collect(Collectors.toList())); }
TabpageStreamApi extends BaseStreamApi implements NeovimTabpageApi { @Override public CompletableFuture<List<NeovimWindowApi>> getWindows() { return sendWithResponseOfListOfMsgPackType(prepareMessage(LIST_WINDOWS), Window.class) .thenApply(windows -> windows.stream() .map(window -> new WindowStreamApi(reactiveRpcStreamer, window)).collect(Collectors.toList())); } }
TabpageStreamApi extends BaseStreamApi implements NeovimTabpageApi { @Override public CompletableFuture<List<NeovimWindowApi>> getWindows() { return sendWithResponseOfListOfMsgPackType(prepareMessage(LIST_WINDOWS), Window.class) .thenApply(windows -> windows.stream() .map(window -> new WindowStreamApi(reactiveRpcStreamer, window)).collect(Collectors.toList())); } TabpageStreamApi(ReactiveRpcStreamer reactiveRpcStreamer, Tabpage model); }
TabpageStreamApi extends BaseStreamApi implements NeovimTabpageApi { @Override public CompletableFuture<List<NeovimWindowApi>> getWindows() { return sendWithResponseOfListOfMsgPackType(prepareMessage(LIST_WINDOWS), Window.class) .thenApply(windows -> windows.stream() .map(window -> new WindowStreamApi(reactiveRpcStreamer, window)).collect(Collectors.toList())); } 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<List<NeovimWindowApi>> getWindows() { return sendWithResponseOfListOfMsgPackType(prepareMessage(LIST_WINDOWS), Window.class) .thenApply(windows -> windows.stream() .map(window -> new WindowStreamApi(reactiveRpcStreamer, window)).collect(Collectors.toList())); } 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();  }