use of org.folio.rest.jaxrs.model.RequestPreferences in project mod-circulation-storage by folio-org.
the class RequestPreferencesApiTest method canGetRequestPreferenceByUserIdUsingQuery.
@Test
public void canGetRequestPreferenceByUserIdUsingQuery() {
RequestPreference createdPreference = createRequestPreference().getJson().mapTo(RequestPreference.class);
JsonResponse response = getPreferences("query=userId=" + USER_ID);
RequestPreferences preferences = response.getJson().mapTo(RequestPreferences.class);
assertThat(preferences.getTotalRecords(), is(1));
RequestPreference foundPreference = preferences.getRequestPreferences().get(0);
assertPreferenceEquals(createdPreference, foundPreference);
}
use of org.folio.rest.jaxrs.model.RequestPreferences in project mod-circulation-storage by folio-org.
the class RequestPreferencesApiTest method canGetRequestPreferences.
@Test
public void canGetRequestPreferences() {
createRequestPreference(USER_ID);
createRequestPreference(USER_ID2);
JsonResponse responseGet = getPreferences("");
List<RequestPreference> preferences = responseGet.getJson().getJsonArray("requestPreferences").stream().map(o -> ((JsonObject) o).mapTo(RequestPreference.class)).collect(Collectors.toList());
assertThat(responseGet.getJson().getInteger("totalRecords"), is(2));
assertThat(preferences, hasItem(hasProperty("userId", Matchers.is(USER_ID))));
assertThat(preferences, hasItem(hasProperty("userId", Matchers.is(USER_ID2))));
}
Aggregations