fix tests
This commit is contained in:
@ -5,7 +5,6 @@ import mops.gruppen2.domain.Account;
|
||||
import mops.gruppen2.domain.Group;
|
||||
import mops.gruppen2.domain.GroupType;
|
||||
import mops.gruppen2.domain.Role;
|
||||
import mops.gruppen2.domain.Visibility;
|
||||
import mops.gruppen2.domain.event.AddUserEvent;
|
||||
import mops.gruppen2.domain.event.CreateGroupEvent;
|
||||
import mops.gruppen2.domain.event.DeleteGroupEvent;
|
||||
@ -152,7 +151,7 @@ public class TestBuilder {
|
||||
}
|
||||
|
||||
public static Event createPrivateGroupEvent(UUID groupId) {
|
||||
return createGroupEvent(groupId, Visibility.PRIVATE);
|
||||
return createGroupEvent(groupId, GroupType.PRIVATE);
|
||||
}
|
||||
|
||||
public static Event createPrivateGroupEvent() {
|
||||
@ -160,20 +159,19 @@ public class TestBuilder {
|
||||
}
|
||||
|
||||
public static Event createPublicGroupEvent(UUID groupId) {
|
||||
return createGroupEvent(groupId, Visibility.PUBLIC);
|
||||
return createGroupEvent(groupId, GroupType.PUBLIC);
|
||||
}
|
||||
|
||||
public static Event createPublicGroupEvent() {
|
||||
return createPublicGroupEvent(UUID.randomUUID());
|
||||
}
|
||||
|
||||
public static Event createGroupEvent(UUID groupId, Visibility visibility) {
|
||||
public static Event createGroupEvent(UUID groupId, GroupType type) {
|
||||
return new CreateGroupEvent(
|
||||
groupId,
|
||||
faker.random().hex(),
|
||||
null,
|
||||
GroupType.SIMPLE,
|
||||
visibility
|
||||
type
|
||||
);
|
||||
}
|
||||
|
||||
@ -186,8 +184,7 @@ public class TestBuilder {
|
||||
groupId,
|
||||
faker.random().hex(),
|
||||
null,
|
||||
GroupType.LECTURE,
|
||||
Visibility.PUBLIC
|
||||
GroupType.LECTURE
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -3,7 +3,6 @@ package mops.gruppen2.domain.event;
|
||||
import mops.gruppen2.TestBuilder;
|
||||
import mops.gruppen2.domain.Group;
|
||||
import mops.gruppen2.domain.GroupType;
|
||||
import mops.gruppen2.domain.Visibility;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static mops.gruppen2.TestBuilder.uuidMock;
|
||||
@ -16,15 +15,13 @@ class DeleteGroupEventTest {
|
||||
Event createEvent = new CreateGroupEvent(uuidMock(0),
|
||||
"A",
|
||||
uuidMock(1),
|
||||
GroupType.SIMPLE,
|
||||
Visibility.PUBLIC);
|
||||
GroupType.PUBLIC);
|
||||
Event deleteEvent = new DeleteGroupEvent(uuidMock(0), "A");
|
||||
|
||||
Group group = TestBuilder.apply(createEvent, deleteEvent);
|
||||
|
||||
assertThat(group.getMembers()).isEmpty();
|
||||
assertThat(group.getType()).isEqualTo(null);
|
||||
assertThat(group.getVisibility()).isEqualTo(null);
|
||||
assertThat(group.getUserLimit()).isEqualTo(0);
|
||||
assertThat(group.getId()).isEqualTo(uuidMock(0));
|
||||
assertThat(group.getParent()).isEqualTo(null);
|
||||
|
||||
@ -3,8 +3,8 @@ package mops.gruppen2.service;
|
||||
import mops.gruppen2.Gruppen2Application;
|
||||
import mops.gruppen2.TestBuilder;
|
||||
import mops.gruppen2.domain.Group;
|
||||
import mops.gruppen2.domain.GroupType;
|
||||
import mops.gruppen2.domain.User;
|
||||
import mops.gruppen2.domain.Visibility;
|
||||
import mops.gruppen2.domain.event.Event;
|
||||
import mops.gruppen2.repository.EventRepository;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
@ -85,7 +85,7 @@ class GroupServiceTest {
|
||||
|
||||
assertThat(groups).hasSize(1);
|
||||
assertThat(groups.get(0).getMembers()).hasSize(5);
|
||||
assertThat(groups.get(0).getVisibility()).isEqualTo(Visibility.PRIVATE);
|
||||
assertThat(groups.get(0).getType()).isEqualTo(GroupType.PRIVATE);
|
||||
}
|
||||
|
||||
//TODO: ProjectionServiceTest
|
||||
|
||||
Reference in New Issue
Block a user