Skip to content

Commit 45856ca

Browse files
committed
Replace HttpResponseException with AzureDataLakeException in test code
1 parent 2ce8b70 commit 45856ca

File tree

1 file changed

+4
-4
lines changed
  • Utils/hdinsight-node-common/Test/java/com/microsoft/azure/hdinsight/sdk/common/livy/interactive

1 file changed

+4
-4
lines changed

Utils/hdinsight-node-common/Test/java/com/microsoft/azure/hdinsight/sdk/common/livy/interactive/SessionScenario.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ package com.microsoft.azure.hdinsight.sdk.common.livy.interactive
2424

2525
import com.github.tomakehurst.wiremock.client.WireMock
2626
import com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo
27+
import com.microsoft.azure.hdinsight.sdk.common.AzureDataLakeException
2728
import com.microsoft.azure.hdinsight.spark.common.MockHttpService
2829
import cucumber.api.java.Before
2930
import cucumber.api.java.en.And
3031
import cucumber.api.java.en.Given
3132
import cucumber.api.java.en.Then
32-
import org.apache.http.client.HttpResponseException
3333
import org.assertj.core.api.Assertions.assertThat
3434
import java.net.URI
3535
import kotlin.test.fail
@@ -70,16 +70,16 @@ class SessionScenario {
7070
}}
7171
}
7272

73-
@Then("^check the HttpResponseException\\((\\d+)\\) when creating livy interactive session after creating should be thrown$")
73+
@Then("^check the AzureDataLakeException\\((\\d+)\\) when creating livy interactive session after creating should be thrown$")
7474
fun checkCreateSessionException(statusCodeExpect: Int) {
7575
sessionMock!!.create()
7676
.subscribe(
7777
{
7878
fail("Get a normal session return without exceptions.")
7979
},
8080
{ err -> run {
81-
assertThat(err).isInstanceOf(HttpResponseException::class.java)
82-
assertThat((err as HttpResponseException).statusCode).isEqualTo(statusCodeExpect)
81+
assertThat(err).isInstanceOf(AzureDataLakeException::class.java)
82+
assertThat((err as AzureDataLakeException).statusCode).isEqualTo(statusCodeExpect)
8383
}}
8484
)
8585

0 commit comments

Comments
 (0)