Questions tagged «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)?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.