use of org.jboss.resteasy.specimpl.ResteasyUriInfo in project policies-ui-backend by RedHatInsights.
the class TagsFilterTest method filter3.
@Test
void filter3() throws URISyntaxException {
UriInfo info = new ResteasyUriInfo(new URI("https://foo?filter[name]=VM&filter:op[name]=like"));
Pager pager = PagingUtils.extractPager(info);
String query = PolicyHistoryTagFilterHelper.getTagsFilterFromPager(pager);
assertEquals("tags.display_name MATCHES '*vm*'", query);
}
use of org.jboss.resteasy.specimpl.ResteasyUriInfo in project policies-ui-backend by RedHatInsights.
the class TagsFilterTest method filter1.
@Test
void filter1() throws URISyntaxException {
UriInfo info = new ResteasyUriInfo(new URI("https://foo?filter[name]=VM"));
Pager pager = PagingUtils.extractPager(info);
String query = PolicyHistoryTagFilterHelper.getTagsFilterFromPager(pager);
assertEquals("tags.display_name = 'vm'", query);
}
use of org.jboss.resteasy.specimpl.ResteasyUriInfo in project policies-ui-backend by RedHatInsights.
the class TagsFilterTest method filter6.
@Test
void filter6() throws URISyntaxException {
UriInfo info = new ResteasyUriInfo(new URI("https://foo?filter[name]=VM&filter:op[id]=not_equal"));
Pager pager = PagingUtils.extractPager(info);
String query = PolicyHistoryTagFilterHelper.getTagsFilterFromPager(pager);
assertEquals("tags.display_name = 'vm'", query);
}
use of org.jboss.resteasy.specimpl.ResteasyUriInfo in project policies-ui-backend by RedHatInsights.
the class PagingUtilsTest method testExtractPagerSortWrongDirection.
@Test
public void testExtractPagerSortWrongDirection() throws URISyntaxException {
UriInfo info = new ResteasyUriInfo(new URI("https://foo?sortColumn=foo&sortDirection=bar"));
assertThrows(IllegalArgumentException.class, () -> {
PagingUtils.extractPager(info);
});
}
use of org.jboss.resteasy.specimpl.ResteasyUriInfo in project policies-ui-backend by RedHatInsights.
the class PagingUtilsTest method extractBadFilterBooleanOperator.
@Test
public void extractBadFilterBooleanOperator() throws URISyntaxException {
UriInfo info = new ResteasyUriInfo(new URI("https://foo?filter[bar]=true&filter:op[bar]=boolean_is"));
try {
PagingUtils.extractPager(info);
} catch (IllegalArgumentException e) {
return;
}
fail("Should not reach this");
}
Aggregations