|
|
@@ -0,0 +1,32 @@
|
|
|
+package cn.reghao.tnb.content.app.vod.service;
|
|
|
+
|
|
|
+import cn.reghao.tnb.content.app.ContentApplication;
|
|
|
+import com.netflix.discovery.EurekaClient;
|
|
|
+import com.netflix.discovery.shared.Applications;
|
|
|
+import org.junit.jupiter.api.Test;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.boot.test.context.SpringBootTest;
|
|
|
+import org.springframework.cloud.client.discovery.DiscoveryClient;
|
|
|
+import org.springframework.test.context.ActiveProfiles;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author reghao
|
|
|
+ * @date 2025-07-18 17:31:05
|
|
|
+ */
|
|
|
+@ActiveProfiles("dev")
|
|
|
+@SpringBootTest(classes = ContentApplication.class)
|
|
|
+public class DiscoveryTest {
|
|
|
+ @Autowired
|
|
|
+ DiscoveryClient discoveryClient;
|
|
|
+ @Autowired
|
|
|
+ EurekaClient eurekaClient;
|
|
|
+ @Test
|
|
|
+ public void discoveryClientTest() {
|
|
|
+ List<String> list = discoveryClient.getServices();
|
|
|
+ eurekaClient.getApplicationInfoManager();
|
|
|
+ Applications applications = eurekaClient.getApplications();
|
|
|
+ System.out.println();
|
|
|
+ }
|
|
|
+}
|