@@ -0,0 +1,2780 @@
+/*%0A * This program is part of the OpenLMIS logistics management information system platform software.%0A * Copyright %C2%A9 2017 VillageReach%0A *%0A * This program is free software: you can redistribute it and/or modify it under the terms%0A * of the GNU Affero General Public License as published by the Free Software Foundation, either%0A * version 3 of the License, or (at your option) any later version.%0A *%0A * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;%0A * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.%0A * See the GNU Affero General Public License for more details. You should have received a copy of%0A * the GNU Affero General Public License along with this program. If not, see%0A * http://www.gnu.org/licenses. %C2%A0For additional information contact info@OpenLMIS.org.%0A */%0A%0Apackage org.openlmis.referencedata.web;%0A%0Aimport static org.junit.Assert.assertFalse;%0Aimport static org.junit.Assert.assertTrue;%0A%0Aimport java.util.UUID;%0Aimport org.apache.commons.lang.RandomStringUtils;%0Aimport org.junit.Test;%0Aimport org.springframework.util.LinkedMultiValueMap;%0Aimport org.springframework.util.MultiValueMap;%0A%0Apublic class SearchParamsTest %7B%0A%0A  private MultiValueMap%3CString, Object%3E map = new LinkedMultiValueMap%3C%3E();%0A%0A  @Test%0A  public void containsKeyShouldReturnTrueIfKeyWasAdded() %7B%0A    String someParam = %22someParam%22;%0A    map.add(someParam, RandomStringUtils.random(5));%0A%0A    SearchParams searchParams = new SearchParams(map);%0A%0A    assertTrue(searchParams.containsKey(someParam));%0A  %7D%0A%0A  @Test%0A  public void containsKeyShouldReturnTrueIfKeyWasNotAdded() %7B%0A    SearchParams searchParams = new SearchParams(map);%0A%0A    assertFalse(searchParams.containsKey(%22notExist%22));%0A  %7D%0A%0A  @Test%0A  public void shouldRemoveAccessTokenParamWhenCreateObject() %7B%0A    String accessToken = %22access_token%22;%0A    map.add(accessToken, UUID.randomUUID().toString());%0A%0A    SearchParams searchParams = new SearchParams(map);%0A%0A    assertFalse(searchParams.containsKey(accessToken));%0A  %7D%0A%0A  @Test%0A  public void shouldRemovePageParamWhenCreateObject() %7B%0A    String page = %22page%22;%0A    map.add(page, UUID.randomUUID().toString());%0A%0A    SearchParams searchParams = new SearchParams(map);%0A%0A    assertFalse(searchParams.containsKey(page));%0A  %7D%0A%0A  @Test%0A  public void shouldRemoveSizeParamWhenCreateObject() %7B%0A    String size = %22size%22;%0A    map.add(size, UUID.randomUUID().toString());%0A%0A    SearchParams searchParams = new SearchParams(map);%0A%0A    assertFalse(searchParams.containsKey(size));%0A  %7D%0A%0A  @Test%0A  public void shouldRemoveSortParamWhenCreateObject() %7B%0A    String sort = %22sort%22;%0A    map.add(sort, UUID.randomUUID().toString());%0A%0A    SearchParams searchParams = new SearchParams(map);%0A%0A    assertFalse(searchParams.containsKey(sort));%0A  %7D%0A%0A%7D

add tests for search params