ArrayIndexOutOfBoundsException использовать каратэ 0.8.0 - PullRequest
0 голосов
/ 15 ноября 2018

мой код:

@upload @offline
Feature: upload one mp3 file

  Background:
    * url 'http://xx.test.com'
    * def Sign = Java.type('token.Sign')

    Scenario:
      * def ck = Sign.execute(false)
      * print ck
      * path '/rest/n/test/up'
      * cookie userId = ck.id
      * cookie tes.api_st = ck.st
      * cookie did = ck.did
      * multipart field title = 'hello'
      * multipart file ringtone = { read: '123.mp3', filename: '123.mp3', contentType: 'audio/mp3' }
      * method post
      * status 200
      * match response contains { result: 1 }

И mvn test -Dtest=xxx выведет следующую информацию:

19:39:57.073 [main] ERROR com.intuit.karate - java.lang.ArrayIndexOutOfBoundsException: -1, http call failed after 1542281997073 milliseconds for URL: http://tianou123.test.gifshow.com/rest/n/test/up
19:39:57.073 [main] ERROR com.intuit.karate - http request failed: -1
19:39:57.925 [main] WARN  io.sentry.dsn.Dsn - *** Couldn't find a suitable DSN, Sentry operations will do nothing! See documentation: https://docs.sentry.io/clients/java/ ***
Failed scenarios:
xxx/upload.feature:8 # Scenario: 

Итак, я не знаю почему. Потому что запрос не поступит на бэкэнд-сервер.

И запрос может выполняться нормально, используя почтальон.

...