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/08 07:57:47 UTC

[GitHub] [dolphinscheduler] EricGao888 commented on a diff in pull request #11588: [Improvement][Test] Give an example on replacing Powermock with Mockito

EricGao888 commented on code in PR #11588:
URL: https://github.com/apache/dolphinscheduler/pull/11588#discussion_r965629127


##########
dolphinscheduler-task-plugin/dolphinscheduler-task-jupyter/src/main/java/org/apache/dolphinscheduler/plugin/task/jupyter/JupyterPropertyReader.java:
##########
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.dolphinscheduler.plugin.task.jupyter;
+
+import org.apache.dolphinscheduler.spi.utils.PropertyUtils;
+
+// this is a wrapper class to decouple untestable static method
+
+public class JupyterPropertyReader {
+
+    protected String readProperty(final String key) {

Review Comment:
   We discussed this in another issue during yesterday's community conference. `Mockito.mockStatic` does not work for `PropertyUtils`. We think the best way is to fix `PropertyUtils` instead of adding a wrapper here. cc @ruanwenjun 



-- 
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