Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bgiori committed Aug 2, 2024
1 parent 4a2d1c7 commit 684a99f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/main/kotlin/cohort/CohortApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ internal class DynamicCohortApi(
return if (proxyUrl != null) {
try {
getCohort(proxyUrl, cohortId, cohort)
} catch (e: CohortNotModifiedException) {
throw e
} catch (e: CohortTooLargeException) {
throw e
} catch (e: Exception) {
metrics.onCohortDownloadOriginFallback(e)
getCohort(serverUrl, cohortId, cohort)
Expand Down
3 changes: 1 addition & 2 deletions src/test/kotlin/cohort/CohortDownloadApiTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ class CohortDownloadApiTest {
private val httpClient = OkHttpClient()
private val server = MockWebServer()
private val url = server.url("/")
private val proxyUrl = server.url("/")
private val api = DynamicCohortApi(apiKey,secretKey, maxCohortSize, url, proxyUrl, httpClient)
private val api = DynamicCohortApi(apiKey,secretKey, maxCohortSize, url, null, httpClient)
@Test
fun `cohort download, success`() {
val response = cohortResponse("a", setOf("1"))
Expand Down

0 comments on commit 684a99f

Please sign in to comment.