### Question:
KubernetesPlatform extends Platform implements ShellBasedExperiment<KubernetesPodContainer> { @Override public PlatformHealth getPlatformHealth () { try { V1PodList pods = listAllPodsInNamespace(); return (!pods.getItems().isEmpty()) ? PlatformHealth.OK : PlatformHealth.DEGRADED; } catch (ApiException e) { log.error("Kubernetes Platform health check failed", e); return PlatformHealth.FAILED; } } @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 testPlatformHealthNotAvailable () throws ApiException { when(coreV1Api.listNamespacedPod(anyString(), anyString(), anyBoolean(), anyString(), anyString(), anyString(), anyInt(), anyString(), anyInt(), anyBoolean())).thenThrow(new ApiException()); assertEquals(PlatformHealth.FAILED, platform.getPlatformHealth()); }
@Test public void testPlatformHealth () throws ApiException { when(coreV1Api.listNamespacedPod(anyString(), anyString(), anyBoolean(), anyString(), anyString(), anyString(), anyInt(), anyString(), anyInt(), anyBoolean())).thenReturn(getV1PodList(true)); assertEquals(PlatformHealth.OK, platform.getPlatformHealth()); }
@Test public void testPlatformHealthNoNamespacesToTest () throws ApiException { when(coreV1Api.listNamespacedPod(anyString(), anyString(), anyBoolean(), anyString(), anyString(), anyString(), anyInt(), anyString(), anyInt(), anyBoolean())).thenReturn(getV1PodList(true, 0)); assertEquals(PlatformHealth.DEGRADED, platform.getPlatformHealth()); }