Duansg commented on code in PR #4101:
URL: https://github.com/apache/hertzbeat/pull/4101#discussion_r3065707283


##########
hertzbeat-manager/src/test/java/org/apache/hertzbeat/manager/service/MonitorServiceTest.java:
##########
@@ -624,14 +624,118 @@ void modifyMonitor() {
         } catch (IllegalArgumentException e) {
             assertEquals("Can not modify monitor's app type", e.getMessage());
         }
-        reset();
+        reset(monitorDao);
         Monitor existOkMonitor = 
Monitor.builder().jobId(1L).intervals(1).app("app").name("memory").instance("host")
                 .id(monitorId).build();
         
when(monitorDao.findById(monitorId)).thenReturn(Optional.of(existOkMonitor));
         
when(monitorDao.save(any(Monitor.class))).thenThrow(RuntimeException.class);
 
         assertThrows(MonitorDatabaseException.class,
                 () -> monitorService.modifyMonitor(dto.getMonitor(), 
dto.getParams(), null, null));
+
+        // 测试逻辑:当 scrape 不等于 static(且不为空),并且 instance 为空时,instance 应被设置为 
"unknown"

Review Comment:
   Please revise this into English.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to