This is an automated email from the ASF dual-hosted git repository.
technoboy pushed a commit to branch refactor-architecture
in repository https://gitbox.apache.org/repos/asf/incubator-dolphinscheduler.git
The following commit(s) were added to refs/heads/refactor-architecture by this
push:
new f005379 LoggerServiceTest remove ProcessDao (#1944)
f005379 is described below
commit f00537959ead0e741b173f1696d28bdb7cd1154b
Author: qiaozhanwei <[email protected]>
AuthorDate: Wed Feb 12 17:44:35 2020 +0800
LoggerServiceTest remove ProcessDao (#1944)
* dolphinscheduler-common remove spring
* dolphinscheduler-common remove spring
* dolphinscheduler-common remove spring
* dolphinscheduler-common remove spring
* dolphinscheduler-common remove spring
* dolphinscheduler-common remove spring
* LoggerServiceTest remove ProcessDao
---
.../apache/dolphinscheduler/api/service/LoggerServiceTest.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git
a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/LoggerServiceTest.java
b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/LoggerServiceTest.java
index c6ab6f8..2057157 100644
---
a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/LoggerServiceTest.java
+++
b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/LoggerServiceTest.java
@@ -18,8 +18,8 @@ package org.apache.dolphinscheduler.api.service;
import org.apache.dolphinscheduler.api.enums.Status;
import org.apache.dolphinscheduler.api.utils.Result;
-import org.apache.dolphinscheduler.dao.ProcessDao;
import org.apache.dolphinscheduler.dao.entity.TaskInstance;
+import org.apache.dolphinscheduler.service.process.ProcessService;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -40,14 +40,14 @@ public class LoggerServiceTest {
@InjectMocks
private LoggerService loggerService;
@Mock
- private ProcessDao processDao;
+ private ProcessService processService;
@Test
public void testQueryDataSourceList(){
TaskInstance taskInstance = new TaskInstance();
-
Mockito.when(processDao.findTaskInstanceById(1)).thenReturn(taskInstance);
+
Mockito.when(processService.findTaskInstanceById(1)).thenReturn(taskInstance);
Result result = loggerService.queryLog(2,1,1);
//TASK_INSTANCE_NOT_FOUND
Assert.assertEquals(Status.TASK_INSTANCE_NOT_FOUND.getCode(),result.getCode().intValue());
@@ -59,7 +59,7 @@ public class LoggerServiceTest {
//SUCCESS
taskInstance.setHost("127.0.0.1");
taskInstance.setLogPath("/temp/log");
-
Mockito.when(processDao.findTaskInstanceById(1)).thenReturn(taskInstance);
+
Mockito.when(processService.findTaskInstanceById(1)).thenReturn(taskInstance);
result = loggerService.queryLog(1,1,1);
Assert.assertEquals(Status.SUCCESS.getCode(),result.getCode().intValue());
}
@@ -68,7 +68,7 @@ public class LoggerServiceTest {
public void testGetLogBytes(){
TaskInstance taskInstance = new TaskInstance();
-
Mockito.when(processDao.findTaskInstanceById(1)).thenReturn(taskInstance);
+
Mockito.when(processService.findTaskInstanceById(1)).thenReturn(taskInstance);
//task instance is null
try{