@@ -28,6 +28,7 @@ import com.google.common.base.Charsets
28
28
import org .scalatest .{BeforeAndAfterEach , FunSuite }
29
29
import org .json4s .JsonAST ._
30
30
import org .json4s .jackson .JsonMethods ._
31
+ import com .fasterxml .jackson .core .JsonParseException
31
32
32
33
import org .apache .spark ._
33
34
import org .apache .spark .util .{AkkaUtils , Utils }
@@ -352,7 +353,7 @@ class StandaloneRestSubmitSuite extends FunSuite with BeforeAndAfterEach {
352
353
// server returns malformed response unwittingly
353
354
// client should throw an appropriate exception to indicate server failure
354
355
val conn1 = sendHttpRequest(submitRequestPath, " POST" , json)
355
- intercept[SubmitRestProtocolException ] { client.readResponse(conn1) }
356
+ intercept[JsonParseException ] { client.readResponse(conn1) }
356
357
// server attempts to send invalid response, but fails internally on validation
357
358
// client should receive an error response as server is able to recover
358
359
val conn2 = sendHttpRequest(killRequestPath, " POST" )
@@ -362,7 +363,7 @@ class StandaloneRestSubmitSuite extends FunSuite with BeforeAndAfterEach {
362
363
// server explodes internally beyond recovery
363
364
// client should throw an appropriate exception to indicate server failure
364
365
val conn3 = sendHttpRequest(statusRequestPath, " GET" )
365
- intercept[SubmitRestProtocolException ] { client.readResponse(conn3) } // empty response
366
+ intercept[JsonParseException ] { client.readResponse(conn3) } // empty response
366
367
assert(conn3.getResponseCode === HttpServletResponse .SC_INTERNAL_SERVER_ERROR )
367
368
}
368
369
0 commit comments