@Test public void getAllAssetGroupDetailsTest() { List<AssetGroupDetails> assetGroupDetail = new ArrayList<AssetGroupDetails>(); assetGroupDetail.add(getAssetGroupDetails()); Page<AssetGroupDetails> allAssetGroupDetails = new PageImpl<AssetGroupDetails>(assetGroupDetail,new PageRequest(0, 1), assetGroupDetail.size()); when(assetGroupRepository.findAll(anyString(), any(PageRequest.class))).thenReturn(allAssetGroupDetails); assertThat(assetGroupService.getAllAssetGroupDetails(StringUtils.EMPTY, 0, 1), is(notNullValue())); }
@Override public Page<AssetGroupView> getAllAssetGroupDetails(final String searchTerm, final int page, final int size) { return buildAssetGroupView(assetGroupRepository.findAll(searchTerm.toLowerCase(), PageRequest.of(page, size))); }
AssetGroupServiceImpl implements AssetGroupService { @Override public Page<AssetGroupView> getAllAssetGroupDetails(final String searchTerm, final int page, final int size) { return buildAssetGroupView(assetGroupRepository.findAll(searchTerm.toLowerCase(), PageRequest.of(page, size))); } }
AssetGroupServiceImpl implements AssetGroupService { @Override public Page<AssetGroupView> getAllAssetGroupDetails(final String searchTerm, final int page, final int size) { return buildAssetGroupView(assetGroupRepository.findAll(searchTerm.toLowerCase(), PageRequest.of(page, size))); }  }
AssetGroupServiceImpl implements AssetGroupService { @Override public Page<AssetGroupView> getAllAssetGroupDetails(final String searchTerm, final int page, final int size) { return buildAssetGroupView(assetGroupRepository.findAll(searchTerm.toLowerCase(), PageRequest.of(page, size))); }  @Override Collection<String> getAllAssetGroupNames(); @Override Page<AssetGroupView> getAllAssetGroupDetails(final String searchTerm, final int page, final int size); @Override AssetGroupDetails findByGroupName(String groupName); @SuppressWarnings("unchecked") @Override String updateAssetGroupDetails(final CreateUpdateAssetGroupDetails updateAssetGroupDetails, final String userId); @Override String createAssetGroupDetails(final CreateUpdateAssetGroupDetails createAssetGroupDetails, final String userId); @Override UpdateAssetGroupDetails getAssetGroupDetailsByIdAndDataSource(final String assetGroupId, final String dataSource); @Override String deleteAssetGroup(final DeleteAssetGroupRequest assetGroupDetails, final String userId); }
AssetGroupServiceImpl implements AssetGroupService { @Override public Page<AssetGroupView> getAllAssetGroupDetails(final String searchTerm, final int page, final int size) { return buildAssetGroupView(assetGroupRepository.findAll(searchTerm.toLowerCase(), PageRequest.of(page, size))); }  @Override Collection<String> getAllAssetGroupNames(); @Override Page<AssetGroupView> getAllAssetGroupDetails(final String searchTerm, final int page, final int size); @Override AssetGroupDetails findByGroupName(String groupName); @SuppressWarnings("unchecked") @Override String updateAssetGroupDetails(final CreateUpdateAssetGroupDetails updateAssetGroupDetails, final String userId); @Override String createAssetGroupDetails(final CreateUpdateAssetGroupDetails createAssetGroupDetails, final String userId); @Override UpdateAssetGroupDetails getAssetGroupDetailsByIdAndDataSource(final String assetGroupId, final String dataSource); @Override String deleteAssetGroup(final DeleteAssetGroupRequest assetGroupDetails, final String userId);  }