@Test(expected = IllegalArgumentException.class) public void validationFailure_empty() throws Exception { mHelper.validate(new ArrayList<VersionModule>()); }
public void validate(List<VersionModule> modules) { if (modules == null || modules.isEmpty()) { throw new IllegalArgumentException("No modules found."); } for (VersionModule module : modules) { if (!Utils.hasAnnotatedMethods(module.getClass(), VersionCode.class)) { throw new IllegalArgumentException("No annotated method found."); } } }
Helper { public void validate(List<VersionModule> modules) { if (modules == null || modules.isEmpty()) { throw new IllegalArgumentException("No modules found."); } for (VersionModule module : modules) { if (!Utils.hasAnnotatedMethods(module.getClass(), VersionCode.class)) { throw new IllegalArgumentException("No annotated method found."); } } } }
Helper { public void validate(List<VersionModule> modules) { if (modules == null || modules.isEmpty()) { throw new IllegalArgumentException("No modules found."); } for (VersionModule module : modules) { if (!Utils.hasAnnotatedMethods(module.getClass(), VersionCode.class)) { throw new IllegalArgumentException("No annotated method found."); } } } Helper(Application application); }
Helper { public void validate(List<VersionModule> modules) { if (modules == null || modules.isEmpty()) { throw new IllegalArgumentException("No modules found."); } for (VersionModule module : modules) { if (!Utils.hasAnnotatedMethods(module.getClass(), VersionCode.class)) { throw new IllegalArgumentException("No annotated method found."); } } } Helper(Application application); void validate(List<VersionModule> modules); void execute(int baseVersion, List<VersionModule> modules); }
Helper { public void validate(List<VersionModule> modules) { if (modules == null || modules.isEmpty()) { throw new IllegalArgumentException("No modules found."); } for (VersionModule module : modules) { if (!Utils.hasAnnotatedMethods(module.getClass(), VersionCode.class)) { throw new IllegalArgumentException("No annotated method found."); } } } Helper(Application application); void validate(List<VersionModule> modules); void execute(int baseVersion, List<VersionModule> modules); static final String TAG; }