break; case HTTP: probe.httpGet = new HTTPGetAction(); probe.httpGet.path = healthConfig.urlPath; probe.httpGet.port = String.valueOf(healthConfig.port);
@Test public void testConvertPodContainerProbeToHealthConfigHTTP() { Container podContainer = new Container(); podContainer.livenessProbe = new Probe(); podContainer.livenessProbe.httpGet = new HTTPGetAction(); podContainer.livenessProbe.httpGet.port = "8080"; podContainer.livenessProbe.httpGet.path = "/health"; podContainer.livenessProbe.timeoutSeconds = 3; HealthConfig expectedHealthConfig = new HealthConfig(); expectedHealthConfig.protocol = RequestProtocol.HTTP; expectedHealthConfig.httpVersion = HttpVersion.HTTP_v1_1; expectedHealthConfig.httpMethod = Action.GET; expectedHealthConfig.urlPath = "/health"; expectedHealthConfig.port = 8080; expectedHealthConfig.timeoutMillis = 3000; HealthConfig actualHealthConfig = fromPodContainerProbeToContainerDescriptionHealthConfig( podContainer); assertNotNull(actualHealthConfig); assertEquals(actualHealthConfig.protocol, expectedHealthConfig.protocol); assertEquals(actualHealthConfig.port, expectedHealthConfig.port); assertEquals(actualHealthConfig.httpMethod, expectedHealthConfig.httpMethod); assertEquals(actualHealthConfig.httpVersion, expectedHealthConfig.httpVersion); assertEquals(actualHealthConfig.urlPath, expectedHealthConfig.urlPath); assertEquals(actualHealthConfig.timeoutMillis, expectedHealthConfig.timeoutMillis); }
expectedProbe2.httpGet = new HTTPGetAction(); expectedProbe2.httpGet.path = "/test"; expectedProbe2.httpGet.port = "32000";