test_class.declarator: caseService
test_class.modifier: @Mock
test_class.original_string: @Mock
      CaseService caseService;
test_class.type: CaseService
test_class.var_name: caseService
test_class.declarator: caseSearchPresenter
test_class.modifier: @InjectMocks
test_class.original_string: @InjectMocks
      CaseSearchPresenter caseSearchPresenter;
test_class.type: CaseSearchPresenter
test_class.var_name: caseSearchPresenter
test_class.file: app/src/test/java/org/unicef/rapidreg/childcase/casesearch/CaseSearchPresenterTest.java
test_class.identifier: CaseSearchPresenterTest
test_case.body: @Test
      public void should_get_CP_search_result() throws Exception {
          List<Long> list = new ArrayList<>();
          Map<String, String> searchCondition = mock(Map.class);
          User user = new User();
          user.setRole(User.ROLE_CP);
  
          when(PrimeroAppConfiguration.getCurrentUser()).thenReturn(user);
          when(searchCondition.get(anyString())).thenReturn("0");
          when(caseService.getCPSearchResult(anyString(),anyString(),anyInt(),anyInt(),anyString(),any()))
                  .thenReturn(list);
  
          assertThat("Should return CP search list", caseSearchPresenter.getSearchResult(searchCondition),
                  is(list));
          verify(caseService, times(1)).
                  getCPSearchResult(anyString(), anyString(),anyInt(),anyInt(),anyString(),any());
      }
test_case.class_method_signature: CaseSearchPresenterTest.should_get_CP_search_result()
test_case.full_signature: @Test public void should_get_CP_search_result()
test_case.identifier: should_get_CP_search_result
test_case.invocations: mock setRole thenReturn when getCurrentUser thenReturn when get anyString thenReturn when getCPSearchResult anyString anyString anyInt anyInt anyString any assertThat getSearchResult is getCPSearchResult verify times anyString anyString anyInt anyInt anyString any
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void should_get_CP_search_result()
focal_class.declarator: caseService
focal_class.modifier: private
focal_class.original_string: private CaseService caseService;
focal_class.type: CaseService
focal_class.var_name: caseService
focal_class.file: app/src/main/java/org/unicef/rapidreg/childcase/casesearch/CaseSearchPresenter.java
focal_class.identifier: CaseSearchPresenter
focal_class.class_method_signature: CaseSearchPresenter.CaseSearchPresenter(CaseService caseService)
focal_class.full_signature: @Inject public  CaseSearchPresenter(CaseService caseService)
focal_class.identifier: CaseSearchPresenter
focal_class.modifiers: @Inject public
focal_class.parameters: (CaseService caseService)
focal_class.signature:  CaseSearchPresenter(CaseService caseService)
focal_class.class_method_signature: CaseSearchPresenter.getSearchResult(Map<String, String> searchConditions)
focal_class.full_signature: @Override protected List<Long> getSearchResult(Map<String, String> searchConditions)
focal_class.identifier: getSearchResult
focal_class.modifiers: @Override protected
focal_class.parameters: (Map<String, String> searchConditions)
focal_class.return: List<Long>
focal_class.signature: List<Long> getSearchResult(Map<String, String> searchConditions)
focal_class.superclass: extends RecordSearchPresenter
focal_method.body: @Override
      protected List<Long> getSearchResult(Map<String, String> searchConditions) {
          String uniqueId = searchConditions.get(ID);
          String name = searchConditions.get(NAME);
          String registrationDate = searchConditions.get(REGISTRATION_DATE);
          if (PrimeroAppConfiguration.getCurrentUser().getRoleType() == User.Role.CP) {
              int ageFrom = Integer.valueOf(searchConditions.get(AGE_FROM));
              int ageTo = Integer.valueOf(searchConditions.get(AGE_TO));
              String caregiver = searchConditions.get(CAREGIVER);
              return caseService.getCPSearchResult(uniqueId, name, ageFrom, ageTo, caregiver, getDate(registrationDate));
          } else {
              String location = searchConditions.get(LOCATION);
              return caseService.getGBVSearchResult(uniqueId, name, location, getDate(registrationDate));
          }
      }
focal_method.class_method_signature: CaseSearchPresenter.getSearchResult(Map<String, String> searchConditions)
focal_method.full_signature: @Override protected List<Long> getSearchResult(Map<String, String> searchConditions)
focal_method.identifier: getSearchResult
focal_method.invocations: get get get getRoleType getCurrentUser valueOf get valueOf get get getCPSearchResult getDate get getGBVSearchResult getDate
focal_method.modifiers: @Override protected
focal_method.parameters: (Map<String, String> searchConditions)
focal_method.return: List<Long>
focal_method.signature: List<Long> getSearchResult(Map<String, String> searchConditions)