@Before public void setUp() throws IOException { SimpleClasspathHelper helper = new SimpleClasspathHelper(); helper.setClassLoader(new FilterableClassLoader(getClass().getClassLoader(), new NotPredicate<>(new EqualPredicate<>("javax.mail.Transport")))); ClasspathUtils.setHelper(helper); Properties additionalProps = new Properties(); additionalProps.setProperty("mail.smtp.host", ServerSetupTest.SMTP.getBindAddress()); additionalProps.setProperty("mail.smtp.port", String.valueOf(ServerSetupTest.SMTP.getPort())); oghamService = MessagingBuilder.standard() .environment() .properties("/application.properties") .properties(additionalProps) .and() .build(); }
public Collection<TemplateDomainObject> getTemplatesInGroup(TemplateGroupDomainObject templateGroup) { String[] params = new String[]{String.valueOf(templateGroup.getId())}; return CollectionUtils .select(services.getProcedureExecutor() .executeProcedure(SPROC_GET_TEMPLATES_IN_GROUP, params, newArrayListHandler()), NotPredicate.notPredicate(NullPredicate.INSTANCE)); }
/** * Create a new Predicate that returns true if the specified predicate * returns false and vice versa. * * @param <T> the type that the predicate queries * @param predicate the predicate to not * @return the <code>not</code> predicate * @throws NullPointerException if the predicate is null * @see NotPredicate */ public static <T> Predicate<T> notPredicate(final Predicate<? super T> predicate) { return NotPredicate.notPredicate(predicate); }