|
8 | 8 |
|
9 | 9 | import org.junit.jupiter.api.Test;
|
10 | 10 |
|
| 11 | +import com.fasterxml.jackson.core.JsonProcessingException; |
| 12 | + |
11 | 13 | import nl.vpro.domain.media.exceptions.CircularReferenceException;
|
| 14 | +import nl.vpro.jackson2.Jackson2Mapper; |
12 | 15 |
|
13 | 16 | import static org.assertj.core.api.Assertions.assertThat;
|
14 | 17 | import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
@@ -68,4 +71,52 @@ public void testCreateEpisodeOfWhenCircular() {
|
68 | 71 | program.createEpisodeOf(group, 1, null);
|
69 | 72 | }).isInstanceOf(CircularReferenceException.class);
|
70 | 73 | }
|
| 74 | + |
| 75 | + @Test |
| 76 | + public void moveEvent() throws JsonProcessingException { |
| 77 | + Program p = new Program(); |
| 78 | + p.setMid("POW_05759681"); |
| 79 | + ScheduleEvent s = Jackson2Mapper.getLenientInstance().readValue( |
| 80 | + """ |
| 81 | + { |
| 82 | + "channel": "NED1", |
| 83 | + "start": 1733763600000, |
| 84 | + "guideDay": 1733698800000, |
| 85 | + "duration": 900000, |
| 86 | + "midRef": "POW_05759681", |
| 87 | + "poProgID": "POW_05759681", |
| 88 | + "textSubtitles": "Teletekst ondertitels", |
| 89 | + "rerun": false, |
| 90 | + "imi": "imi:1612093401", |
| 91 | + "urnRef": "crid://media-press.tv/394635384", |
| 92 | + "eventStart": 1733763600000 |
| 93 | + }\ |
| 94 | + """, ScheduleEvent.class); |
| 95 | + p.addScheduleEvent(s); |
| 96 | + Program p2 = new Program(); |
| 97 | + p2.setMid("POW_05759681"); |
| 98 | + |
| 99 | + ScheduleEvent s2 = Jackson2Mapper.getLenientInstance().readValue( |
| 100 | + """ |
| 101 | + { |
| 102 | + "channel": "BVNT", |
| 103 | + "start": 1733763600000, |
| 104 | + "guideDay": 1733698800000, |
| 105 | + "duration": 900000, |
| 106 | + "midRef": "POW_05759681", |
| 107 | + "poProgID": "POW_05759681", |
| 108 | + "textSubtitles": "Teletekst ondertitels", |
| 109 | + "rerun": false, |
| 110 | + "imi": "imi:1612093401", |
| 111 | + "urnRef": "crid://media-press.tv/394635384", |
| 112 | + "eventStart": 1733763600000 |
| 113 | + }\ |
| 114 | + """, ScheduleEvent.class); |
| 115 | + s2.setParent(p2); |
| 116 | + |
| 117 | + s2.setParent(p); |
| 118 | + assertThat(p.getScheduleEvents()).hasSize(2); |
| 119 | + |
| 120 | + |
| 121 | + } |
71 | 122 | }
|
0 commit comments