From 68065d3f24b62175d37a90dbd26428e5c5a1b2da Mon Sep 17 00:00:00 2001 From: caishunfeng Date: Fri, 8 Mar 2024 17:21:23 +0800 Subject: [PATCH 1/2] fix UT test (#15684) --- .../dolphinscheduler/api/service/ResourcesServiceTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ResourcesServiceTest.java b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ResourcesServiceTest.java index fc1766214796..a01ce75a4c2b 100644 --- a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ResourcesServiceTest.java +++ b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ResourcesServiceTest.java @@ -18,6 +18,7 @@ package org.apache.dolphinscheduler.api.service; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.when; @@ -494,9 +495,8 @@ public void testUpdateResourceContent() throws Exception { ServiceException serviceException = Assertions.assertThrows(ServiceException.class, () -> resourcesService.updateResourceContent(getUser(), "/dolphinscheduler/123/resources/ResourcesServiceTest.jar", "123", "content")); - assertEquals( - "Internal Server Error: Resource file: /dolphinscheduler/123/resources/ResourcesServiceTest.jar is illegal", - serviceException.getMessage()); + assertTrue(serviceException.getMessage() + .contains("Resource file: /dolphinscheduler/123/resources/ResourcesServiceTest.jar is illegal")); // RESOURCE_NOT_EXIST when(storageOperate.getResDir(Mockito.anyString())).thenReturn("/dolphinscheduler/123/resources"); From e3fdb1a3ff8831275ce2e46d0ae9d481305b3c23 Mon Sep 17 00:00:00 2001 From: lch Date: Fri, 8 Mar 2024 17:52:24 +0800 Subject: [PATCH 2/2] [Fix-15639] parameterPassing is null case NPE (#15678) Co-authored-by: caishunfeng --- .../dolphinscheduler/plugin/task/api/model/DependentItem.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/model/DependentItem.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/model/DependentItem.java index 360fac42b61c..47f42c416c20 100644 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/model/DependentItem.java +++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/model/DependentItem.java @@ -35,7 +35,7 @@ public class DependentItem { private String dateValue; private DependResult dependResult; private TaskExecutionStatus status; - private Boolean parameterPassing; + private Boolean parameterPassing = false; public String getKey() { return String.format("%d-%d-%s-%s",