tests #43

Merged
sebastian merged 41 commits from tests into master 2023-11-11 11:20:50 +01:00
2 changed files with 24 additions and 15 deletions
Showing only changes of commit c9343ea05e - Show all commits

View File

@ -4,10 +4,8 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="3a869f59-290a-4ab2-b036-a878ce801bc4" name="Changes" comment="Resolve Merge-Conflict">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<list default="true" id="3a869f59-290a-4ab2-b036-a878ce801bc4" name="Changes" comment="Consider increased number of tasks">
<change beforePath="$PROJECT_DIR$/src/main/java/core/services/TaskService.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/core/services/TaskService.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/test/java/core/tasks/TaskServiceTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/core/tasks/TaskServiceTest.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -86,7 +84,7 @@
<recent name="$PROJECT_DIR$/src/test/java/core/taskgroups" />
</key>
</component>
<component name="RunManager" selected="JUnit.TaskRepositoryTest">
<component name="RunManager" selected="JUnit.TaskServiceTest.deleteTask">
<configuration name="TaskRepositoryTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
<module name="demo" />
<extension name="coverage">
@ -173,10 +171,10 @@
</configuration>
<recent_temporary>
<list>
<item itemvalue="JUnit.TaskServiceTest.deleteTask" />
<item itemvalue="JUnit.TaskServiceTest" />
<item itemvalue="JUnit.TaskRepositoryTest" />
<item itemvalue="JUnit.TaskgroupServiceTest" />
<item itemvalue="JUnit.TaskServiceTest" />
<item itemvalue="JUnit.TaskServiceTest.deleteTask" />
<item itemvalue="JUnit.TaskServiceTest.createTask" />
</list>
</recent_temporary>
@ -457,15 +455,29 @@
<option name="project" value="LOCAL" />
<updated>1699693472182</updated>
</task>
<option name="localTasksCounter" value="31" />
<task id="LOCAL-00031" summary="Deleting Task test">
<option name="closed" value="true" />
<created>1699694400508</created>
<option name="number" value="00031" />
<option name="presentableId" value="LOCAL-00031" />
<option name="project" value="LOCAL" />
<updated>1699694400508</updated>
</task>
<task id="LOCAL-00032" summary="Consider increased number of tasks">
<option name="closed" value="true" />
<created>1699694552466</created>
<option name="number" value="00032" />
<option name="presentableId" value="LOCAL-00032" />
<option name="project" value="LOCAL" />
<updated>1699694552466</updated>
</task>
<option name="localTasksCounter" value="33" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="Delete Schedules" />
<MESSAGE value="Deliver Schedule Path Info when fetching Schedules" />
<MESSAGE value="Removed unused TaskgroupShortInfo.java" />
<MESSAGE value="Fix Foreign Key Constraint Fail when deleting Taskgroups" />
<MESSAGE value="Stop and Finish TaskSchedules" />
@ -489,7 +501,9 @@
<MESSAGE value="Use @Sql instead of persit()" />
<MESSAGE value="Make the Test Transactional" />
<MESSAGE value="Resolve Merge-Conflict" />
<option name="LAST_COMMIT_MESSAGE" value="Resolve Merge-Conflict" />
<MESSAGE value="Deleting Task test" />
<MESSAGE value="Consider increased number of tasks" />
<option name="LAST_COMMIT_MESSAGE" value="Consider increased number of tasks" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>

View File

@ -24,8 +24,6 @@ public class TaskService {
private final TaskRepository taskRepository;
private final TaskScheduleService taskScheduleService;
private final TaskgroupRepository taskgroupRepository;
@PersistenceContext
private EntityManager entityManager;
public TaskService(@Autowired TaskRepository taskRepository,
@ -95,9 +93,6 @@ public class TaskService {
public void deleteTask(Task task) {
taskScheduleService.deleteScheduleByTask(task);
taskRepository.deleteByTaskID(task.getTaskID());
entityManager.flush();
entityManager.detach(task);
}
public void clearTasks(Taskgroup taskgroup) {