ProbeGenerator { public static ProbeBuilder defaultBuilder(Probe probeConfig) { if (probeConfig == null) { throw new IllegalArgumentException(); } return new ProbeBuilder() .withInitialDelaySeconds(probeConfig.getInitialDelaySeconds()) .withTimeoutSeconds(probeConfig.getTimeoutSeconds()) .withPeriodSeconds(probeConfig.getPeriodSeconds()) .withSuccessThreshold(probeConfig.getSuccessThreshold()) .withFailureThreshold(probeConfig.getFailureThreshold()); } 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 testNullProbeConfigThrowsException() { assertThrows(IllegalArgumentException.class, () -> ProbeGenerator.defaultBuilder(null)); }
@Test public void testDefaultBuilder() { Probe probe = ProbeGenerator.defaultBuilder(DEFAULT_CONFIG) .build(); assertThat(probe, is(new ProbeBuilder() .withInitialDelaySeconds(1) .withTimeoutSeconds(2) .withPeriodSeconds(3) .withSuccessThreshold(4) .withFailureThreshold(5) .build() )); }
@Test public void testDefaultBuilderNoValues() { Probe probe = ProbeGenerator.defaultBuilder(new io.strimzi.api.kafka.model.ProbeBuilder().build()) .build(); assertThat(probe, is(new ProbeBuilder() .withInitialDelaySeconds(15) .withTimeoutSeconds(5) .build() )); }