@@ -28,6 +28,7 @@ import com.google.common.base.Charsets
2828import org .scalatest .{BeforeAndAfterEach , FunSuite }
2929import org .json4s .JsonAST ._
3030import org .json4s .jackson .JsonMethods ._
31+ import com .fasterxml .jackson .core .JsonParseException
3132
3233import org .apache .spark ._
3334import org .apache .spark .util .{AkkaUtils , Utils }
@@ -352,7 +353,7 @@ class StandaloneRestSubmitSuite extends FunSuite with BeforeAndAfterEach {
352353 // server returns malformed response unwittingly
353354 // client should throw an appropriate exception to indicate server failure
354355 val conn1 = sendHttpRequest(submitRequestPath, " POST" , json)
355- intercept[SubmitRestProtocolException ] { client.readResponse(conn1) }
356+ intercept[JsonParseException ] { client.readResponse(conn1) }
356357 // server attempts to send invalid response, but fails internally on validation
357358 // client should receive an error response as server is able to recover
358359 val conn2 = sendHttpRequest(killRequestPath, " POST" )
@@ -362,7 +363,7 @@ class StandaloneRestSubmitSuite extends FunSuite with BeforeAndAfterEach {
362363 // server explodes internally beyond recovery
363364 // client should throw an appropriate exception to indicate server failure
364365 val conn3 = sendHttpRequest(statusRequestPath, " GET" )
365- intercept[SubmitRestProtocolException ] { client.readResponse(conn3) } // empty response
366+ intercept[JsonParseException ] { client.readResponse(conn3) } // empty response
366367 assert(conn3.getResponseCode === HttpServletResponse .SC_INTERNAL_SERVER_ERROR )
367368 }
368369
0 commit comments