@ -117,6 +117,7 @@ public class TaskInstanceServiceTest {
"" ,
"" ,
"" ,
"" ,
"" ,
"" ,
null ,
"test_user" ,
"test_user" ,
"2019-02-26 19:48:00" ,
"2019-02-26 19:48:00" ,
"2019-02-26 19:48:22" ,
"2019-02-26 19:48:22" ,
@ -137,6 +138,7 @@ public class TaskInstanceServiceTest {
"" ,
"" ,
"" ,
"" ,
"" ,
"" ,
null ,
"test_user" ,
"test_user" ,
"20200101 00:00:00" ,
"20200101 00:00:00" ,
"2020-01-02 00:00:00" ,
"2020-01-02 00:00:00" ,
@ -174,6 +176,7 @@ public class TaskInstanceServiceTest {
Mockito . any ( ) ,
Mockito . any ( ) ,
Mockito . any ( ) ,
Mockito . any ( ) ,
Mockito . any ( ) ,
Mockito . any ( ) ,
Mockito . any ( ) ,
Mockito . any ( ) ) )
Mockito . any ( ) ) )
. thenReturn ( pageReturn ) ;
. thenReturn ( pageReturn ) ;
when ( usersService . queryUser ( processInstance . getExecutorId ( ) ) ) . thenReturn ( loginUser ) ;
when ( usersService . queryUser ( processInstance . getExecutorId ( ) ) ) . thenReturn ( loginUser ) ;
@ -181,18 +184,19 @@ public class TaskInstanceServiceTest {
. thenReturn ( Optional . of ( processInstance ) ) ;
. thenReturn ( Optional . of ( processInstance ) ) ;
Result successRes = taskInstanceService . queryTaskListPaging ( loginUser , projectCode , 1 , "" , "" , "" ,
Result successRes = taskInstanceService . queryTaskListPaging ( loginUser , projectCode , 1 , "" , "" , "" ,
"test_user" , "2020-01-01 00:00:00" , "2020-01-02 00:00:00" , "" , TaskExecutionStatus . SUCCESS ,
null , "test_user" , "2020-01-01 00:00:00" , "2020-01-02 00:00:00" , "" , TaskExecutionStatus . SUCCESS ,
"192.168.xx.xx" , TaskExecuteType . BATCH , 1 , 20 ) ;
"192.168.xx.xx" , TaskExecuteType . BATCH , 1 , 20 ) ;
Assertions . assertEquals ( Status . SUCCESS . getCode ( ) , ( int ) successRes . getCode ( ) ) ;
Assertions . assertEquals ( Status . SUCCESS . getCode ( ) , ( int ) successRes . getCode ( ) ) ;
// executor name empty
// executor name empty
when ( taskInstanceMapper . queryTaskInstanceListPaging (
when ( taskInstanceMapper . queryTaskInstanceListPaging (
Mockito . any ( Page . class ) , eq ( project . getCode ( ) ) , eq ( 1 ) ,
Mockito . any ( Page . class ) , eq ( project . getCode ( ) ) , eq ( 1 ) ,
eq ( "" ) , eq ( "" ) , eq ( "" ) ,
eq ( "" ) , eq ( "" ) , eq ( "" ) , eq ( null ) ,
eq ( "" ) , Mockito . any ( ) , eq ( "192.168.xx.xx" ) , eq ( TaskExecuteType . BATCH ) , eq ( start ) , eq ( end ) ) )
eq ( "" ) , Mockito . any ( ) , eq ( "192.168.xx.xx" ) , eq ( TaskExecuteType . BATCH ) , eq ( start ) , eq ( end ) ) )
. thenReturn ( pageReturn ) ;
. thenReturn ( pageReturn ) ;
Result executorEmptyRes = taskInstanceService . queryTaskListPaging ( loginUser , projectCode , 1 , "" , "" , "" ,
Result executorEmptyRes = taskInstanceService . queryTaskListPaging ( loginUser , projectCode , 1 , "" , "" , "" ,
"" , "2020-01-01 00:00:00" , "2020-01-02 00:00:00" , "" , TaskExecutionStatus . SUCCESS , "192.168.xx.xx" ,
null , "" , "2020-01-01 00:00:00" , "2020-01-02 00:00:00" , "" , TaskExecutionStatus . SUCCESS ,
"192.168.xx.xx" ,
TaskExecuteType . BATCH , 1 , 20 ) ;
TaskExecuteType . BATCH , 1 , 20 ) ;
Assertions . assertEquals ( Status . SUCCESS . getCode ( ) , ( int ) executorEmptyRes . getCode ( ) ) ;
Assertions . assertEquals ( Status . SUCCESS . getCode ( ) , ( int ) executorEmptyRes . getCode ( ) ) ;
@ -201,22 +205,22 @@ public class TaskInstanceServiceTest {
when ( usersService . getUserIdByName ( loginUser . getUserName ( ) ) ) . thenReturn ( - 1 ) ;
when ( usersService . getUserIdByName ( loginUser . getUserName ( ) ) ) . thenReturn ( - 1 ) ;
Result executorNullRes = taskInstanceService . queryTaskListPaging ( loginUser , projectCode , 1 , "" , "" , "" ,
Result executorNullRes = taskInstanceService . queryTaskListPaging ( loginUser , projectCode , 1 , "" , "" , "" ,
"test_user" , "2020-01-01 00:00:00" , "2020-01-02 00:00:00" , "" , TaskExecutionStatus . SUCCESS ,
null , "test_user" , "2020-01-01 00:00:00" , "2020-01-02 00:00:00" , "" , TaskExecutionStatus . SUCCESS ,
"192.168.xx.xx" , TaskExecuteType . BATCH , 1 , 20 ) ;
"192.168.xx.xx" , TaskExecuteType . BATCH , 1 , 20 ) ;
Assertions . assertEquals ( Status . SUCCESS . getCode ( ) , ( int ) executorNullRes . getCode ( ) ) ;
Assertions . assertEquals ( Status . SUCCESS . getCode ( ) , ( int ) executorNullRes . getCode ( ) ) ;
// start/end date null
// start/end date null
when ( taskInstanceMapper . queryTaskInstanceListPaging ( Mockito . any ( Page . class ) , eq ( project . getCode ( ) ) , eq ( 1 ) ,
when ( taskInstanceMapper . queryTaskInstanceListPaging ( Mockito . any ( Page . class ) , eq ( project . getCode ( ) ) , eq ( 1 ) ,
eq ( "" ) , eq ( "" ) , eq ( "" ) ,
eq ( "" ) , eq ( "" ) , eq ( "" ) , eq ( null ) ,
eq ( "" ) , Mockito . any ( ) , eq ( "192.168.xx.xx" ) , eq ( TaskExecuteType . BATCH ) , any ( ) , any ( ) ) )
eq ( "" ) , Mockito . any ( ) , eq ( "192.168.xx.xx" ) , eq ( TaskExecuteType . BATCH ) , any ( ) , any ( ) ) )
. thenReturn ( pageReturn ) ;
. thenReturn ( pageReturn ) ;
Result executorNullDateRes = taskInstanceService . queryTaskListPaging ( loginUser , projectCode , 1 , "" , "" , "" ,
Result executorNullDateRes = taskInstanceService . queryTaskListPaging ( loginUser , projectCode , 1 , "" , "" , "" ,
"" , null , null , "" , TaskExecutionStatus . SUCCESS , "192.168.xx.xx" , TaskExecuteType . BATCH , 1 , 20 ) ;
null , "" , null , null , "" , TaskExecutionStatus . SUCCESS , "192.168.xx.xx" , TaskExecuteType . BATCH , 1 , 20 ) ;
Assertions . assertEquals ( Status . SUCCESS . getCode ( ) , ( int ) executorNullDateRes . getCode ( ) ) ;
Assertions . assertEquals ( Status . SUCCESS . getCode ( ) , ( int ) executorNullDateRes . getCode ( ) ) ;
// start date error format
// start date error format
when ( taskInstanceMapper . queryTaskInstanceListPaging ( Mockito . any ( Page . class ) , eq ( project . getCode ( ) ) , eq ( 1 ) ,
when ( taskInstanceMapper . queryTaskInstanceListPaging ( Mockito . any ( Page . class ) , eq ( project . getCode ( ) ) , eq ( 1 ) ,
eq ( "" ) , eq ( "" ) , eq ( "" ) ,
eq ( "" ) , eq ( "" ) , eq ( "" ) , eq ( null ) ,
eq ( "" ) , Mockito . any ( ) , eq ( "192.168.xx.xx" ) , eq ( TaskExecuteType . BATCH ) , any ( ) , any ( ) ) )
eq ( "" ) , Mockito . any ( ) , eq ( "192.168.xx.xx" ) , eq ( TaskExecuteType . BATCH ) , any ( ) , any ( ) ) )
. thenReturn ( pageReturn ) ;
. thenReturn ( pageReturn ) ;
@ -227,6 +231,7 @@ public class TaskInstanceServiceTest {
"" ,
"" ,
"" ,
"" ,
"" ,
"" ,
null ,
"" ,
"" ,
"error date" ,
"error date" ,
null ,
null ,
@ -244,6 +249,7 @@ public class TaskInstanceServiceTest {
"" ,
"" ,
"" ,
"" ,
"" ,
"" ,
null ,
"" ,
"" ,
null ,
null ,
"error date" ,
"error date" ,