Parcourir la source

add unit test of queryWorkAddressLest (#8054)

Co-authored-by: brian <flyunrain@163.com>
XiaochenNan il y a 3 ans
Parent
commit
3456904af8

+ 12 - 0
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/WorkerGroupControllerTest.java

@@ -114,6 +114,18 @@ public class WorkerGroupControllerTest extends AbstractControllerTest {
         logger.info(mvcResult.getResponse().getContentAsString());
     }
 
+    @Test
+    public void queryWorkerAddressList() throws Exception {
+        MvcResult mvcResult = mockMvc.perform(get("/worker-groups/worker-address-list")
+                        .header("sessionId", sessionId))
+                .andExpect(status().isOk())
+                .andExpect(content().contentType(MediaType.APPLICATION_JSON))
+                .andReturn();
+        Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
+        Assert.assertTrue(result != null && result.isSuccess());
+        logger.info(mvcResult.getResponse().getContentAsString());
+    }
+
     @Test
     public void testDeleteById() throws Exception {
         WorkerGroup workerGroup = new WorkerGroup();