1

restore things lost in merge ffs

This commit is contained in:
Christoph
2020-03-10 13:34:19 +01:00
parent c7d5e02f0b
commit 73e7737b8c
4 changed files with 33 additions and 25 deletions

View File

@ -1,12 +1,10 @@
package mops.gruppen2.service;
import com.fasterxml.jackson.core.JsonProcessingException;
import mops.gruppen2.builder.EventBuilder;
import mops.gruppen2.domain.event.AddUserEvent;
import mops.gruppen2.domain.event.Event;
import mops.gruppen2.repository.EventRepository;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
@ -22,9 +20,9 @@ class SerializationServiceTest {
@Test
void serializeEventTest() {
event = new Event(1L,1L,"1");
Event event = new Event(1L,1L,"1");
SerializationService serializationService = new SerializationService(eventRepository);
SerializationService serializationService = new SerializationService(mock(EventRepository.class));
try {
assertThat(serializationService.serializeEvent(event)).isEqualTo("{\"type\":\"Event\",\"event_id\":1,\"group_id\":1,\"user_id\":\"1\"}");
@ -46,7 +44,7 @@ class SerializationServiceTest {
@Test
void serializeEventTestAddUserEvent(){
AddUserEvent event = new AddUserEvent(1,1,"user_id","peter","mueller","a@a");
AddUserEvent event = new AddUserEvent(1L,1L,"user_id","peter","mueller","a@a");
SerializationService serializationService = new SerializationService(mock(EventRepository.class));
try {
assertThat(serializationService.serializeEvent(event)).isEqualTo("{\"type\":\"AddUserEvent\",\"event_id\":1,\"group_id\":1,\"user_id\":\"user_id\",\"givenname\":\"peter\",\"familyname\":\"mueller\",\"email\":\"a@a\"}");