added Creating Groups to frontend and saving them in Database. Also prepared some Methods for Snapshot db
This commit is contained in:
@ -23,25 +23,25 @@ class GroupTest {
|
||||
|
||||
@Test
|
||||
void createSingleGroup() {
|
||||
CreateGroupEvent createGroupEvent = new CreateGroupEvent(1,2, "asd", "hello", "foo");
|
||||
CreateGroupEvent createGroupEvent = new CreateGroupEvent(1,2L, "asd", "hello", "foo");
|
||||
|
||||
Group group = new Group();
|
||||
group.apply(createGroupEvent);
|
||||
|
||||
assertThat(group.getDescription()).isEqualTo("foo");
|
||||
assertThat(group.getTitle()).isEqualTo("hello");
|
||||
assertThat(group.getId()).isEqualTo(2);
|
||||
assertThat(group.getId()).isEqualTo(2L);
|
||||
}
|
||||
|
||||
// Verwendet CreateGroupEvent
|
||||
@Test
|
||||
void addSingleUser() {
|
||||
CreateGroupEvent createGroupEvent = new CreateGroupEvent(1,1,"prof1", "hi", "foo");
|
||||
CreateGroupEvent createGroupEvent = new CreateGroupEvent(1L,1L,"prof1", "hi", "foo");
|
||||
Group group = new Group();
|
||||
group.apply(createGroupEvent);
|
||||
|
||||
User user = new User("prof", "jens", "bendi", "hi@gmail.com");
|
||||
AddUserEvent addUserEvent = new AddUserEvent(1,1, user);
|
||||
AddUserEvent addUserEvent = new AddUserEvent(1L,1L, user);
|
||||
group.apply(addUserEvent);
|
||||
|
||||
assertThat(group.getMembers().get(0)).isEqualTo(user);
|
||||
|
||||
@ -0,0 +1,7 @@
|
||||
package mops.gruppen2.service;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
class EventServiceTest {
|
||||
|
||||
}
|
||||
@ -28,7 +28,7 @@ class SerializationServiceTest {
|
||||
|
||||
@Test
|
||||
void serializeEventTest() {
|
||||
event = new Event(1,1,"1");
|
||||
event = new Event(1L,1L,"1");
|
||||
SerializationService serializationService = new SerializationService(eventRepository);
|
||||
try {
|
||||
assertThat(serializationService.serializeEvent(event)).isEqualTo("{\"Event\":{\"event_id\":1,\"group_id\":1,\"user_id\":\"1\"}}");
|
||||
|
||||
Reference in New Issue
Block a user