@Test public void test_empty_params() throws Exception { UserQuery query = UserQuery.create(); Map<String, Object> params = query.urlParams(); assertThat(params).isEmpty(); }
@Test public void test_params() throws Exception { UserQuery query = UserQuery.create().includeDeactivated().logins("simon", "loic"); Map<String, Object> params = query.urlParams(); assertThat(params.get("includeDeactivated")).isEqualTo("true"); assertThat(params.get("logins")).isEqualTo("simon,loic"); }
@Test public void should_search_by_text() throws Exception { UserQuery query = UserQuery.create().searchText("sim"); assertThat(query.urlParams().get("s")).isEqualTo("sim"); }
@Test public void should_replace_logins() throws Exception { UserQuery query = UserQuery.create().logins("simon").logins("loic"); assertThat(query.urlParams().get("logins")).isEqualTo("loic"); }