use of io.fabric8.mockwebserver.Context in project fabric8-maven-plugin by fabric8io.
the class AbstractSpringBootHealthCheckEnricherSupport method testWithServerPortAndManagementContextPath.
@Test
public void testWithServerPortAndManagementContextPath() {
SpringBootHealthCheckEnricher enricher = new SpringBootHealthCheckEnricher(context);
Properties props = new Properties();
props.put(propertyHelper.getServerPortPropertyKey(), "8282");
props.put(propertyHelper.getManagementContextPathPropertyKey(), "/p1");
Probe probe = enricher.buildProbe(props, 10, null);
assertNotNull(probe);
assertNotNull(probe.getHttpGet());
assertEquals("/p1" + propertyHelper.getActuatorDefaultBasePath() + "/health", probe.getHttpGet().getPath());
assertEquals(8282, probe.getHttpGet().getPort().getIntVal().intValue());
}
use of io.fabric8.mockwebserver.Context in project fabric8-maven-plugin by fabric8io.
the class AbstractSpringBootHealthCheckEnricherSupport method testWithServerPort.
@Test
public void testWithServerPort() {
SpringBootHealthCheckEnricher enricher = new SpringBootHealthCheckEnricher(context);
Properties props = new Properties();
props.put(propertyHelper.getServerPortPropertyKey(), "8282");
Probe probe = enricher.buildProbe(props, 10, null);
assertNotNull(probe);
assertNotNull(probe.getHttpGet());
assertEquals(propertyHelper.getActuatorDefaultBasePath() + "/health", probe.getHttpGet().getPath());
assertEquals(8282, probe.getHttpGet().getPort().getIntVal().intValue());
}
use of io.fabric8.mockwebserver.Context in project fabric8-maven-plugin by fabric8io.
the class AbstractSpringBootHealthCheckEnricherSupport method testSchemeWithServerPort.
@Test
public void testSchemeWithServerPort() {
SpringBootHealthCheckEnricher enricher = new SpringBootHealthCheckEnricher(context);
Properties props = new Properties();
props.put(propertyHelper.getServerPortPropertyKey(), "8443");
Probe probe = enricher.buildProbe(props, 10, null);
assertNotNull(probe);
assertNotNull(probe.getHttpGet());
assertEquals("HTTP", probe.getHttpGet().getScheme());
assertEquals(8443, probe.getHttpGet().getPort().getIntVal().intValue());
}
use of io.fabric8.mockwebserver.Context in project fabric8-maven-plugin by fabric8io.
the class AbstractSpringBootHealthCheckEnricherSupport method testDefaultInitialDelayForLivenessAndReadiness.
@Test
public void testDefaultInitialDelayForLivenessAndReadiness() {
SpringBootHealthCheckEnricher enricher = new SpringBootHealthCheckEnricher(context);
withAllRequiredClasses();
withProjectProperties(new Properties());
Probe probe = enricher.getReadinessProbe();
assertNotNull(probe);
assertEquals(10, probe.getInitialDelaySeconds().intValue());
probe = enricher.getLivenessProbe();
assertNotNull(probe);
assertEquals(180, probe.getInitialDelaySeconds().intValue());
}
use of io.fabric8.mockwebserver.Context in project fabric8-maven-plugin by fabric8io.
the class AbstractSpringBootHealthCheckEnricherSupport method testSchemeWithServerPortAndManagementKeystore.
@Test
public void testSchemeWithServerPortAndManagementKeystore() {
SpringBootHealthCheckEnricher enricher = new SpringBootHealthCheckEnricher(context);
Properties props = new Properties();
props.put(propertyHelper.getServerPortPropertyKey(), "8080");
props.put(propertyHelper.getManagementKeystorePropertyKey(), "classpath:keystore.p12");
Probe probe = enricher.buildProbe(props, 10, null);
assertNotNull(probe);
assertNotNull(probe.getHttpGet());
assertEquals("HTTP", probe.getHttpGet().getScheme());
assertEquals(8080, probe.getHttpGet().getPort().getIntVal().intValue());
}
Aggregations