use of uk.gov.justice.services.example.cakeshop.it.util.ApiResponse in project microservice_framework by CJSCommonPlatform.
the class CakeShopIT method shouldReturn400WhenInvalidBooleanParamPassed.
@Test
public void shouldReturn400WhenInvalidBooleanParamPassed() {
final ApiResponse response = recipesQueryResult(asList(new BasicNameValuePair("pagesize", "30"), new BasicNameValuePair("glutenFree", "invalid")));
assertThat(response.httpCode(), is(BAD_REQUEST));
}
use of uk.gov.justice.services.example.cakeshop.it.util.ApiResponse in project microservice_framework by CJSCommonPlatform.
the class CakeShopIT method shouldFilterRecipesUsingPageSize.
@Test
public void shouldFilterRecipesUsingPageSize() {
// adding 2 recipes
final String recipeId = "263af847-effb-46a9-96bc-32a0f7526e44";
addRecipe(recipeId, "Absolutely cheesy cheese cake");
final String recipeId2 = "263af847-effb-46a9-96bc-32a0f7526e55";
addRecipe(recipeId2, "Chocolate muffin");
await().until(() -> recipesQueryResult().body().contains(recipeId));
final ApiResponse response = recipesQueryResult(asList(new BasicNameValuePair("pagesize", "1")));
assertThat(response.httpCode(), is(OK));
with(response.body()).assertThat("$.recipes[?(@.id=='" + recipeId2 + "')]", emptyCollection()).assertThat("$.recipes[?(@.id=='" + recipeId + "')].name", hasItem("Absolutely cheesy cheese cake"));
}
Aggregations