use of alien4cloud.dao.model.FacetedSearchResult in project alien4cloud by alien4cloud.
the class SearchDefinitionSteps method The_response_should_contains_elements_from_various_types.
@Then("^The response should contains (\\d+) elements from various types.$")
public void The_response_should_contains_elements_from_various_types(int expectedSize) throws Throwable {
RestResponse<FacetedSearchResult> restResponse = JsonUtil.read(Context.getInstance().getRestResponse(), FacetedSearchResult.class);
FacetedSearchResult searchResp = restResponse.getData();
assertNotNull(searchResp);
assertNotNull(searchResp.getTypes());
assertNotNull(searchResp.getData());
assertEquals(expectedSize, searchResp.getTypes().length);
assertEquals(expectedSize, searchResp.getData().length);
// check various types in result
ArrayList<String> resultTypes = new ArrayList<>(Arrays.asList(searchResp.getTypes()));
for (String indexedType : indexedComponentTypes.values()) {
assertTrue(" Result Types should contains " + indexedType + ".", resultTypes.contains(indexedType));
}
}
use of alien4cloud.dao.model.FacetedSearchResult in project alien4cloud by alien4cloud.
the class UsersDefinitionsSteps method there_should_be_users_in_the_response.
@Then("^there should be (\\d+) users in the response$")
public void there_should_be_users_in_the_response(int expectedSize) throws Throwable {
RestResponse<FacetedSearchResult> restResponse = JsonUtil.read(Context.getInstance().takeRestResponse(), FacetedSearchResult.class);
GetMultipleDataResult searchResp = restResponse.getData();
assertNotNull(searchResp);
assertNotNull(searchResp.getTypes());
assertNotNull(searchResp.getData());
assertEquals(expectedSize, searchResp.getTypes().length);
assertEquals(expectedSize, searchResp.getData().length);
}
Aggregations