fixed tests.
This commit is contained in:
parent
9fb3f26341
commit
cd5779a498
@ -17,7 +17,6 @@ import org.springframework.test.web.servlet.MockMvc;
|
||||
|
||||
import javax.transaction.Transactional;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -336,6 +335,7 @@ class DemoApplicationTests {
|
||||
);
|
||||
for (int i = 0; i < 20; i++) {
|
||||
Person person = new Person(null, "Imie"+i, "Nazwisko"+i, new Student(null, null, "54654654"+i));
|
||||
person.getStudent().setPerson(person);
|
||||
person = personRepository.save(person);
|
||||
GroupMember groupMember = new GroupMember(null, person.getStudent(), null);
|
||||
person.getStudent().addGroupMember(groupMember);
|
||||
@ -345,6 +345,7 @@ class DemoApplicationTests {
|
||||
studentsGroup = studentsGroupRepository.save(studentsGroup);
|
||||
|
||||
Person person21 = new Person(null, "Imie21", "Nazwisko21",new Student(null, null, "54654654"));
|
||||
person21.getStudent().setPerson(person21);
|
||||
person21 = personRepository.save(person21);
|
||||
GroupMember groupMember21 = new GroupMember(null, person21.getStudent(), null);
|
||||
groupMember21.setGroup(studentsGroup);
|
||||
@ -369,6 +370,7 @@ class DemoApplicationTests {
|
||||
);
|
||||
for (int i = 0; i < 21; i++) {
|
||||
Person person = new Person(null, "Imie"+i, "Nazwisko"+i, new Student(null, null, "54654654"+i));
|
||||
person.getStudent().setPerson(person);
|
||||
person = personRepository.save(person);
|
||||
GroupMember groupMember = new GroupMember(null, person.getStudent(), null);
|
||||
person.getStudent().addGroupMember(groupMember);
|
||||
@ -400,7 +402,7 @@ class DemoApplicationTests {
|
||||
GroupDto groupDto = new GroupDto(
|
||||
null,
|
||||
List.of(new GroupLeaderDto(null, person.getId(), null)),
|
||||
List.of(new GroupMemberDto(null, person2.getStudent().getId(), null), new GroupMemberDto(null, person3.getStudent().getId(), null))
|
||||
List.of(new GroupMemberDto(null, person2.getStudent().getId(), null, person2.getStudent().getId()), new GroupMemberDto(null, person3.getStudent().getId(), null, person3.getStudent().getPerson().getId()))
|
||||
);
|
||||
|
||||
String requestJson = mapper.writeValueAsString(groupDto);
|
||||
@ -479,7 +481,7 @@ class DemoApplicationTests {
|
||||
Person person4 = new Person(null, "Katarzyna", "Adamska", new Student(null, null, "645123"));
|
||||
person4.getStudent().setPerson(person4);
|
||||
person4 = personRepository.save(person4);
|
||||
GroupMemberDto groupMemberDto = new GroupMemberDto(null, person4.getStudent().getId(), studentsGroup.getId());
|
||||
GroupMemberDto groupMemberDto = new GroupMemberDto(null, person4.getStudent().getId(), studentsGroup.getId(), person4.getStudent().getPerson().getId());
|
||||
|
||||
String requestJson = mapper.writeValueAsString(groupMemberDto);
|
||||
|
||||
@ -509,7 +511,7 @@ class DemoApplicationTests {
|
||||
Person person21 = new Person(null, "Imię21", "Nazwisko21", new Student(null, null, "645123"));
|
||||
person21.getStudent().setPerson(person21);
|
||||
person21 = personRepository.save(person21);
|
||||
GroupMemberDto groupMemberDto = new GroupMemberDto(null, person21.getStudent().getId(), studentsGroup.getId());
|
||||
GroupMemberDto groupMemberDto = new GroupMemberDto(null, person21.getStudent().getId(), studentsGroup.getId(), person21.getStudent().getPerson().getId());
|
||||
|
||||
String requestJson = mapper.writeValueAsString(groupMemberDto);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user