Skip to content

Commit

Permalink
Add integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pyby committed Dec 1, 2020
1 parent 933ff09 commit f660f48
Showing 1 changed file with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
public class RecommendationIntegrationTest {
private MockMvc mvc;

private final String continuousplaybackPurpose = "continuousplayback";
private final String relatedContentPurpose = "relatedContent";

@Autowired
private WebApplicationContext context;

Expand All @@ -45,33 +48,39 @@ public void setup() {
public void getRecommendationRTSVideo() throws Exception {
String mediaURN = "urn:rts:video:9691670";

getRecommendation(mediaURN);
getRecommendation(mediaURN, continuousplaybackPurpose);

getRecommendation(mediaURN, relatedContentPurpose);
}

@Test
public void getRecommendationRTSVAudioFull() throws Exception {
String mediaURN = "urn:rts:audio:9866170";

getRecommendation(mediaURN);
getRecommendation(mediaURN, continuousplaybackPurpose);

getRecommendation(mediaURN, relatedContentPurpose);
}

@Test
public void getRecommendationRTSVAudioClip() throws Exception {
String mediaURN = "urn:rts:audio:10163388";

getRecommendation(mediaURN);
getRecommendation(mediaURN, continuousplaybackPurpose);

getRecommendation(mediaURN, relatedContentPurpose);
}

@Test
public void getRecommendationSRF() throws Exception {
String mediaURN = "urn:srf:video:859dc7e6-a155-41da-9d34-8f4eb800f73c";

getRecommendation(mediaURN);
}
getRecommendation(mediaURN, continuousplaybackPurpose);

public void getRecommendation(String mediaURN) throws Exception {
String purpose = "continuousplayback";
getRecommendation(mediaURN, relatedContentPurpose);
}

public void getRecommendation(String mediaURN, String purpose) throws Exception {
mvc.perform(get("/api/v1/playlist/recommendation/" + purpose + "/" + mediaURN)).andExpect(status().isFound()).andExpect(content().string(""));

checkRecommendationWithRedirect(purpose, mediaURN, "false");
Expand Down

0 comments on commit f660f48

Please sign in to comment.