2017-11-07 8 views
0

バンドラがないため、 'multipart/form-data'のMIMEエラーのテストでScalaコードがあります。あなたは私に他のMIME処理エラーの種類を教えてもらえますか?Scalaの機能テストで扱うMIME処理エラーの種類

val boundary = "v4cGfsdgdsgdfsh49Sd" 
"error if a multipart message posted with no boundary in the MIME type" in new Scope { 
     val contentType = `multipart/form-data`.withBoundary(boundary) 

     val innerBoundary = "iIbuIgjhgjGJHGjhgjYkn5OK1" 
     val contentTypeStringWithoutBoundary = 
     s"application/vnd.wap.multipart.mixed; someParam=someValue; " + 
      s"otherParam=otherValueObjects" 
     val uri = makeObjectsPostUrl 
     val entity = HttpEntity(
     contentType, 
     ByteString(textMultipartRequestWithType(
      contentTypeStringWithoutBoundary, boundary, innerBoundary))) 

     val postRequest = Post(
     uri, entity) 
     .withAuth 

     val postResponse = makeRequest(postRequest) 

     withInfoOnFailure(postResponse) { 
     assertResponseIsOmaError(
      postResponse, 
      StatusCodes.BadRequest, 
      OmaErrors.ServiceErrorWithDescription(
      "Content-Type with a multipart media type must have a " + 
       "'boundary' parameter", "0")) 
     } 
    } 

答えて

関連する問題