2017-11-07 26 views
0

번들이없는 경우 'multipart/form-data'에 대한 MIME 오류 테스트가있는 스칼라 코드가 있습니다. 처리 할 다른 MIME 처리 오류 유형을 알려주시겠습니까?스칼라 기능 테스트에서 처리 할 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")) 
     } 
    } 

답변