### Question:
KubernetesPlatform extends Platform implements ShellBasedExperiment<KubernetesPodContainer> { @Override public ApiStatus getApiStatus () { try { getCoreApi().getAPIVersions().getVersions(); return ApiStatus.OK; } catch (ApiException e) { log.error("Kubernetes API health check failed", e); return ApiStatus.ERROR; } } @Autowired  KubernetesPlatform(ApiClient apiClient); String getNamespace(); void setNamespace(String namespace); ContainerHealth checkHealth(KubernetesPodContainer kubernetesPodContainer); @Override ApiStatus getApiStatus(); @Override PlatformLevel getPlatformLevel(); @Override PlatformHealth getPlatformHealth(); @Override boolean isContainerRecycled(Container container); ContainerHealth replicaSetRecovered(KubernetesPodContainer kubernetesPodContainer); boolean isDesiredReplicas(KubernetesPodContainer instance); @Override void recycleContainer(KubernetesPodContainer container); boolean deletePod(KubernetesPodContainer instance); @Override ShellClient getConnectedShellClient(KubernetesPodContainer container);  }### Answer:
@Test public void testApiStatus () throws ApiException { V1APIVersions v1APIVersions = new V1APIVersionsBuilder().addToVersions("1") .withApiVersion("apiVersion") .withKind("kind") .build(); doReturn(v1APIVersions).when(coreApi).getAPIVersions(); Assert.assertEquals(ApiStatus.OK, platform.getApiStatus()); }
@Test public void testApiStatusNotAvailable () throws ApiException { when(coreApi.getAPIVersions()).thenThrow(new ApiException()); Assert.assertEquals(ApiStatus.ERROR, platform.getApiStatus()); }