feat: Implement add employee to project route (SCRUM-2) #32

Merged
jank merged 8 commits from feature/add-employee-to-project into main 2024-10-23 08:39:26 +00:00
Showing only changes of commit fa607435cf - Show all commits

@ -12,7 +12,9 @@ import org.springframework.test.web.servlet.MockMvc;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.Arrays; import java.util.Arrays;
import java.util.Optional;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.is;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
@ -59,7 +61,7 @@ class CreateProjectActionTest {
final long id = Long.parseLong(new JSONObject(contentAsString).get("id").toString()); final long id = Long.parseLong(new JSONObject(contentAsString).get("id").toString());
final ProjectEntity project = this.projectRepository.findById(id); final Optional<ProjectEntity> project = this.projectRepository.findById(id);
assertThat(project.get().getName()).isEqualTo("name"); assertThat(project.get().getName()).isEqualTo("name");
assertThat(project.get().getLeadingEmployee()).isEqualTo(1); assertThat(project.get().getLeadingEmployee()).isEqualTo(1);
assertThat(project.get().getContractor()).isEqualTo(4); assertThat(project.get().getContractor()).isEqualTo(4);