Skip to content

Commit

Permalink
Default proxy schema http
Browse files Browse the repository at this point in the history
  • Loading branch information
jtduffy committed Jan 30, 2025
1 parent d492642 commit 99ce0fd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public class AgentConfigImpl extends BaseConfig implements AgentConfig {
public static final int DEFAULT_PORT = 80;
public static final String DEFAULT_PROXY_HOST = null;
public static final int DEFAULT_PROXY_PORT = 8080;
public static final String DEFAULT_PROXY_SCHEME = null;
public static final String DEFAULT_PROXY_SCHEME = "http";
public static final boolean DEFAULT_PUT_FOR_DATA_SEND_ENABLED = false;
public static final String DEFAULT_SECURITY_POLICIES_TOKEN = "";
public static final boolean DEFAULT_SEND_DATA_ON_EXIT = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,21 @@ public void apiPortDefaultSSL() {
assertEquals(AgentConfigImpl.DEFAULT_SSL_PORT, config.getApiPort());
}

@Test
public void proxyScheme() {
Map<String, Object> localMap = new HashMap<>();
localMap.put(AgentConfigImpl.PROXY_SCHEME, "foo");
AgentConfig config = AgentConfigImpl.createAgentConfig(localMap);

assertEquals("foo", config.getProxyScheme());
}

@Test
public void proxySchemeDefault() {
AgentConfig config = AgentConfigImpl.createAgentConfig(new HashMap<>());
assertEquals(AgentConfigImpl.DEFAULT_PROXY_SCHEME, config.getProxyScheme());
}

@Test
public void sendEnvironmentInfo() {
Map<String, Object> localMap = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public void before() {
when(agentConfig.getMetricIngestUri()).thenReturn(DEFAULT_METRIC_INGEST_URI);
when(agentConfig.getEventIngestUri()).thenReturn(DEFAULT_EVENT_INGEST_URI);
when(agentConfig.getLicenseKey()).thenReturn("test_1234_license_key");
when(agentConfig.getProxyScheme()).thenReturn("http");
when(agentConfig.getValue(eq(ThreadService.NAME_PATTERN_CFG_KEY), any(String.class)))
.thenReturn(ThreadNameNormalizer.DEFAULT_PATTERN);
}
Expand All @@ -75,6 +76,7 @@ public void daemonConfigBuiltCorrect() {
assertEquals(DEFAULT_EVENT_INGEST_URI, daemonConfig.getEventsUri().toString());
assertEquals(22, daemonConfig.getHarvestInterval().getSeconds());
assertEquals(300_000, (int)daemonConfig.getQueueSize());
assertEquals("http", daemonConfig.getProxyScheme());
}

@Test
Expand Down

0 comments on commit 99ce0fd

Please sign in to comment.