fixed event JSON serialization tests; mocks needed to mock image/video URLs as well

This commit is contained in:
Axel Uhl committed 2014-05-31 10:51:36 +02:00
1 parent 71d97063ec
commit 8d5ac1aef7
2 files changed
+8

No files matched your search

@@ -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)));
@@ -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()));