|
@@ -260,14 +260,14 @@ public class DataAnalysisServiceTest {
|
|
|
commandCounts.add(commandCount);
|
|
|
|
|
|
Mockito.when(commandMapper.countCommandState(0, null, null, new Long[]{1L})).thenReturn(commandCounts);
|
|
|
- Mockito.when(errorCommandMapper.countCommandState(null, null, new Long[]{1L})).thenReturn(commandCounts);
|
|
|
+ Mockito.when(errorCommandMapper.countCommandState(0, null, null, new Long[]{1L})).thenReturn(commandCounts);
|
|
|
|
|
|
Map<String, Object> result = dataAnalysisServiceImpl.countCommandState(user);
|
|
|
Assert.assertEquals(Status.SUCCESS, result.get(Constants.STATUS));
|
|
|
|
|
|
// when no command found then return all count are 0
|
|
|
Mockito.when(commandMapper.countCommandState(anyInt(), any(), any(), any())).thenReturn(Collections.emptyList());
|
|
|
- Mockito.when(errorCommandMapper.countCommandState(any(), any(), any())).thenReturn(Collections.emptyList());
|
|
|
+ Mockito.when(errorCommandMapper.countCommandState(anyInt(), any(), any(), any())).thenReturn(Collections.emptyList());
|
|
|
Map<String, Object> result5 = dataAnalysisServiceImpl.countCommandState(user);
|
|
|
assertThat(result5).containsEntry(Constants.STATUS, Status.SUCCESS);
|
|
|
assertThat(result5.get(Constants.DATA_LIST)).asList().extracting("errorCount").allMatch(count -> count.equals(0));
|
|
@@ -281,7 +281,7 @@ public class DataAnalysisServiceTest {
|
|
|
errorCommandCount.setCommandType(CommandType.START_PROCESS);
|
|
|
errorCommandCount.setCount(5);
|
|
|
Mockito.when(commandMapper.countCommandState(anyInt(), any(), any(), any())).thenReturn(Collections.singletonList(normalCommandCount));
|
|
|
- Mockito.when(errorCommandMapper.countCommandState(any(), any(), any())).thenReturn(Collections.singletonList(errorCommandCount));
|
|
|
+ Mockito.when(errorCommandMapper.countCommandState(anyInt(), any(), any(), any())).thenReturn(Collections.singletonList(errorCommandCount));
|
|
|
|
|
|
Map<String, Object> result6 = dataAnalysisServiceImpl.countCommandState(user);
|
|
|
|