|
@@ -66,7 +66,7 @@ public class TransportConfigTest { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
public void getHeartbeatApiPath() { |
|
|
|
|
|
|
|
|
public void testGetHeartbeatApiPath() { |
|
|
// use default heartbeat api path |
|
|
// use default heartbeat api path |
|
|
assertTrue(StringUtil.isNotEmpty(TransportConfig.getHeartbeatApiPath())); |
|
|
assertTrue(StringUtil.isNotEmpty(TransportConfig.getHeartbeatApiPath())); |
|
|
assertEquals(TransportConfig.HEARTBEAT_DEFAULT_PATH, TransportConfig.getHeartbeatApiPath()); |
|
|
assertEquals(TransportConfig.HEARTBEAT_DEFAULT_PATH, TransportConfig.getHeartbeatApiPath()); |
|
@@ -74,7 +74,12 @@ public class TransportConfigTest { |
|
|
// config heartbeat api path |
|
|
// config heartbeat api path |
|
|
SentinelConfig.setConfig(TransportConfig.HEARTBEAT_API_PATH, "/demo"); |
|
|
SentinelConfig.setConfig(TransportConfig.HEARTBEAT_API_PATH, "/demo"); |
|
|
assertTrue(StringUtil.isNotEmpty(TransportConfig.getHeartbeatApiPath())); |
|
|
assertTrue(StringUtil.isNotEmpty(TransportConfig.getHeartbeatApiPath())); |
|
|
assertEquals("/demo" + TransportConfig.HEARTBEAT_DEFAULT_PATH, TransportConfig.getHeartbeatApiPath()); |
|
|
|
|
|
|
|
|
assertEquals("/demo", TransportConfig.getHeartbeatApiPath()); |
|
|
|
|
|
|
|
|
|
|
|
SentinelConfig.setConfig(TransportConfig.HEARTBEAT_API_PATH, "demo/registry"); |
|
|
|
|
|
assertEquals("/demo/registry", TransportConfig.getHeartbeatApiPath()); |
|
|
|
|
|
|
|
|
|
|
|
SentinelConfig.removeConfig(TransportConfig.HEARTBEAT_API_PATH); |
|
|
|
|
|
assertEquals(TransportConfig.HEARTBEAT_DEFAULT_PATH, TransportConfig.getHeartbeatApiPath()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |