@Test
public void create_context_from_parameters() {
Map<String, Object> map = newHashMap();
map.put("pageSize", 10l);
map.put("pageIndex", 50);
QueryContext context = InternalRubyIssueService.toContext(map);
assertThat(context.getLimit()).isEqualTo(10);
assertThat(context.getPage()).isEqualTo(50);
map = newHashMap();
map.put("pageSize", -1);
map.put("pageIndex", 50);
context = InternalRubyIssueService.toContext(map);
assertThat(context.getLimit()).isEqualTo(500);
assertThat(context.getPage()).isEqualTo(1);
context = InternalRubyIssueService.toContext(Maps.<String, Object>newHashMap());
assertThat(context.getLimit()).isEqualTo(100);
assertThat(context.getPage()).isEqualTo(1);
}