@Test public void shouldCreateEvent() throws Exception { List<ProgramSupported> programSupportedList = asList(make(a(defaultProgramSupported))); ProgramSupportedEventDTO programSupportedEventDTO = new ProgramSupportedEventDTO("F10", programSupportedList); mockStatic(DateTime.class); DateTime dateTime = new DateTime(); when(DateTime.now()).thenReturn(dateTime); Event event = programSupportedEventDTO.createEvent(); assertThat(event.getTitle(), is(ProgramSupportedEventDTO.TITLE)); assertThat(event.getCategory(), is(ProgramSupportedEventDTO.CATEGORY)); assertNotNull(event.getUuid()); assertThat(event.getTimeStamp(), is(dateTime)); assertThat(event.getContents(), is(programSupportedEventDTO.getSerializedContents())); }
public Event createEvent() throws URISyntaxException { return new Event(UUID.randomUUID().toString(), TITLE, DateTime.now(), "", getSerializedContents(), CATEGORY); }
ProgramSupportedEventDTO extends BaseFeedDTO { public Event createEvent() throws URISyntaxException { return new Event(UUID.randomUUID().toString(), TITLE, DateTime.now(), "", getSerializedContents(), CATEGORY); } }
ProgramSupportedEventDTO extends BaseFeedDTO { public Event createEvent() throws URISyntaxException { return new Event(UUID.randomUUID().toString(), TITLE, DateTime.now(), "", getSerializedContents(), CATEGORY); } ProgramSupportedEventDTO(String facilityCode, List<ProgramSupported> programSupportedList); }
ProgramSupportedEventDTO extends BaseFeedDTO { public Event createEvent() throws URISyntaxException { return new Event(UUID.randomUUID().toString(), TITLE, DateTime.now(), "", getSerializedContents(), CATEGORY); } ProgramSupportedEventDTO(String facilityCode, List<ProgramSupported> programSupportedList); Event createEvent(); }
ProgramSupportedEventDTO extends BaseFeedDTO { public Event createEvent() throws URISyntaxException { return new Event(UUID.randomUUID().toString(), TITLE, DateTime.now(), "", getSerializedContents(), CATEGORY); } ProgramSupportedEventDTO(String facilityCode, List<ProgramSupported> programSupportedList); Event createEvent(); static final String CATEGORY; static final String TITLE; }