From d02e9233b7b83a09435056e5e0bc1c2c7fb74681 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Bertholon Date: Sun, 17 May 2020 23:11:03 +0200 Subject: [PATCH 1/4] Bump version number --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 535e2f2..26eeb3d 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ ch.srgssr playfff - 22 + 23 jar pfff From c42c7e21c61bb335002a54b41330b28311142f30 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Bertholon Date: Mon, 25 May 2020 21:17:33 +0200 Subject: [PATCH 2/4] Update RTS recommendation urls --- docs/RECOMMENDATION.md | 4 ++-- .../ch/srgssr/playfff/service/RecommendationService.java | 4 ++-- .../playfff/controller/RecommendationServiceTests.java | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/RECOMMENDATION.md b/docs/RECOMMENDATION.md index 99685b3..4977492 100644 --- a/docs/RECOMMENDATION.md +++ b/docs/RECOMMENDATION.md @@ -17,7 +17,7 @@ The API doesn't not support paginations, therefore mobile applications didn't im #### RTS videos -- For RTS videos, it asks Peach recommendation `continuous_playback_mobile` service. +- For RTS videos, it asks `rts-datalab.azure-api` recommendation `continuous_playback_endscreen` service. #### RSI, RTR, SRF, SWI videos and RSI, RTR, RTS and SRF audios @@ -46,4 +46,4 @@ The API doesn't not support paginations, therefore mobile applications didn't im #### RTS -- With and without an `userId`, it asks Peach recommendation `play_home_personal_rec` service. +- With and without an `userId`, it asks `rts-datalab.azure-api` recommendation `play_home_personal_rec` service. diff --git a/src/main/java/ch/srgssr/playfff/service/RecommendationService.java b/src/main/java/ch/srgssr/playfff/service/RecommendationService.java index 018024d..2b761a5 100644 --- a/src/main/java/ch/srgssr/playfff/service/RecommendationService.java +++ b/src/main/java/ch/srgssr/playfff/service/RecommendationService.java @@ -168,7 +168,7 @@ else if (index == -1 && clipUrns.size() == 0) { private RecommendedList rtsVideoRecommendedList(String purpose, String urn, boolean standalone) { UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.newInstance().scheme("https") - .host("peach.ebu.io").path("api/v1/chrts/continuous_playback_mobile"); + .host("rts-datalab.azure-api.net").path("rts-datalab-api/continuous_playback_endscreen"); uriComponentsBuilder.queryParam("urn", urn); uriComponentsBuilder.queryParam("purpose", purpose); uriComponentsBuilder.queryParam("pageSize", 49); @@ -184,7 +184,7 @@ private RecommendedList rtsVideoRecommendedList(String purpose, String urn, bool public RecommendedList rtsPlayHomePersonalRecommendation(String userId) { UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.newInstance().scheme("https") - .host("peach.ebu.io").path("api/v1/chrts/play_home_personal_rec"); + .host("rts-datalab.azure-api.net").path("rts-datalab-api/play_home_personal_rec"); uriComponentsBuilder.queryParam("user_id", userId); UriComponents url = uriComponentsBuilder.build(); diff --git a/src/test/java/ch/srgssr/playfff/controller/RecommendationServiceTests.java b/src/test/java/ch/srgssr/playfff/controller/RecommendationServiceTests.java index 2fa8d55..8663bf1 100644 --- a/src/test/java/ch/srgssr/playfff/controller/RecommendationServiceTests.java +++ b/src/test/java/ch/srgssr/playfff/controller/RecommendationServiceTests.java @@ -24,7 +24,7 @@ public void getRecommendedUrnsContinuousplaybackRTSVideoTest() { RecommendedList recommendedList = recommendationService.getRecommendedUrns(purpose, mediaURN, standalone); Assert.assertNotNull(recommendedList.getRecommendationId()); - Assert.assertTrue(recommendedList.getRecommendationId().startsWith("io.ebu.peach:")); + Assert.assertTrue(recommendedList.getRecommendationId().startsWith("net.azure-api.rts-datalab:")); assertValidList(recommendedList); } @@ -36,7 +36,7 @@ public void getRecommendedUrnsContinuousplaybackStandaloneRTSVideoTest() { RecommendedList recommendedList = recommendationService.getRecommendedUrns(purpose, mediaURN, standalone); Assert.assertNotNull(recommendedList.getRecommendationId()); - Assert.assertTrue(recommendedList.getRecommendationId().startsWith("io.ebu.peach:")); + Assert.assertTrue(recommendedList.getRecommendationId().startsWith("net.azure-api.rts-datalab:")); assertValidList(recommendedList); } @@ -151,8 +151,8 @@ public void playHomeTestUserUnknown() { } @Test - public void playHomeTestUser9() { - RecommendedList recommendedList = recommendationService.rtsPlayHomePersonalRecommendation("9"); + public void playHomeTestUser203656() { + RecommendedList recommendedList = recommendationService.rtsPlayHomePersonalRecommendation("203656"); assertValidList(recommendedList); } From 967d8a8c17082f82669f7716d775daa7d5ad5fb5 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Bertholon Date: Mon, 25 May 2020 21:31:52 +0200 Subject: [PATCH 3/4] Ignore invalid user tests for now Waiting an API fix --- .../playfff/controller/RecommendationIntegrationTest.java | 2 ++ .../srgssr/playfff/controller/RecommendationServiceTests.java | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/test/java/ch/srgssr/playfff/controller/RecommendationIntegrationTest.java b/src/test/java/ch/srgssr/playfff/controller/RecommendationIntegrationTest.java index 5726fb3..6c55e0a 100644 --- a/src/test/java/ch/srgssr/playfff/controller/RecommendationIntegrationTest.java +++ b/src/test/java/ch/srgssr/playfff/controller/RecommendationIntegrationTest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.Assert; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -169,6 +170,7 @@ private void getRecommendationURNFormat(String mediaURN, boolean isAvailable) th } @Test + @Ignore public void getRTSPersonalRecommendation() throws Exception { AtomicReference anonymousRecommendedListReference = new AtomicReference<>(); mvc.perform(get("/api/v2/playlist/personalRecommendation")).andExpect(status().isOk()).andExpect(jsonPath("$").isMap()).andExpect(jsonPath("$.recommendationId").isNotEmpty()).andExpect(jsonPath("$.recommendationId").isNotEmpty()).andDo(mvcResult -> { diff --git a/src/test/java/ch/srgssr/playfff/controller/RecommendationServiceTests.java b/src/test/java/ch/srgssr/playfff/controller/RecommendationServiceTests.java index 8663bf1..72041f2 100644 --- a/src/test/java/ch/srgssr/playfff/controller/RecommendationServiceTests.java +++ b/src/test/java/ch/srgssr/playfff/controller/RecommendationServiceTests.java @@ -3,6 +3,7 @@ import ch.srgssr.playfff.model.RecommendedList; import ch.srgssr.playfff.service.RecommendationService; import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -137,6 +138,7 @@ public void getRecommendedUrnsContinuousplaybackStandaloneSwisstxtTest() { } @Test + @Ignore public void playHomeTestInvalidUser() { RecommendedList recommendedList = recommendationService.rtsPlayHomePersonalRecommendation("invalid user"); @@ -144,6 +146,7 @@ public void playHomeTestInvalidUser() { } @Test + @Ignore public void playHomeTestUserUnknown() { RecommendedList recommendedList = recommendationService.rtsPlayHomePersonalRecommendation("unknown"); From acbb1b228672c8f9ab719347032832df67d570b0 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Bertholon Date: Tue, 26 May 2020 18:55:24 +0200 Subject: [PATCH 4/4] Revert "Ignore invalid user tests for now" This reverts commit 967d8a8c17082f82669f7716d775daa7d5ad5fb5. --- .../playfff/controller/RecommendationIntegrationTest.java | 2 -- .../srgssr/playfff/controller/RecommendationServiceTests.java | 3 --- 2 files changed, 5 deletions(-) diff --git a/src/test/java/ch/srgssr/playfff/controller/RecommendationIntegrationTest.java b/src/test/java/ch/srgssr/playfff/controller/RecommendationIntegrationTest.java index 6c55e0a..5726fb3 100644 --- a/src/test/java/ch/srgssr/playfff/controller/RecommendationIntegrationTest.java +++ b/src/test/java/ch/srgssr/playfff/controller/RecommendationIntegrationTest.java @@ -5,7 +5,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.Assert; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -170,7 +169,6 @@ private void getRecommendationURNFormat(String mediaURN, boolean isAvailable) th } @Test - @Ignore public void getRTSPersonalRecommendation() throws Exception { AtomicReference anonymousRecommendedListReference = new AtomicReference<>(); mvc.perform(get("/api/v2/playlist/personalRecommendation")).andExpect(status().isOk()).andExpect(jsonPath("$").isMap()).andExpect(jsonPath("$.recommendationId").isNotEmpty()).andExpect(jsonPath("$.recommendationId").isNotEmpty()).andDo(mvcResult -> { diff --git a/src/test/java/ch/srgssr/playfff/controller/RecommendationServiceTests.java b/src/test/java/ch/srgssr/playfff/controller/RecommendationServiceTests.java index 72041f2..8663bf1 100644 --- a/src/test/java/ch/srgssr/playfff/controller/RecommendationServiceTests.java +++ b/src/test/java/ch/srgssr/playfff/controller/RecommendationServiceTests.java @@ -3,7 +3,6 @@ import ch.srgssr.playfff.model.RecommendedList; import ch.srgssr.playfff.service.RecommendationService; import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -138,7 +137,6 @@ public void getRecommendedUrnsContinuousplaybackStandaloneSwisstxtTest() { } @Test - @Ignore public void playHomeTestInvalidUser() { RecommendedList recommendedList = recommendationService.rtsPlayHomePersonalRecommendation("invalid user"); @@ -146,7 +144,6 @@ public void playHomeTestInvalidUser() { } @Test - @Ignore public void playHomeTestUserUnknown() { RecommendedList recommendedList = recommendationService.rtsPlayHomePersonalRecommendation("unknown");