@Test public void getTargetTypesByAssetGroupNameTest() throws PacManException { AssetGroupDetails assetGroupDetails = getAssetGroupDetails(); List<AssetGroupTargetDetails> allAssetGroupTargetDetails = getAllAssetGroupTargetDetails(); when(assetGroupService.findByGroupName("assetGroupName123")).thenReturn(assetGroupDetails); when(assetGroupTargetDetailsRepository.findByGroupId(assetGroupDetails.getGroupId())).thenReturn(allAssetGroupTargetDetails); assertThat(assetGroupTargetDetailsService.getTargetTypesByAssetGroupName("assetGroupName123").size(), is(1)); }
@Override public List<TargetTypeRuleDetails> getTargetTypesByAssetGroupName(String assetGroupName) { AssetGroupDetails assetGroupDetails = assetGroupService.findByGroupName(assetGroupName); List<AssetGroupTargetDetails> allAssetGroupTargetDetails = assetGroupTargetDetailsRepository.findByGroupId(assetGroupDetails.getGroupId()); List<TargetTypeRuleDetails> allStudentsDetails = allAssetGroupTargetDetails.parallelStream().map(fetchTargetTypeRuleDetails).collect(Collectors.toList()); return allStudentsDetails; }
AssetGroupTargetDetailsServiceImpl implements AssetGroupTargetDetailsService, Constants { @Override public List<TargetTypeRuleDetails> getTargetTypesByAssetGroupName(String assetGroupName) { AssetGroupDetails assetGroupDetails = assetGroupService.findByGroupName(assetGroupName); List<AssetGroupTargetDetails> allAssetGroupTargetDetails = assetGroupTargetDetailsRepository.findByGroupId(assetGroupDetails.getGroupId()); List<TargetTypeRuleDetails> allStudentsDetails = allAssetGroupTargetDetails.parallelStream().map(fetchTargetTypeRuleDetails).collect(Collectors.toList()); return allStudentsDetails; } }
AssetGroupTargetDetailsServiceImpl implements AssetGroupTargetDetailsService, Constants { @Override public List<TargetTypeRuleDetails> getTargetTypesByAssetGroupName(String assetGroupName) { AssetGroupDetails assetGroupDetails = assetGroupService.findByGroupName(assetGroupName); List<AssetGroupTargetDetails> allAssetGroupTargetDetails = assetGroupTargetDetailsRepository.findByGroupId(assetGroupDetails.getGroupId()); List<TargetTypeRuleDetails> allStudentsDetails = allAssetGroupTargetDetails.parallelStream().map(fetchTargetTypeRuleDetails).collect(Collectors.toList()); return allStudentsDetails; }  }
AssetGroupTargetDetailsServiceImpl implements AssetGroupTargetDetailsService, Constants { @Override public List<TargetTypeRuleDetails> getTargetTypesByAssetGroupName(String assetGroupName) { AssetGroupDetails assetGroupDetails = assetGroupService.findByGroupName(assetGroupName); List<AssetGroupTargetDetails> allAssetGroupTargetDetails = assetGroupTargetDetailsRepository.findByGroupId(assetGroupDetails.getGroupId()); List<TargetTypeRuleDetails> allStudentsDetails = allAssetGroupTargetDetails.parallelStream().map(fetchTargetTypeRuleDetails).collect(Collectors.toList()); return allStudentsDetails; }  @Override List<TargetTypeRuleDetails> getTargetTypesByAssetGroupName(String assetGroupName); @Override List<TargetTypeRuleViewDetails> getTargetTypesByAssetGroupIdAndTargetTypeNotIn(String assetGroupName, Set<String> targetTypeNames); }
AssetGroupTargetDetailsServiceImpl implements AssetGroupTargetDetailsService, Constants { @Override public List<TargetTypeRuleDetails> getTargetTypesByAssetGroupName(String assetGroupName) { AssetGroupDetails assetGroupDetails = assetGroupService.findByGroupName(assetGroupName); List<AssetGroupTargetDetails> allAssetGroupTargetDetails = assetGroupTargetDetailsRepository.findByGroupId(assetGroupDetails.getGroupId()); List<TargetTypeRuleDetails> allStudentsDetails = allAssetGroupTargetDetails.parallelStream().map(fetchTargetTypeRuleDetails).collect(Collectors.toList()); return allStudentsDetails; }  @Override List<TargetTypeRuleDetails> getTargetTypesByAssetGroupName(String assetGroupName); @Override List<TargetTypeRuleViewDetails> getTargetTypesByAssetGroupIdAndTargetTypeNotIn(String assetGroupName, Set<String> targetTypeNames);  }