|
|
|
|
@ -27,6 +27,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
|
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
|
|
|
|
import static org.mockito.ArgumentMatchers.any;
|
|
|
|
|
import static org.mockito.ArgumentMatchers.anyString;
|
|
|
|
|
import static org.mockito.ArgumentMatchers.contains;
|
|
|
|
|
import static org.mockito.ArgumentMatchers.isNull;
|
|
|
|
|
import static org.mockito.ArgumentMatchers.startsWith;
|
|
|
|
|
import static org.mockito.Mockito.mock;
|
|
|
|
|
@ -38,6 +39,19 @@ import static org.mockito.Mockito.when;
|
|
|
|
|
|
|
|
|
|
class TrainingTaskServiceImplTest {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
void defaultTaskInitializationDoesNotRunTaskAllocationSchemaDdl() {
|
|
|
|
|
TrainingTaskServiceImpl service = new TrainingTaskServiceImpl();
|
|
|
|
|
service.trainingTaskMapper = mock(TrainingTaskMapper.class);
|
|
|
|
|
service.jdbcTemplate = mock(JdbcTemplate.class);
|
|
|
|
|
when(service.trainingTaskMapper.selectByTaskKey(anyString()))
|
|
|
|
|
.thenReturn(storedTask("existing-task", "new-product-survey"));
|
|
|
|
|
|
|
|
|
|
service.ensureDefaultTasks(null);
|
|
|
|
|
|
|
|
|
|
verify(service.jdbcTemplate, never()).execute(contains("task_allocation"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
void splitListSupportsCommonSeparators() {
|
|
|
|
|
TrainingTaskServiceImpl service = new TrainingTaskServiceImpl();
|
|
|
|
|
|