Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Backend
Commits
2ac7d55f
Commit
2ac7d55f
authored
Jul 15, 2016
by
Matija Obreza
Browse files
Use appropriate resources in tests
parent
e349dbd3
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/server/service/impl/EMailServiceImpl.java
View file @
2ac7d55f
...
...
@@ -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
);
}
}
...
...
src/test/java/org/genesys2/server/test/PropertyPlacholderInitializer.java
View file @
2ac7d55f
...
...
@@ -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
);
}
}
src/test/resources/spring/spring.properties
View file @
2ac7d55f
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment