Запитання з тегом «rest-assured»

7
java.lang.ClassCastException: java.util.LinkedHashMap не можна передати на com.testing.models.Account
Я отримую нижче помилки: java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to com.testing.models.Account з кодом нижче final int expectedId = 1; Test newTest = create(); int expectedResponseCode = Response.SC_OK; ArrayList<Account> account = given().when().expect().statusCode(expectedResponseCode) .get("accounts/" + newTest.id() + "/users") .as(ArrayList.class); assertThat(account.get(0).getId()).isEqualTo(expectedId); Чи є причина, чому я не можу це зробити get(0)?
Використовуючи наш веб-сайт, ви визнаєте, що прочитали та зрозуміли наші Політику щодо файлів cookie та Політику конфіденційності.
Licensed under cc by-sa 3.0 with attribution required.