@Test public void test_scan_PackageGivenDoesNotExist() { RecordPackageClassScanner scanner = new RecordPackageClassScanner(); try { scanner.scan(Arrays.<String>asList("does.not.exist")); fail(); } catch (IllegalArgumentException err) { assertEquals("Could not findRecordField package \"does.not.exist\"", err.getMessage()); } }
public List<Class<?>> scan(List<String> packages) { List<Class<?>> classes = new ArrayList<Class<?>>(); for (String packageName : packages) { for (Class clazz : findClassesInPackage(packageName)) { if (hasRecordAnnoation(clazz)) classes.add(clazz); } } return classes; }
RecordPackageClassScanner { public List<Class<?>> scan(List<String> packages) { List<Class<?>> classes = new ArrayList<Class<?>>(); for (String packageName : packages) { for (Class clazz : findClassesInPackage(packageName)) { if (hasRecordAnnoation(clazz)) classes.add(clazz); } } return classes; } }
RecordPackageClassScanner { public List<Class<?>> scan(List<String> packages) { List<Class<?>> classes = new ArrayList<Class<?>>(); for (String packageName : packages) { for (Class clazz : findClassesInPackage(packageName)) { if (hasRecordAnnoation(clazz)) classes.add(clazz); } } return classes; }  }
RecordPackageClassScanner { public List<Class<?>> scan(List<String> packages) { List<Class<?>> classes = new ArrayList<Class<?>>(); for (String packageName : packages) { for (Class clazz : findClassesInPackage(packageName)) { if (hasRecordAnnoation(clazz)) classes.add(clazz); } } return classes; }  List<Class<?>> scan(List<String> packages); }
RecordPackageClassScanner { public List<Class<?>> scan(List<String> packages) { List<Class<?>> classes = new ArrayList<Class<?>>(); for (String packageName : packages) { for (Class clazz : findClassesInPackage(packageName)) { if (hasRecordAnnoation(clazz)) classes.add(clazz); } } return classes; }  List<Class<?>> scan(List<String> packages);  }