MvcResult result = ControllerUtil.performRouterRequest(mockMvc, edRequest);
List<ExtDirectResponse> responses = ControllerUtil.readDirectResponses(result
.getResponse().getContentAsByteArray());
assertThat(responses).hasSize(1);
ExtDirectResponse resp = responses.get(0);
assertResponse(resp, "readWithPaging");
ExtDirectStoreResult<Book> storeResponse = ControllerUtil.convertValue(
resp.getResult(), new TypeReference<ExtDirectStoreResult<Book>>() {/* nothing_here */
});
assertThat(storeResponse.getTotal()).isEqualTo(51L);
assertThat(storeResponse.isSuccess()).isTrue();
assertThat(storeResponse.getRecords().size()).isEqualTo(2);
Iterator<Book> it = storeResponse.getRecords().iterator();
Book aBook = it.next();
assertThat(aBook.getId().intValue()).isEqualTo(1);
assertThat(aBook.getTitle()).isEqualTo("Ext JS in Action");
assertThat(aBook.getIsbn()).isEqualTo("1935182110");
aBook = it.next();
assertThat(aBook.getId().intValue()).isEqualTo(2);
assertThat(aBook.getTitle()).isEqualTo("Learning Ext JS 3.2");
assertThat(aBook.getIsbn()).isEqualTo("1849511209");
edRequest = ControllerUtil.createEdsRequest(serviceName, "read", 1, null);
result = ControllerUtil.performRouterRequest(mockMvc, edRequest);
responses = ControllerUtil.readDirectResponses(result.getResponse()
.getContentAsByteArray());
assertThat(responses).hasSize(1);
resp = responses.get(0);
assertResponse(resp, "read");
Collection<Book> books = ControllerUtil.convertValue(resp.getResult(),
new TypeReference<Collection<Book>>() {
// nothing here
});
it = books.iterator();