DefaultRxDockerClient implements RxDockerClient { @Override public HttpStatus restartContainer(final String containerId, final int waitInSecs) { return restartContainerObs(containerId, waitInSecs).toBlocking().single(); } DefaultRxDockerClient(final String dockerHost, final String dockerCertPath); private  DefaultRxDockerClient(final Optional<String> dockerHost, final Optional<String> dockerCertPath); @Override String getApiUri(); @Override Observable<DockerVersion> serverVersionObs(); @Override DockerVersion serverVersion(); @Override Observable<DockerInfo> infoObs(); @Override DockerInfo info(); @Override HttpStatus checkAuth(final AuthConfig authConfig); @Override Observable<HttpStatus> checkAuthObs(final AuthConfig authConfig); @Override HttpStatus ping(); @Override Observable<DockerContainer> listRunningContainerObs(); @Override List<DockerContainer> listRunningContainers(); @Override Observable<DockerContainer> listAllContainersObs(); @Override List<DockerContainer> listAllContainers(); @Override List<DockerContainer> listContainers(QueryParameters queryParameters); @Override Observable<DockerContainer> listContainersObs(QueryParameters queryParameters); @Override DockerContainerResponse createContainer(final DockerContainerRequest request); @Override DockerContainerResponse createContainer(final DockerContainerRequest request, final String name); @Override Observable<DockerContainerResponse> createContainerObs(DockerContainerRequest request); @Override Observable<DockerContainerResponse> createContainerObs(final DockerContainerRequest request, final String name); @Override Observable<DockerContainerResponse> createContainerObs(final DockerContainerRequest request, final Optional<String> name); @Override Observable<DockerContainerResponse> createContainerObs(String jsonRequest); @Override Observable<DockerContainerResponse> createContainerObs(String jsonRequest, String name); @Override DockerContainerResponse createContainer(String jsonRequest); @Override DockerContainerResponse createContainer(String jsonRequest, String name); @Override ContainerInspectResponse inspectContainer(final String containerId); @Override Observable<ContainerInspectResponse> inspectContainerObs(final String containerId); @Override ProcessListResponse listProcesses(final String containerId); @Override Observable<ProcessListResponse> listProcessesObs(final String containerId); @Override HttpStatus startContainer(final String containerId); @Override Observable<HttpStatus> startContainerObs(final String containerId); @Override HttpStatus stopContainer(final String containerId, final int waitInSecs); @Override Observable<HttpStatus> stopContainerObs(final String containerId, final int waitInSecs); @Override HttpStatus restartContainer(final String containerId, final int waitInSecs); @Override Observable<HttpStatus> restartContainerObs(final String containerId, final int waitInSecs); @Override HttpStatus killRunningContainer(final String containerId); @Override Observable<HttpStatus> killRunningContainerObs(final String containerId); @Override HttpStatus removeContainer(final String containerId); @Override HttpStatus removeContainer(final String containerId, final boolean removeVolume, final boolean force); @Override Observable<HttpStatus> removeContainerObs(final String containerId); @Override Observable<HttpStatus> removeContainerObs(final String containerId, final boolean removeVolume, final boolean force); @Override HttpStatus renameContainer(final String containerId, final String newName); @Override Observable<HttpStatus> renameContainerObs(final String containerId, final String newName); @Override HttpStatus waitContainer(final String containerId); @Override Observable<HttpStatus> waitContainerObs(final String containerId); @Override void exportContainer(final String containerId, final Path pathToExportTo); @Override Observable<ContainerStats> containerStatsObs(final String containerId); @Override Observable<String> containerLogsObs(final String containerId); @Override Observable<String> containerLogsObs(final String containerId, ContainerLogQueryParameters queryParameters); @Override List<ContainerChange> inspectChangesOnContainerFilesystem(final String containerId); @Override Observable<ContainerChange> inspectChangesOnContainerFilesystemObs(final String containerId); @Override HttpStatus resizeContainerTty(final String containerId, QueryParameter... queryParameters); @Override Observable<HttpStatus> resizeContainerTtyObs(final String containerId, QueryParameter... queryParameters); @Override HttpStatus pauseContainer(final String containerId); @Override Observable<HttpStatus> pauseContainerObs(final String containerId); @Override HttpStatus unpauseContainer(final String containerId); @Override Observable<HttpStatus> unpauseContainerObs(final String containerId); @Override Observable<String> attachContainerObs(final String containerId, QueryParameter... queryParameters); @Override ContainerArchiveInformation containerArchiveInformation(final String containerId, final String path); @Override Observable<Response> containerArchiveInformationObs(final String containerId, final String path); @Override void containerArchive(final String containerId, final String path, Path pathToExportTo); @Override Observable<ExecCreateResponse> execCreateObs(final String containerId, ExecCreateRequest request); @Override Observable<ExecCreateResponse> execCreateObs(final String containerId, final String... cmd); @Override Observable<String> execStartObs(final String execId, ExecStartRequest request); @Override Observable<String> execStartObs(final String execId); @Override HttpStatus pullImage(final String fromImage); @Override HttpStatus pullImageFromRegistry(final String image, final String registry); @Override HttpStatus pullImage(final String image, AuthConfig authConfig); @Override HttpStatus pullImage(final String fromImage, final String tag); @Override HttpStatus pullImage(final String image, final String tag, AuthConfig authConfig); @Override HttpStatus pullImage(final String fromImage, final String user, final String tag); @Override HttpStatus pullImage(final String image, final String user, final String tag, AuthConfig authConfig); @Override Observable<String> pullImageObs(final String fromImage); @Override Observable<String> pullImageObs(final String fromImage, final String user, final String tag); @Override Observable<String> pullImageObs(final String fromImage, final String user, final String tag, AuthConfig authConfig); @Override Stream<DockerImage> listAllImages(); @Override Stream<DockerImage> listImages(final String imageName); @Override Stream<DockerImage> listDanglingImages(); @Override Stream<DockerImage> listImages(); @Override Stream<DockerImage> listImages(ImageListQueryParameters queryParameters); @Override Observable<DockerImage> listImagesObs(ImageListQueryParameters queryParameters); @Override HttpStatus removeImage(final String imageName, final boolean noPrune, final boolean force); @Override HttpStatus removeImage(final String imageName); @Override Observable<HttpStatus> removeImageObs(final String imageName); @Override Observable<HttpStatus> removeImageObs(final String imageName, final boolean noPrune, final boolean force); @Override Stream<DockerImageInfo> searchImages(final String searchTerm, Predicate<DockerImageInfo> predicate); @Override Observable<DockerImageInfo> searchImagesObs(final String searchTerm, Predicate<DockerImageInfo> predicate); @Override Observable<String> buildImageObs(final String repositoryName, final Path pathToTarArchive); @Override Observable<String> buildImageObs(final String repositoryName, final Path pathToTarArchive, BuildImageQueryParameters queryParameters); @Override Observable<String> buildImageObs(final String repositoryName, BuildImageQueryParameters queryParameters); @Override HttpStatus tagImage(final String image, final ImageTagQueryParameters queryParameters); @Override Observable<HttpStatus> tagImageObs(final String image, final ImageTagQueryParameters queryParameters); @Override Stream<DockerImageHistory> imageHistory(final String image); @Override Observable<DockerImageHistory> imageHistoryObs(final String image); @Override DockerImageInspectDetails inspectImage(final String image); @Override Observable<DockerImageInspectDetails> inspectImageObs(final String image); @Override HttpStatus pushImage(final String image, AuthConfig authConfig); @Override Observable<String> pushImageObs(final String image, AuthConfig authConfig); @Override Path getTarballForAllImagesInRepository(final String image, Path exportDir); @Override Path getTarballContainingAllImages(Path exportDir, String filename, ImageTag... imageTags); @Override HttpStatus loadImagesAndTagsTarball(final Path pathToTarArchive); @Override Observable<HttpStatus> loadImagesAndTagsTarballObs(final Path pathToTarArchive); @Override HttpStatus createImage(final String name, final Path imageToLoad); @Override Observable<String> createImageObs(final String name, final Path imageToLoad);  }
@Test @CreateDockerContainer(container = CONTAINER_NAME) public void shouldRestartAContainer() throws Exception { HttpStatus status = client.restartContainer(containerRule.containerIds().get(0), 5); assertThat(status.code(), is(equalTo(204))); }