41 lines
992 B
Java
41 lines
992 B
Java
package mops.gruppen2.service;
|
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
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;
|
|
import static org.junit.jupiter.api.Assertions.*;
|
|
|
|
class SerializationServiceTest {
|
|
|
|
EventRepository eventRepository;
|
|
Event event;
|
|
|
|
@BeforeEach
|
|
public void setUp(){
|
|
}
|
|
|
|
|
|
@Disabled
|
|
@Test
|
|
void applyEvent() {
|
|
}
|
|
|
|
@Test
|
|
void serializeEventTest() {
|
|
event = new Event(1,1,"1");
|
|
SerializationService serializationService = new SerializationService(eventRepository);
|
|
try {
|
|
assertThat(serializationService.serializeEvent(event)).isEqualTo("{\"Event\":{\"event_id\":1,\"group_id\":1,\"user_id\":\"1\"}}");
|
|
} catch (JsonProcessingException e) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
|
|
} |