Skip to content

Commit

Permalink
Fix Test Case
Browse files Browse the repository at this point in the history
Changes #68
  • Loading branch information
dmfrey committed Jan 24, 2017
1 parent 34f6427 commit 3e9eb83
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.lessThan;
import static org.hamcrest.Matchers.lessThanOrEqualTo;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.assertThat;
Expand All @@ -28,7 +28,7 @@
public class MediaItemDataMapperTest extends ApplicationTestCase {

private static final String JSON_RESPONSE_DVR_GET_RECORDED = "{\"Program\": {\"StartTime\": \"2015-09-08T11:30:00Z\", \"EndTime\": \"2015-09-08T12:00:00Z\", \"Title\": \"Star Wars: Droid Tales\", \"SubTitle\": \"Mission to Mos Eisley\", \"Category\": \"Fantasy\", \"CatType\": \"series\", \"Repeat\": \"false\", \"VideoProps\": \"11\", \"AudioProps\": \"0\", \"SubProps\": \"1\", \"SeriesId\": \"EP02206828\", \"ProgramId\": \"EP022068280003\", \"Stars\": \"0\", \"LastModified\": \"2015-09-08T12:00:01Z\", \"ProgramFlags\": \"5\", \"Airdate\": \"2015-09-07\", \"Description\": \"C-3PO recounts his adventure with the ``Star Wars Rebels'' crew in an effort to find R2-D2, who has been kidnapped.\", \"Inetref\": \"ttvdb.py_298171\", \"Season\": \"0\", \"Episode\": \"0\", \"TotalEpisodes\": \"0\", \"FileSize\": \"2780544064\", \"FileName\": \"2289_20150908113000.ts\", \"HostName\": \"mythcenter\", \"Channel\": {\"ChanId\": \"2289\", \"ChanNum\": \"1289\", \"CallSign\": \"DXDHD\", \"IconURL\": \"\", \"ChannelName\": \"Disney XD HD\", \"MplexId\": \"32767\", \"ServiceId\": \"0\", \"ATSCMajorChan\": \"1289\", \"ATSCMinorChan\": \"0\", \"Format\": \"Default\", \"FrequencyId\": \"1289\", \"FineTune\": \"0\", \"ChanFilters\": \"\", \"SourceId\": \"1\", \"InputId\": \"0\", \"CommFree\": \"false\", \"UseEIT\": \"false\", \"Visible\": \"true\", \"XMLTVID\": \"60006\", \"DefaultAuth\": \"\", \"Programs\": []}, \"Recording\": {\"RecordedId\": \"3120\", \"Status\": \"-3\", \"Priority\": \"0\", \"StartTs\": \"2015-09-08T11:30:00Z\", \"EndTs\": \"2015-09-08T12:00:00Z\", \"FileSize\": \"2780544064\", \"FileName\": \"2289_20150908113000.ts\", \"HostName\": \"mythcenter\", \"LastModified\": \"2015-09-08T12:00:01Z\", \"RecordId\": \"112\", \"RecGroup\": \"Default\", \"PlayGroup\": \"Default\", \"StorageGroup\": \"Default\", \"RecType\": \"0\", \"DupInType\": \"15\", \"DupMethod\": \"6\", \"EncoderId\": \"0\", \"EncoderName\": \"\", \"Profile\": \"Default\"}, \"Artwork\": {\"ArtworkInfos\": []}, \"Cast\": {\"CastMembers\": []}}}";
private static final String JSON_RESPONSE_DVR_GET_RECORDED_NULL_STARTTS = "{\"Program\": {\"StartTime\": \"2015-09-08T11:30:00Z\", \"EndTime\": \"2015-09-08T12:00:00Z\", \"Title\": \"Star Wars: Droid Tales\", \"SubTitle\": \"Mission to Mos Eisley\", \"Category\": \"Fantasy\", \"CatType\": \"series\", \"Repeat\": \"false\", \"VideoProps\": \"11\", \"AudioProps\": \"0\", \"SubProps\": \"1\", \"SeriesId\": \"EP02206828\", \"ProgramId\": \"EP022068280003\", \"Stars\": \"0\", \"LastModified\": \"2015-09-08T12:00:01Z\", \"ProgramFlags\": \"5\", \"Airdate\": \"2015-09-07\", \"Description\": \"C-3PO recounts his adventure with the ``Star Wars Rebels'' crew in an effort to find R2-D2, who has been kidnapped.\", \"Inetref\": \"ttvdb.py_298171\", \"Season\": \"0\", \"Episode\": \"0\", \"TotalEpisodes\": \"0\", \"FileSize\": \"2780544064\", \"FileName\": \"2289_20150908113000.ts\", \"HostName\": \"mythcenter\", \"Channel\": {\"ChanId\": \"2289\", \"ChanNum\": \"1289\", \"CallSign\": \"DXDHD\", \"IconURL\": \"\", \"ChannelName\": \"Disney XD HD\", \"MplexId\": \"32767\", \"ServiceId\": \"0\", \"ATSCMajorChan\": \"1289\", \"ATSCMinorChan\": \"0\", \"Format\": \"Default\", \"FrequencyId\": \"1289\", \"FineTune\": \"0\", \"ChanFilters\": \"\", \"SourceId\": \"1\", \"InputId\": \"0\", \"CommFree\": \"false\", \"UseEIT\": \"false\", \"Visible\": \"true\", \"XMLTVID\": \"60006\", \"DefaultAuth\": \"\", \"Programs\": []}, \"Recording\": {\"RecordedId\": \"3120\", \"Status\": \"-3\", \"Priority\": \"0\", \"StartTs\": null, \"EndTs\": \"2015-09-08T12:00:00Z\", \"FileSize\": \"2780544064\", \"FileName\": \"2289_20150908113000.ts\", \"HostName\": \"mythcenter\", \"LastModified\": \"2015-09-08T12:00:01Z\", \"RecordId\": \"112\", \"RecGroup\": \"Default\", \"PlayGroup\": \"Default\", \"StorageGroup\": \"Default\", \"RecType\": \"0\", \"DupInType\": \"15\", \"DupMethod\": \"6\", \"EncoderId\": \"0\", \"EncoderName\": \"\", \"Profile\": \"Default\"}, \"Artwork\": {\"ArtworkInfos\": []}, \"Cast\": {\"CastMembers\": []}}}";
private static final String JSON_RESPONSE_DVR_GET_RECORDED_NULL_STARTTS = "{\"Program\": {\"StartTime\": \"2015-09-08T11:30:00Z\", \"EndTime\": \"2015-09-08T12:00:00Z\", \"Title\": \"Star Wars: Droid Tales\", \"SubTitle\": \"Mission to Mos Eisley\", \"Category\": \"Fantasy\", \"CatType\": \"series\", \"Repeat\": \"false\", \"VideoProps\": \"11\", \"AudioProps\": \"0\", \"SubProps\": \"1\", \"SeriesId\": \"EP02206828\", \"ProgramId\": \"EP022068280003\", \"Stars\": \"0\", \"LastModified\": \"2015-09-08T12:00:01Z\", \"ProgramFlags\": \"5\", \"Airdate\": \"2015-09-07\", \"Description\": \"C-3PO recounts his adventure with the ``Star Wars Rebels'' crew in an effort to find R2-D2, who has been kidnapped.\", \"Inetref\": \"ttvdb.py_298171\", \"Season\": \"0\", \"Episode\": \"0\", \"TotalEpisodes\": \"0\", \"FileSize\": \"2780544064\", \"FileName\": \"2289_20150908113000.ts\", \"HostName\": \"mythcenter\", \"Channel\": {\"ChanId\": \"2289\", \"ChanNum\": \"1289\", \"CallSign\": \"DXDHD\", \"IconURL\": \"\", \"ChannelName\": \"Disney XD HD\", \"MplexId\": \"32767\", \"ServiceId\": \"0\", \"ATSCMajorChan\": \"1289\", \"ATSCMinorChan\": \"0\", \"Format\": \"Default\", \"FrequencyId\": \"1289\", \"FineTune\": \"0\", \"ChanFilters\": \"\", \"SourceId\": \"1\", \"InputId\": \"0\", \"CommFree\": \"false\", \"UseEIT\": \"false\", \"Visible\": \"true\", \"XMLTVID\": \"60006\", \"DefaultAuth\": \"\", \"Programs\": []}, \"Recording\": {\"RecordedId\": \"3120\", \"Status\": \"-3\", \"Priority\": \"0\", \"StartTs\": \"\", \"EndTs\": \"2015-09-08T12:00:00Z\", \"FileSize\": \"2780544064\", \"FileName\": \"2289_20150908113000.ts\", \"HostName\": \"mythcenter\", \"LastModified\": \"2015-09-08T12:00:01Z\", \"RecordId\": \"112\", \"RecGroup\": \"Default\", \"PlayGroup\": \"Default\", \"StorageGroup\": \"Default\", \"RecType\": \"0\", \"DupInType\": \"15\", \"DupMethod\": \"6\", \"EncoderId\": \"0\", \"EncoderName\": \"\", \"Profile\": \"Default\"}, \"Artwork\": {\"ArtworkInfos\": []}, \"Cast\": {\"CastMembers\": []}}}";
private static final String JSON_RESPONSE_VIDEO_GET_VIDEO = "{\"VideoMetadataInfo\":{\"Id\": \"1\", \"Title\": \"big buck bunny 1080p stereo\", \"SubTitle\": \"\", \"Tagline\": \"\", \"Director\": \"Unknown\", \"Studio\": \"\", \"Description\": \"None\", \"Certification\": \"NR\", \"Inetref\": \"00000000\", \"Collectionref\": \"-1\", \"HomePage\": \"\", \"ReleaseDate\": \"\", \"AddDate\": \"2015-01-05T05:00:00Z\", \"UserRating\": \"0\", \"Length\": \"0\", \"PlayCount\": \"0\", \"Season\": \"0\", \"Episode\": \"0\", \"ParentalLevel\": \"1\", \"Visible\": \"true\", \"Watched\": \"false\", \"Processed\": \"true\", \"ContentType\": \"MOVIE\", \"FileName\": \"library\\/Blender\\/big_buck_bunny_1080p_stereo.ogg\", \"Hash\": \"63ad35476c29214c\", \"HostName\": \"mythcenter\", \"Coverart\": \"\", \"Fanart\": \"\", \"Banner\": \"\", \"Screenshot\": \"\", \"Trailer\": \"\", \"Artwork\": {\"ArtworkInfos\": []}, \"Cast\": {\"CastMembers\": []}}}";

private ProgramEntityJsonMapper programEntityJsonMapper;
Expand Down Expand Up @@ -98,7 +98,7 @@ public void testTransformProgramNullStartTs() throws Exception {
assertThat( mediaItem.getBannerUrl(), is( nullValue() ) );
assertThat( mediaItem.getPreviewUrl(), is( "/Content/GetPreviewImage?RecordedId=3120" ) );

assertThat( mediaItem.getDuration(), lessThan( 0l ) );
assertThat( mediaItem.getDuration(), lessThanOrEqualTo( 0l ) );
assertThat( mediaItem.isValid(), is( false ) );
assertThat( mediaItem.getValidationErrors(), hasSize( 1 ) );

Expand Down

0 comments on commit 3e9eb83

Please sign in to comment.