DockerClient.testOnly constructor

  1. @visibleForTesting
DockerClient.testOnly()

Creates a DockerClient with no real socket connection.

The socket path is set to a non-existent path so that any method that tries to make an actual Docker API call will fail immediately. This constructor exists solely to enable unit tests of pure parsing logic (e.g. decodeChunked, stripDockerLogHeaders) without a Docker daemon.

Implementation

@visibleForTesting
DockerClient.testOnly()
    : _socketPath = '/dev/null',
      _isTcp = false;