Search in sources :

Example 1 with TestTransformerContext

use of org.datatransferproject.transfer.microsoft.helper.TestTransformerContext in project data-transfer-project by google.

the class ToCalendarAttendeeModelTransformerTest method testTransform.

@Test
public void testTransform() {
    Map<String, Object> attendeeMap = new HashMap<>();
    attendeeMap.put("type", "required");
    Map<String, String> addressMap = new HashMap<>();
    addressMap.put("name", "Test Test1");
    addressMap.put("address", "foo@foo.com");
    attendeeMap.put("emailAddress", addressMap);
    CalendarAttendeeModel attendee = transformer.apply(attendeeMap, new TestTransformerContext());
    Assert.assertFalse(attendee.getOptional());
    Assert.assertEquals("Test Test1", attendee.getDisplayName());
    Assert.assertEquals("foo@foo.com", attendee.getEmail());
}
Also used : HashMap(java.util.HashMap) CalendarAttendeeModel(org.datatransferproject.types.common.models.calendar.CalendarAttendeeModel) TestTransformerContext(org.datatransferproject.transfer.microsoft.helper.TestTransformerContext) Test(org.junit.Test)

Example 2 with TestTransformerContext

use of org.datatransferproject.transfer.microsoft.helper.TestTransformerContext in project data-transfer-project by google.

the class ToCalendarEventTimeTransformerTest method testTransform.

@Test
public void testTransform() {
    Map<String, String> map = new HashMap<>();
    map.put("dateTime", "2018-02-14T18:00:00.0000000");
    map.put("timeZone", "UTC");
    CalendarEventModel.CalendarEventTime time = transformer.apply(map, new TestTransformerContext());
    Assert.assertEquals(18, time.getDateTime().getHour());
    Assert.assertEquals(2018, time.getDateTime().getYear());
    Assert.assertEquals(14, time.getDateTime().getDayOfMonth());
}
Also used : HashMap(java.util.HashMap) TestTransformerContext(org.datatransferproject.transfer.microsoft.helper.TestTransformerContext) CalendarEventModel(org.datatransferproject.types.common.models.calendar.CalendarEventModel) Test(org.junit.Test)

Example 3 with TestTransformerContext

use of org.datatransferproject.transfer.microsoft.helper.TestTransformerContext in project data-transfer-project by google.

the class ToCalendarEventModelTransformerTest method setUp.

@Before
public void setUp() {
    transformer = new ToCalendarEventModelTransformer();
    mapper = new ObjectMapper();
    context = new TestTransformerContext();
}
Also used : TestTransformerContext(org.datatransferproject.transfer.microsoft.helper.TestTransformerContext) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Before(org.junit.Before)

Example 4 with TestTransformerContext

use of org.datatransferproject.transfer.microsoft.helper.TestTransformerContext in project data-transfer-project by google.

the class ToCalendarModelTransformerTest method setUp.

@Before
public void setUp() {
    transformer = new ToCalendarModelTransformer();
    mapper = new ObjectMapper();
    context = new TestTransformerContext();
}
Also used : TestTransformerContext(org.datatransferproject.transfer.microsoft.helper.TestTransformerContext) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Before(org.junit.Before)

Aggregations

TestTransformerContext (org.datatransferproject.transfer.microsoft.helper.TestTransformerContext)4 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 HashMap (java.util.HashMap)2 Before (org.junit.Before)2 Test (org.junit.Test)2 CalendarAttendeeModel (org.datatransferproject.types.common.models.calendar.CalendarAttendeeModel)1 CalendarEventModel (org.datatransferproject.types.common.models.calendar.CalendarEventModel)1