@SuppressWarnings("unchecked") @Test public void testResolvePackages() { Module module = mock(Module.class); Set<Package> packages = new HashSet(); Package pkg; for (int i = 0; i < 10; i++) { pkg = mock(Package.class); when(pkg.getPackageName()).thenReturn("package"+i); packages.add(pkg); } when(moduleService.resolvePackages(module)).thenReturn(packages); Set<String> result = serviceHelper.resolvePackages(module); assertEquals(packages.size(), result.size()); packages.forEach(existingPkg -> assertTrue(result.contains(existingPkg.getPackageName()))); }
public Set<String> resolvePackages(final Module project) { final Set<Package> packages = moduleService.resolvePackages(project); return packages.stream() .map(Package::getPackageName) .collect(Collectors.toSet()); }
DataModelerServiceHelper { public Set<String> resolvePackages(final Module project) { final Set<Package> packages = moduleService.resolvePackages(project); return packages.stream() .map(Package::getPackageName) .collect(Collectors.toSet()); } }
DataModelerServiceHelper { public Set<String> resolvePackages(final Module project) { final Set<Package> packages = moduleService.resolvePackages(project); return packages.stream() .map(Package::getPackageName) .collect(Collectors.toSet()); } DataModelerServiceHelper(); @Inject  DataModelerServiceHelper(final KieModuleService moduleService,
                                    final @Named("ioStrategy") IOService ioService,
                                    final CommentedOptionFactory commentedOptionFactory); }
DataModelerServiceHelper { public Set<String> resolvePackages(final Module project) { final Set<Package> packages = moduleService.resolvePackages(project); return packages.stream() .map(Package::getPackageName) .collect(Collectors.toSet()); } DataModelerServiceHelper(); @Inject  DataModelerServiceHelper(final KieModuleService moduleService,
                                    final @Named("ioStrategy") IOService ioService,
                                    final CommentedOptionFactory commentedOptionFactory); List<DataModelerError> toDataModelerError(List<DriverError> errors); List<DataModelerError> toDataModelerError(final List<SyntaxError> syntaxErrors,
                                                     final Path file); List<ValidationMessage> toValidationMessage(final List<DataModelerError> errors); CommentedOption makeCommentedOption(final String commitMessage); Package ensurePackageStructure(final Module module,
                                          final String packageName); Set<String> resolvePackages(final Module project); String calculateClassName(final Module module,
                                     final org.uberfire.backend.vfs.Path path); Path calculateFilePath(final String className,
                                  final Path javaPath); }
DataModelerServiceHelper { public Set<String> resolvePackages(final Module project) { final Set<Package> packages = moduleService.resolvePackages(project); return packages.stream() .map(Package::getPackageName) .collect(Collectors.toSet()); } DataModelerServiceHelper(); @Inject  DataModelerServiceHelper(final KieModuleService moduleService,
                                    final @Named("ioStrategy") IOService ioService,
                                    final CommentedOptionFactory commentedOptionFactory); List<DataModelerError> toDataModelerError(List<DriverError> errors); List<DataModelerError> toDataModelerError(final List<SyntaxError> syntaxErrors,
                                                     final Path file); List<ValidationMessage> toValidationMessage(final List<DataModelerError> errors); CommentedOption makeCommentedOption(final String commitMessage); Package ensurePackageStructure(final Module module,
                                          final String packageName); Set<String> resolvePackages(final Module project); String calculateClassName(final Module module,
                                     final org.uberfire.backend.vfs.Path path); Path calculateFilePath(final String className,
                                  final Path javaPath);  }