aboutsummaryrefslogtreecommitdiff
path: root/juick-xmpp-wip/src/main/java/com/juick/components/XMPPBot.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-10-17 22:43:27 +0300
committerGravatar Vitaly Takmazov2017-10-18 00:22:44 +0300
commita86b5ada5b07ec18671983b0c772063815cac334 (patch)
tree80e62339b857cd699db6f1f087cf2221df655d96 /juick-xmpp-wip/src/main/java/com/juick/components/XMPPBot.java
parent5b6ac36436bbed6da7937f0fc83eb734ad929910 (diff)
tests refatoring
now api and www tests uses embedded db
Diffstat (limited to 'juick-xmpp-wip/src/main/java/com/juick/components/XMPPBot.java')
-rw-r--r--juick-xmpp-wip/src/main/java/com/juick/components/XMPPBot.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/juick-xmpp-wip/src/main/java/com/juick/components/XMPPBot.java b/juick-xmpp-wip/src/main/java/com/juick/components/XMPPBot.java
index b551ff2b..fa097584 100644
--- a/juick-xmpp-wip/src/main/java/com/juick/components/XMPPBot.java
+++ b/juick-xmpp-wip/src/main/java/com/juick/components/XMPPBot.java
@@ -37,6 +37,7 @@ import rocks.xmpp.extensions.vcard.temp.model.VCard;
import rocks.xmpp.extensions.version.SoftwareVersionManager;
import rocks.xmpp.extensions.version.model.SoftwareVersion;
+import javax.annotation.PostConstruct;
import javax.inject.Inject;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
@@ -49,17 +50,21 @@ import java.util.List;
public class XMPPBot implements AutoCloseable, ProtocolListener {
private static final Logger logger = LoggerFactory.getLogger(XMPPBot.class);
@Inject
- UserService userService;
+ private UserService userService;
@Inject
- PMQueriesService pmQueriesService;
+ private PMQueriesService pmQueriesService;
@Inject
- JuickProtocol juickProtocol;
+ private JuickProtocol juickProtocol;
+ @Inject
+ private Environment env;
Jid juickJid;
private ExternalComponent component;
- public XMPPBot(Environment env) {
+ @PostConstruct
+ @Inject
+ public void init() {
component = ExternalComponent.create(env.getProperty("component_name", "juick.com"),
env.getProperty("component_password", "secret"), env.getProperty("component_host", "localhost"),
NumberUtils.toInt(env.getProperty("component_port", "5347"), 5347));