mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-07 21:01:03 +00:00
fixed event JSON serialization tests; mocks needed to mock image/video URLs as well
This commit is contained in:
1 parent
71d97063ec
commit
8d5ac1aef7
2 files changed
+8
No files matched your search
+4
@@ -4,6 +4,8 @@ import static org.junit.Assert.assertEquals;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
@@ -48,6 +50,8 @@ public class EventDataJsonSerializerTest {
|
||||
when(event.getStartDate()).thenReturn(expectedStartDate);
|
||||
when(event.getEndDate()).thenReturn(expectedEndDate);
|
||||
when(event.getVenue()).thenReturn(expectedVenue);
|
||||
when(event.getImageURLs()).thenReturn(Collections.<URL>emptySet());
|
||||
when(event.getVideoURLs()).thenReturn(Collections.<URL>emptySet());
|
||||
// ... and the serializer itself.
|
||||
serializer = new EventJsonSerializer(new VenueJsonSerializer(new CourseAreaJsonSerializer()));
|
||||
deserializer = new EventBaseJsonDeserializer(new VenueJsonDeserializer(new CourseAreaJsonDeserializer(DomainFactory.INSTANCE)));
|
||||
|
||||
+4
@@ -5,6 +5,8 @@ import static org.junit.Assert.assertNull;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.Collections;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.json.simple.JSONObject;
|
||||
@@ -47,6 +49,8 @@ public class EventWithNullStartAndEndDataJsonSerializerTest {
|
||||
when(event.getStartDate()).thenReturn(expectedStartDate);
|
||||
when(event.getEndDate()).thenReturn(expectedEndDate);
|
||||
when(event.getVenue()).thenReturn(expectedVenue);
|
||||
when(event.getImageURLs()).thenReturn(Collections.<URL>emptySet());
|
||||
when(event.getVideoURLs()).thenReturn(Collections.<URL>emptySet());
|
||||
|
||||
// ... and the serializer itself.
|
||||
serializer = new EventJsonSerializer(new VenueJsonSerializer(new CourseAreaJsonSerializer()));
|
||||
|
||||
Reference in new issue
Block a user