public static int getMaxJettyThreads(ServiceProperties serviceProps) { return serviceProps.getIntegerProperty(MAX_JETTY_THREADS, DEFAULT_MAX_JETTY_THREADS); }
public static int getMinJettyThreads(ServiceProperties serviceProps) { return serviceProps.getIntegerProperty(MIN_JETTY_THREADS, DEFAULT_MIN_JETTY_THREADS); }
public static int getHttpConnectTimeout(ServiceProperties serviceProps) { return serviceProps.getIntegerProperty(HTTP_CONNECT_TIMEOUT, DEFAULT_HTTP_CONNECT_TIMEOUT); }
public static int getKafkaMaxBlockMs(ServiceProperties serviceProps) { return serviceProps.getIntegerProperty(KAFKA_MAX_BLOCK_MS, DEFAULT_KAFKA_MAX_BLOCK_MS); }
public static int getHttpAddressResolutionTimeout(ServiceProperties serviceProps) { return serviceProps.getIntegerProperty(HTTP_ADDRESS_RESOLUTION_TIMEOUT, DEFAULT_HTTP_ADDRESS_RESOLUTION_TIMEOUT); }
public static int getReadinessCheckPort(ServiceProperties serviceProps) { return serviceProps.getIntegerProperty(READINESS_CHECK_PORT, DEFAULT_READINESS_CHECK_PORT); }
public static int getKafkaRequestTimeoutMs(ServiceProperties serviceProps) { return serviceProps.getIntegerProperty(KAFKA_REQUEST_TIMEOUT_MS, DEFAULT_KAFKA_REQUEST_TIMEOUT_MS); }
@Inject public HealthCheckManager(MetricBuilderFactory metricBuilderFactory, RegistrationManager registrationManager, ServiceProperties serviceProps, HttpClient httpClient) { this.metricBuilderFactory = metricBuilderFactory; this.registrationManager = registrationManager; this.serviceProps = serviceProps; this.serviceId = serviceProps.getServiceInstanceId(); this.httpClient = httpClient; pollTime = serviceProps.getIntegerProperty(HEALTH_CHECK_POLL_INTERVAL, DEFAULT_HEALTH_CHECK_POLL_INTERVAL); }
@Test public void integerValueInvalid() { props.addProperty("foo", "bar"); assertThat(props.getIntegerProperty("foo", 42)).isEqualTo(42); }
@Test public void integerValueHappyPath() { props.addProperty("foo", "42"); assertThat(props.getIntegerProperty("foo", 42)).isEqualTo(42); }