use of org.jboss.resteasy.specimpl.ResteasyUriInfo in project policies-ui-backend by RedHatInsights.
the class TagsFilterTest method filter7.
@Test
void filter7() throws URISyntaxException {
UriInfo info = new ResteasyUriInfo(new URI("https://foo?filter[name]=toLowerCaseString&filter:op[name]=like"));
Pager pager = PagingUtils.extractPager(info);
String query = PolicyHistoryTagFilterHelper.getTagsFilterFromPager(pager);
assertEquals("tags.display_name MATCHES '*tolowercasestring*'", query);
}
use of org.jboss.resteasy.specimpl.ResteasyUriInfo in project policies-ui-backend by RedHatInsights.
the class TagsFilterTest method filter4_2.
@Test
void filter4_2() throws URISyntaxException {
UriInfo info = new ResteasyUriInfo(new URI("https://foo?filter[name]=VM&filter[id]=123&filter:op[name]=not_equal"));
Pager pager = PagingUtils.extractPager(info);
String query = PolicyHistoryTagFilterHelper.getTagsFilterFromPager(pager);
assertEquals("tags.display_name != 'vm' AND tags.inventory_id = '123'", query);
}
use of org.jboss.resteasy.specimpl.ResteasyUriInfo in project policies-ui-backend by RedHatInsights.
the class TagsFilterTest method filter5.
@Test
void filter5() throws URISyntaxException {
UriInfo info = new ResteasyUriInfo(new URI("https://foo?filter[id]=123-45&filter:op[id]=like"));
Pager pager = PagingUtils.extractPager(info);
String query = PolicyHistoryTagFilterHelper.getTagsFilterFromPager(pager);
assertEquals("tags.inventory_id MATCHES '*123-45*'", query);
}
use of org.jboss.resteasy.specimpl.ResteasyUriInfo in project policies-ui-backend by RedHatInsights.
the class PagingUtilsTest method extractPagerInvalidLimit.
@Test
void extractPagerInvalidLimit() throws URISyntaxException {
UriInfo info = new ResteasyUriInfo(new URI("https://foo?offset=12&limit=foo"));
assertThrows(IllegalArgumentException.class, () -> {
PagingUtils.extractPager(info);
});
}
use of org.jboss.resteasy.specimpl.ResteasyUriInfo in project policies-ui-backend by RedHatInsights.
the class PagingUtilsTest method extractFilterInvalidOperator.
@Test
public void extractFilterInvalidOperator() throws URISyntaxException {
UriInfo info = new ResteasyUriInfo(new URI("https://foo?filter[bar]=true&filter:op[bar]=wrong"));
assertThrows(IllegalArgumentException.class, () -> {
PagingUtils.extractPager(info);
});
}
Aggregations