@Test public void getAllDomainDetailsTest() { Object[] domain = { "DomainName123", "DomainDesc123" }; List<Object[]> domains = Lists.newArrayList(); domains.add(domain); Page<Object[]> allDomains = new PageImpl<Object[]>(domains, new PageRequest(0, 1), domains.size()); when(domainRepository.findAllDomainDetails(anyString(), any(PageRequest.class))).thenReturn(allDomains); assertThat(domainService.getAllDomainDetails(StringUtils.EMPTY, 0, 1).getContent().size(), is(1)); }
@Override public Page<Object[]> getAllDomainDetails(final String searchTerm, final int page, final int size) { return domainRepository.findAllDomainDetails(searchTerm, PageRequest.of(page, size)); }
DomainServiceImpl implements DomainService, Constants { @Override public Page<Object[]> getAllDomainDetails(final String searchTerm, final int page, final int size) { return domainRepository.findAllDomainDetails(searchTerm, PageRequest.of(page, size)); } }
DomainServiceImpl implements DomainService, Constants { @Override public Page<Object[]> getAllDomainDetails(final String searchTerm, final int page, final int size) { return domainRepository.findAllDomainDetails(searchTerm, PageRequest.of(page, size)); }  }
DomainServiceImpl implements DomainService, Constants { @Override public Page<Object[]> getAllDomainDetails(final String searchTerm, final int page, final int size) { return domainRepository.findAllDomainDetails(searchTerm, PageRequest.of(page, size)); }  @Override Collection<String> getAllDomainNames(); @Override List<Domain> getAllDomains(); @Override Domain getDomainByName(final String domainName); @Override Page<Object[]> getAllDomainDetails(final String searchTerm, final int page, final int size); @Override String createDomain(final CreateUpdateDomain createUpdateDomain, final String userId); @Override String updateDomain(final CreateUpdateDomain createUpdateDomain, final String userId); }
DomainServiceImpl implements DomainService, Constants { @Override public Page<Object[]> getAllDomainDetails(final String searchTerm, final int page, final int size) { return domainRepository.findAllDomainDetails(searchTerm, PageRequest.of(page, size)); }  @Override Collection<String> getAllDomainNames(); @Override List<Domain> getAllDomains(); @Override Domain getDomainByName(final String domainName); @Override Page<Object[]> getAllDomainDetails(final String searchTerm, final int page, final int size); @Override String createDomain(final CreateUpdateDomain createUpdateDomain, final String userId); @Override String updateDomain(final CreateUpdateDomain createUpdateDomain, final String userId);  }