Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 11 additions & 27 deletions backend/task-manager/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,43 +80,22 @@
<artifactId>bcpkix-jdk18on</artifactId>
<version>1.76</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.10.0</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.8</version>
</plugin>
</plugins>
</pluginManagement>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
Expand Down Expand Up @@ -146,6 +125,11 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.2</version>
</plugin>
</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ public class TaskDTO {
private LocalDate dateCreated;
private LocalDate dueDate;
private int teamId;
private String teamName;
private TaskPriority priority;
private List<TeamMemberDTO> assignedMembers;

public TaskDTO() {}

public TaskDTO(int taskId, String title, String description, boolean isLocked, String status, LocalDate dateCreated, LocalDate dueDate, int teamId, List<TeamMemberDTO> assignedMembers, TaskPriority priority) {
public TaskDTO(int taskId, String title, String description, boolean isLocked, String status, LocalDate dateCreated, LocalDate dueDate, int teamId, List<TeamMemberDTO> assignedMembers, TaskPriority priority, String teamName) {
this.taskId = taskId;
this.title = title;
this.description = description;
Expand All @@ -29,6 +30,7 @@ public TaskDTO(int taskId, String title, String description, boolean isLocked, S
this.teamId = teamId;
this.assignedMembers = assignedMembers;
this.priority = priority;
this.teamName = teamName;
}

//getters and setters
Expand Down Expand Up @@ -111,4 +113,12 @@ public TaskPriority getPriority() {
public void setPriority(TaskPriority priority) {
this.priority = priority;
}

public String getTeamName() {
return teamName;
}

public void setTeamName(String teamName) {
this.teamName = teamName;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,8 @@ private TaskDTO convertToDTO(Task task) {
task.getDueDate(),
task.getTeam().getTeamId(),
assignedMembers,
task.getPriority() != null ? task.getPriority() : TaskPriority.LOW
task.getPriority() != null ? task.getPriority() : TaskPriority.LOW,
task.getTeam().getTeamName()
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ public TaskDTO convertToDTO(Task task) {
task.getDueDate(),
task.getTeam().getTeamId(),
members,
task.getPriority()
task.getPriority(),
task.getTeam().getTeamName()
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class TaskDTOTest {
@Test
void testDTOConstructorAndGetters() {
LocalDate dueDate = LocalDate.of(2024, 5, 10);
TaskDTO dto = new TaskDTO(1, "Task Title", "Task Description", false, "Open", LocalDate.now(), dueDate, 201, null, TaskPriority.LOW);
TaskDTO dto = new TaskDTO(1, "Task Title", "Task Description", false, "Open", LocalDate.now(), dueDate, 201, null, TaskPriority.LOW, null);
assertEquals(1, dto.getTaskId());
assertEquals("Task Title", dto.getTitle());
assertEquals("Task Description", dto.getDescription());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class TaskControllerTest {
void testCreateTask() throws Exception {
int uniqueId = (int) System.nanoTime();
int teamId = uniqueId + 1;
TaskDTO mockTask = new TaskDTO(uniqueId, "Task Title " + uniqueId, "Description", false, "Open", LocalDate.now(), null, teamId, null, TaskPriority.LOW);
TaskDTO mockTask = new TaskDTO(uniqueId, "Task Title " + uniqueId, "Description", false, "Open", LocalDate.now(), null, teamId, null, TaskPriority.LOW, null);

TaskRequestDTO requestDTO = new TaskRequestDTO(
"Task Title " + uniqueId,
Expand Down Expand Up @@ -104,7 +104,8 @@ void testEditTask() throws Exception {
null,
teamId,
null,
TaskPriority.HIGH
TaskPriority.HIGH,
null
);

when(teamMemberService.editTask(eq(uniqueId), any(TaskDTO.class))).thenReturn(requestDTO);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ void testGetTeamTasks() throws Exception {

List<TaskDTO> mockTasks = Arrays.asList(
new TaskDTO(1, "Task 1", "Thing 1", false, "Open", LocalDate.now(), null, teamId, null,
TaskPriority.HIGH),
TaskPriority.HIGH, null),
new TaskDTO(2, "Task 2", "Thing 2", false, "Open", LocalDate.now(), null, teamId, null,
TaskPriority.HIGH));
TaskPriority.HIGH, null));

when(teamService.getTeamTasks(teamId)).thenReturn(mockTasks);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ void testGetTeamsForMember() throws Exception {
@Test
void testGetAssignedTasks() throws Exception {
List<TaskDTO> mockTasks = Arrays.asList(
new TaskDTO(1, "Task Title 1", "Task 1 description", false, "Open", LocalDate.now(), null, 1, null, TaskPriority.MEDIUM),
new TaskDTO(2, "Task Title 2", "Task 2 description", true, "Closed", LocalDate.now(), null, 1, null, TaskPriority.MEDIUM));
new TaskDTO(1, "Task Title 1", "Task 1 description", false, "Open", LocalDate.now(), null, 1, null, TaskPriority.MEDIUM, null),
new TaskDTO(2, "Task Title 2", "Task 2 description", true, "Closed", LocalDate.now(), null, 1, null, TaskPriority.MEDIUM, null));

when(teamMemberService.getAssignedTasks(1)).thenReturn(mockTasks);
mockMvc.perform(get("/api/members/actions/1/tasks"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ void testEditTask() {
null,
team.getTeamId(),
null,
TaskPriority.LOW
TaskPriority.LOW,
team.getTeamName()
);

TaskDTO updatedTask = teamMemberService.editTask(task.getTaskId(), taskDTO);
Expand Down

This file was deleted.

This file was deleted.

Loading
Loading