@Test
@Parameters({ "4711", "" })

public void testGetKubernetesClient(String k8sRequestTimeoutConfig) throws Exception {
  var clusterCaCertificate = Resources.toString(Resources.getResource("ca.crt"), UTF_8);
  var clientCertificate = Resources.toString(Resources.getResource("client.crt"), UTF_8);
  var clientKey = Resources.toString(Resources.getResource("client.key"), UTF_8);
  final int expectedK8sRequestTimeout;
  if (!k8sRequestTimeoutConfig.isEmpty()) {
    expectedK8sRequestTimeout = Integer.parseInt(k8sRequestTimeoutConfig);
  } else {
    expectedK8sRequestTimeout = DEFAULT_KUBERNETES_REQUEST_TIMEOUT_MILLIS;
  }
  var client = getKubernetesClient(
      k8sRequestTimeoutConfig,
      clusterCaCertificate,
      clientCertificate, clientKey);
  assertThat(client, is(theInstance(kubernetesClient)));
  verify(kubernetesClientFactory).apply(httpClientCaptor.capture(), k8sClientConfigCaptor.capture());
  var k8sConfig = k8sClientConfigCaptor.getValue();
  var httpClient = httpClientCaptor.getValue();
  assertThat(k8sConfig.getMasterUrl(), is("https://" + ENDPOINT + "/"));
  assertThat(k8sConfig.getCaCertData(), is(clusterCaCertificate));
  assertThat(k8sConfig.getClientCertData(), is(clientCertificate));
  assertThat(k8sConfig.getClientKeyData(), is(clientKey));
  assertThat(k8sConfig.getNamespace(), is(TEST_NAMESPACE));
  assertThat(k8sConfig.getRequestTimeout(), is(expectedK8sRequestTimeout));
  assertThat(httpClient.protocols(), contains(Protocol.HTTP_1_1));
}