Skip to content
Snippets Groups Projects
Commit aa883ede authored by Chris Lemaire's avatar Chris Lemaire
Browse files

Merge branch '131-stuent-groups-non-null-module' into 'development'

Resolve "Student Groups non-null Module"

Closes #131

See merge request !140
parents 67bd0e48 1aed875f
Branches
No related tags found
2 merge requests!141Development,!140Resolve "Student Groups non-null Module"
Pipeline #426107 passed
......@@ -38,10 +38,10 @@ import nl.tudelft.labracore.dto.view.structured.summary.SubmissionSummaryDTO;
public class StudentGroupDetailsDTO extends StudentGroupSummaryDTO {
@NotNull
private ModuleSummaryDTO module;
private ModuleDivisionSummaryDTO division;
@NotNull
private List<RolePersonLayer1DTO> members;
@NotNull
private List<SubmissionSummaryDTO> submissions;
@NotNull
private ModuleDivisionSummaryDTO division;
}
......@@ -44,7 +44,6 @@ public class StudentGroupSummaryDTO extends View<StudentGroup> {
@NotNull
private Integer capacity;
@NotNull
private ModuleDivisionSummaryDTO division;
@NotNull
......
......@@ -55,6 +55,7 @@ public class StudentGroup {
/**
* The module this group is part of.
*/
@NotNull
@ManyToOne
private Module module;
......
......@@ -54,8 +54,6 @@ import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;
import com.fasterxml.jackson.core.JsonProcessingException;
@Transactional
@AutoConfigureMockMvc
@SpringBootTest(classes = TestLabracoreApplication.class)
......@@ -187,7 +185,7 @@ public class EditionCollectionControllerTest extends RestControllerTest {
.andExpect(status().isForbidden());
}
private static List<MockHttpServletRequestBuilder> protectedEndpoints() throws JsonProcessingException {
private static List<MockHttpServletRequestBuilder> protectedEndpoints() {
return List.of(
postJson("/api/edition-collection", new EditionCollectionCreateDTO()),
patchJson("/api/edition-collection/1", new EditionCollectionPatchDTO()),
......
......@@ -31,6 +31,7 @@ import javax.transaction.Transactional;
import nl.tudelft.labracore.TestLabracoreApplication;
import nl.tudelft.labracore.dto.create.StudentGroupCreateDTO;
import nl.tudelft.labracore.dto.helper.GroupGenerateDTO;
import nl.tudelft.labracore.dto.id.ModuleIdDTO;
import nl.tudelft.labracore.dto.patch.StudentGroupPatchDTO;
import nl.tudelft.labracore.dto.view.structured.details.StudentGroupDetailsDTO;
import nl.tudelft.labracore.dto.view.structured.summary.StudentGroupSummaryDTO;
......@@ -55,8 +56,6 @@ import org.springframework.security.test.context.support.WithUserDetails;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;
import com.fasterxml.jackson.core.JsonProcessingException;
@Transactional
@AutoConfigureMockMvc
@SpringBootTest(classes = TestLabracoreApplication.class)
......@@ -105,6 +104,7 @@ class StudentGroupControllerIntegrationTest extends RestControllerTest {
StudentGroupCreateDTO.builder()
.name("jazz")
.capacity(4)
.module(new ModuleIdDTO(dbLoader.getAirportFight().getId()))
.build()))
.andExpect(status().isOk())
.andExpect(jsonContent(Long.class)
......@@ -191,7 +191,7 @@ class StudentGroupControllerIntegrationTest extends RestControllerTest {
.andExpect(status().isForbidden());
}
private static Stream<MockHttpServletRequestBuilder> protectedEndpoints() throws JsonProcessingException {
private static Stream<MockHttpServletRequestBuilder> protectedEndpoints() {
return Stream.of(
postJson("/api/studentGroup", new StudentGroupCreateDTO()),
patchJson("/api/studentGroup/1", new StudentGroupPatchDTO()),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment