BaseSupportConfig { public boolean isProactiveSupportEnabled() { if (properties == null) { return false; } return getMetricsEnabled(); } BaseSupportConfig(Properties originals);  BaseSupportConfig(Properties originals, String endpointPath); Properties getProperties(); static String getEndpoint(boolean secure, String customerId, String endpointPath); boolean isProactiveSupportEnabled(); static boolean isAnonymousUser(String customerId); static boolean isTestUser(String customerId); static boolean isConfluentCustomer(String customerId); static boolean isSyntacticallyCorrectCustomerId(String customerId); static boolean isCaseSensitiveCustomerId(String customerId); String getCustomerId(); static String getCustomerId(Properties props); long getReportIntervalMs(); String getKafkaTopic(); boolean getMetricsEnabled(); boolean isHttpEnabled(); String getEndpointHTTP(); void setEndpointHTTP(String endpointHTTP); boolean isHttpsEnabled(); String getEndpointHTTPS(); void setEndpointHTTPS(String endpointHTTPS); String getProxy(); static final String CONFLUENT_PHONE_HOME_ENDPOINT_SUFFIX_USER_ANON; static final String CONFLUENT_PHONE_HOME_ENDPOINT_SUFFIX_USER_TEST; static final String CONFLUENT_PHONE_HOME_ENDPOINT_SUFFIX_USER_CUSTOMER; static final String CONFLUENT_SUPPORT_METRICS_ENABLE_CONFIG; static final String CONFLUENT_SUPPORT_METRICS_ENABLE_DEFAULT; static final String CONFLUENT_SUPPORT_CUSTOMER_ID_CONFIG; static final String CONFLUENT_SUPPORT_CUSTOMER_ID_DEFAULT; static final String CONFLUENT_SUPPORT_TEST_ID_DEFAULT; static final String CONFLUENT_SUPPORT_METRICS_REPORT_INTERVAL_HOURS_CONFIG; static final String CONFLUENT_SUPPORT_METRICS_REPORT_INTERVAL_HOURS_DEFAULT; static final String CONFLUENT_SUPPORT_METRICS_TOPIC_CONFIG; static final String CONFLUENT_SUPPORT_METRICS_TOPIC_DEFAULT; static final String CONFLUENT_SUPPORT_METRICS_ENDPOINT_INSECURE_ENABLE_CONFIG; static final String CONFLUENT_SUPPORT_METRICS_ENDPOINT_INSECURE_ENABLE_DOC; static final String CONFLUENT_SUPPORT_METRICS_ENDPOINT_INSECURE_ENABLE_DEFAULT; static final String CONFLUENT_SUPPORT_METRICS_ENDPOINT_SECURE_ENABLE_CONFIG; static final String CONFLUENT_SUPPORT_METRICS_ENDPOINT_SECURE_ENABLE_DOC; static final String CONFLUENT_SUPPORT_METRICS_ENDPOINT_SECURE_ENABLE_DEFAULT; static final String CONFLUENT_SUPPORT_PROXY_CONFIG; static final String CONFLUENT_SUPPORT_PROXY_DOC; static final String CONFLUENT_SUPPORT_PROXY_DEFAULT; static final String CONFLUENT_SUPPORT_METRICS_ENDPOINT_INSECURE_CONFIG; static final String CONFLUENT_SUPPORT_METRICS_ENDPOINT_SECURE_CONFIG; }
@Test public void isProactiveSupportEnabledFull() { Properties serverProperties = new Properties(); serverProperties.setProperty(BaseSupportConfig.CONFLUENT_SUPPORT_METRICS_ENABLE_CONFIG, "true"); BaseSupportConfig supportConfig = new TestSupportConfig(serverProperties); assertThat(supportConfig.isProactiveSupportEnabled()).isTrue(); }
@Test public void isProactiveSupportDisabledFull() { Properties serverProperties = new Properties(); serverProperties .setProperty(BaseSupportConfig.CONFLUENT_SUPPORT_METRICS_ENABLE_CONFIG, "false"); serverProperties .setProperty(BaseSupportConfig.CONFLUENT_SUPPORT_METRICS_TOPIC_CONFIG, "anyTopic"); serverProperties.setProperty( BaseSupportConfig.CONFLUENT_SUPPORT_METRICS_ENDPOINT_INSECURE_ENABLE_CONFIG, "true" ); serverProperties.setProperty( BaseSupportConfig.CONFLUENT_SUPPORT_METRICS_ENDPOINT_SECURE_ENABLE_CONFIG, "true" ); BaseSupportConfig supportConfig = new TestSupportConfig(serverProperties); assertThat(supportConfig.isProactiveSupportEnabled()).isFalse(); }
@Test public void isProactiveSupportEnabledTopicOnly() { Properties serverProperties = new Properties(); serverProperties .setProperty(BaseSupportConfig.CONFLUENT_SUPPORT_METRICS_TOPIC_CONFIG, "anyTopic"); BaseSupportConfig supportConfig = new TestSupportConfig(serverProperties); assertThat(supportConfig.isProactiveSupportEnabled()).isTrue(); }
@Test public void isProactiveSupportEnabledHTTPOnly() { Properties serverProperties = new Properties(); serverProperties.setProperty( BaseSupportConfig.CONFLUENT_SUPPORT_METRICS_ENDPOINT_INSECURE_ENABLE_CONFIG, "true" ); BaseSupportConfig supportConfig = new TestSupportConfig(serverProperties); assertThat(supportConfig.isProactiveSupportEnabled()).isTrue(); }
@Test public void isProactiveSupportEnabledHTTPSOnly() { Properties serverProperties = new Properties(); serverProperties.setProperty( BaseSupportConfig.CONFLUENT_SUPPORT_METRICS_ENDPOINT_SECURE_ENABLE_CONFIG, "true"); BaseSupportConfig supportConfig = new TestSupportConfig(serverProperties); assertThat(supportConfig.isProactiveSupportEnabled()).isTrue(); }
@Test public void proactiveSupportIsDisabledByDefaultWhenBrokerConfigurationIsEmpty() { Properties serverProperties = new Properties(); BaseSupportConfig supportConfig = new TestSupportConfig(serverProperties); assertThat(supportConfig.isProactiveSupportEnabled()).isTrue(); }