Pytania otagowane jako rest-assured

7
java.lang.ClassCastException: java.util.LinkedHashMap nie można rzutować na com.testing.models.Account
Otrzymuję poniższy błąd: java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to com.testing.models.Account z poniższym kodem 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); Czy istnieje powód, dla którego nie mogę tego zrobić get(0)?
Korzystając z naszej strony potwierdzasz, że przeczytałeś(-aś) i rozumiesz nasze zasady używania plików cookie i zasady ochrony prywatności.
Licensed under cc by-sa 3.0 with attribution required.