Commit 2ac7d55f authored by Matija Obreza's avatar Matija Obreza
Browse files

Use appropriate resources in tests

parent e349dbd3
......@@ -101,6 +101,7 @@ public class EMailServiceImpl implements EMailService {
protected void doSend(final MimeMessagePreparator preparator) {
// execute sender in separate thread
if (async) {
LOG.info("Sending email message asynchroniously");
executor.submit(new Runnable() {
@Override
public void run() {
......@@ -112,6 +113,7 @@ public class EMailServiceImpl implements EMailService {
}
});
} else {
LOG.info("Sending email message now");
mailSender.send(preparator);
}
}
......
......@@ -16,33 +16,27 @@
package org.genesys2.server.test;
import java.io.IOException;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.config.PlaceholderConfigurerSupport;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.core.io.support.ResourcePatternResolver;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
/**
* Initializing class for using "context:property-placeholder" within @Configuration
* classes
* Initializing class for using "context:property-placeholder" within @Configuration classes
*/
public class PropertyPlacholderInitializer implements ApplicationContextInitializer<ConfigurableApplicationContext> {
@Override
public void initialize(ConfigurableApplicationContext applicationContext) {
final ResourcePatternResolver resourcePatternResolver = new PathMatchingResourcePatternResolver();
final PlaceholderConfigurerSupport postProcessor = new PropertySourcesPlaceholderConfigurer();
try {
postProcessor.setLocations(
// add all properties
resourcePatternResolver.getResources("classpath*:**/*.properties"));
} catch (final IOException e) {
throw new BeanCreationException("Could not create bean " + postProcessor.toString(), e);
}
postProcessor.setIgnoreResourceNotFound(true);
postProcessor.setFileEncoding("utf-8");
postProcessor.setLocations(new Resource[] { new ClassPathResource("application.properties"), new ClassPathResource("spring/spring.properties"),
// Include genesys.properties
new ClassPathResource("genesys.properties") });
applicationContext.addBeanFactoryPostProcessor(postProcessor);
}
}
......@@ -96,6 +96,13 @@ cache.tileserver.time-to-live-seconds=300
cache.tileserver.max-idle-seconds=0
cache.tileserver.eviction-policy=LRU
# ES
elasticsearch.cluster.name=es-genesys-development
# Allow HTTP connections on port 9200
elasticsearch.enable.http=true
# Connect to external ES nodes. Comma separated list of hostname:port
# elasticsearch.cluster.nodes=localhost:9300,otherhost:9300
elasticsearch.cluster.nodes=
transifex.project=genesys-dev
transifex.username=Alexandr19011990
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment