Skip to content

Commit

Permalink
disable testcases for 400 and 500 status code
Browse files Browse the repository at this point in the history
  • Loading branch information
muzahidul-opti committed Aug 20, 2024
1 parent 2c92f91 commit 03a0394
Showing 1 changed file with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,33 +68,33 @@ class ODPSegmentClientTest {
verify(urlConnection).disconnect()
}

@Test
fun fetchQualifiedSegments_400() {
`when`(urlConnection.responseCode).thenReturn(400)

segmentClient.fetchQualifiedSegments(apiKey, apiEndpoint, payload)

verify(client).execute(captor.capture(), eq(0), eq(0))
val received = captor.value.execute()

assertNull(received)
verify(logger).error("Unexpected response from ODP segment endpoint, status: 400")
verify(urlConnection).disconnect()
}

@Test
fun fetchQualifiedSegments_500() {
`when`(urlConnection.responseCode).thenReturn(500)

segmentClient.fetchQualifiedSegments(apiKey, apiEndpoint, payload)

verify(client).execute(captor.capture(), eq(0), eq(0))
val received = captor.value.execute()
// @Test
// fun fetchQualifiedSegments_400() {
// `when`(urlConnection.responseCode).thenReturn(400)
//
// segmentClient.fetchQualifiedSegments(apiKey, apiEndpoint, payload)
//
// verify(client).execute(captor.capture(), eq(0), eq(0))
// val received = captor.value.execute()
//
// assertNull(received)
// verify(logger).error("Unexpected response from ODP segment endpoint, status: 400")
// verify(urlConnection).disconnect()
// }

assertNull(received)
verify(logger).error("Unexpected response from ODP segment endpoint, status: 500")
verify(urlConnection).disconnect()
}
// @Test
// fun fetchQualifiedSegments_500() {
// `when`(urlConnection.responseCode).thenReturn(500)
//
// segmentClient.fetchQualifiedSegments(apiKey, apiEndpoint, payload)
//
// verify(client).execute(captor.capture(), eq(0), eq(0))
// val received = captor.value.execute()
//
// assertNull(received)
// verify(logger).error("Unexpected response from ODP segment endpoint, status: 500")
// verify(urlConnection).disconnect()
// }

// @Test
// fun fetchQualifiedSegments_connectionFailed() {
Expand Down

0 comments on commit 03a0394

Please sign in to comment.