ProbeGenerator { protected static io.fabric8.kubernetes.api.model.Probe tlsSidecarLivenessProbe(TlsSidecar tlsSidecar) { Probe tlsSidecarLivenessProbe = DEFAULT_TLS_SIDECAR_PROBE; if (tlsSidecar != null && tlsSidecar.getLivenessProbe() != null) { tlsSidecarLivenessProbe = tlsSidecar.getLivenessProbe(); } return ProbeGenerator.execProbe(tlsSidecarLivenessProbe, Arrays.asList("/opt/stunnel/stunnel_healthcheck.sh", "2181")); } private  ProbeGenerator(); static ProbeBuilder defaultBuilder(Probe probeConfig); static io.fabric8.kubernetes.api.model.Probe httpProbe(Probe probeConfig, String path, String port); static io.fabric8.kubernetes.api.model.Probe execProbe(Probe probeConfig, List<String> command); static final io.strimzi.api.kafka.model.Probe DEFAULT_TLS_SIDECAR_PROBE; }
@Test public void testTlsSidecarLivenessProbe() { Probe probe = ProbeGenerator.tlsSidecarLivenessProbe(TLS_SIDECAR); assertThat(probe, is(new ProbeBuilder() .withNewExec() .addToCommand("/opt/stunnel/stunnel_healthcheck.sh", "2181") .endExec() .withInitialDelaySeconds(1) .withTimeoutSeconds(2) .withPeriodSeconds(3) .withSuccessThreshold(4) .withFailureThreshold(5) .build() )); }
@Test public void testTlsSidecarLivenessProbeWithNullTlsSidecarDefaults() { Probe probe = ProbeGenerator.tlsSidecarLivenessProbe(null); assertThat(probe, is(new ProbeBuilder() .withNewExec() .addToCommand("/opt/stunnel/stunnel_healthcheck.sh", "2181") .endExec() .withInitialDelaySeconds(15) .withTimeoutSeconds(5) .build() )); }
@Test public void testTlsSidecarReadinessProbeWithNullTlsSidecarDefaults() { Probe probe = ProbeGenerator.tlsSidecarLivenessProbe(null); assertThat(probe, is(new ProbeBuilder() .withNewExec() .addToCommand("/opt/stunnel/stunnel_healthcheck.sh", "2181") .endExec() .withInitialDelaySeconds(15) .withTimeoutSeconds(5) .build() )); }