【问题标题】:MIME processing errors types to treat in a Scala functional test在 Scala 功能测试中处理的 MIME 处理错误类型
【发布时间】:2018-04-19 22:48:02
【问题描述】:

我有一个 Scala 代码,用于测试“multipart/form-data”的 MIME 错误,因为没有 bundle。您能告诉我其他要处理的 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"))
      }
    }

【问题讨论】:

    标签: scala mime-types functional-testing boundary


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 2012-12-04
      • 2011-05-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多