You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/09/27 07:27:01 UTC

[GitHub] [dolphinscheduler] zhongjiajie commented on a diff in pull request #12017: [WIP][test] fix flaky test in CI

zhongjiajie commented on code in PR #12017:
URL: https://github.com/apache/dolphinscheduler/pull/12017#discussion_r980858238


##########
dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-http/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker:
##########
@@ -0,0 +1 @@
+mock-maker-inline

Review Comment:
   Add this to mock finial class, according to https://github.com/mockito/mockito/wiki/What%27s-new-in-Mockito-2#mock-the-unmockable-opt-in-mocking-of-final-classesmethods



##########
dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-http/src/test/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSenderTest.java:
##########
@@ -28,14 +33,16 @@
 public class HttpSenderTest {
 
     @Test
-    public void sendTest() {
+    public void sendTest() throws IOException {
         Map<String, String> paramsMap = new HashMap<>();
-        paramsMap.put(HttpAlertConstants.NAME_URL, "http://www.baidu.com");
+        paramsMap.put(HttpAlertConstants.NAME_URL, "http://www.dolphinscheduler-not-exists-web.com");
         paramsMap.put(HttpAlertConstants.NAME_REQUEST_TYPE, "POST");
         paramsMap.put(HttpAlertConstants.NAME_HEADER_PARAMS, "{\"Content-Type\":\"application/json\"}");
-        paramsMap.put(HttpAlertConstants.NAME_BODY_PARAMS, "{\"number\":\"13457654323\"}");

Review Comment:
   remove some sensitive data in UT



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org