@Test public void getPoliciesTest() { List<Object[]> policiesDetails = new ArrayList<Object[]>(); Object[] policiesDetail = {"PolicyName123", "policyDesc123"}; policiesDetails.add(policiesDetail); Page<Object[]> allPoliciesDetails = new PageImpl<Object[]>(policiesDetails,new PageRequest(0, 1), policiesDetails.size()); when(policyService.getPolicies(0, 1, StringUtils.EMPTY)).thenReturn(allPoliciesDetails); assertThat(policyRepository.getAllPolicyDetails(StringUtils.EMPTY, new PageRequest(0, 1)).getContent().get(0).length, is(2)); }
@Override public Page<Object[]> getPolicies(final int page, final int size, final String searchTerm) { return policyRepository.getAllPolicyDetails(searchTerm.toLowerCase(), PageRequest.of(page, size)); }
PolicyServiceImpl implements PolicyService, Constants { @Override public Page<Object[]> getPolicies(final int page, final int size, final String searchTerm) { return policyRepository.getAllPolicyDetails(searchTerm.toLowerCase(), PageRequest.of(page, size)); } }
PolicyServiceImpl implements PolicyService, Constants { @Override public Page<Object[]> getPolicies(final int page, final int size, final String searchTerm) { return policyRepository.getAllPolicyDetails(searchTerm.toLowerCase(), PageRequest.of(page, size)); }  }
PolicyServiceImpl implements PolicyService, Constants { @Override public Page<Object[]> getPolicies(final int page, final int size, final String searchTerm) { return policyRepository.getAllPolicyDetails(searchTerm.toLowerCase(), PageRequest.of(page, size)); }  @Override Page<Object[]> getPolicies(final int page, final int size, final String searchTerm); @Override Collection<String> getAllPolicyIds(); @Override String updatePolicies(final UpdatePolicyDetails policyDetails); @Override String createPolicies(final CreatePolicyDetails policyDetails); @Override Policy getByPolicyId(String policyId); }
PolicyServiceImpl implements PolicyService, Constants { @Override public Page<Object[]> getPolicies(final int page, final int size, final String searchTerm) { return policyRepository.getAllPolicyDetails(searchTerm.toLowerCase(), PageRequest.of(page, size)); }  @Override Page<Object[]> getPolicies(final int page, final int size, final String searchTerm); @Override Collection<String> getAllPolicyIds(); @Override String updatePolicies(final UpdatePolicyDetails policyDetails); @Override String createPolicies(final CreatePolicyDetails policyDetails); @Override Policy getByPolicyId(String policyId);  }