Commit 6f7c2d0c authored by Spiros Koulouzis's avatar Spiros Koulouzis

added MockConnectionFactory to run tests

parent 1ed6f2d1
...@@ -50,7 +50,6 @@ ...@@ -50,7 +50,6 @@
<dependency> <dependency>
<groupId>javax.xml.bind</groupId> <groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId> <artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.sun.xml.bind</groupId> <groupId>com.sun.xml.bind</groupId>
...@@ -111,6 +110,12 @@ ...@@ -111,6 +110,12 @@
<artifactId>de.flapdoodle.embed.mongo</artifactId> <artifactId>de.flapdoodle.embed.mongo</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>com.github.fridujo</groupId>
<artifactId>rabbitmq-mock</artifactId>
<version>1.0.12</version>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>nl.uva.sne.drip</groupId> <groupId>nl.uva.sne.drip</groupId>
<artifactId>drip-commons</artifactId> <artifactId>drip-commons</artifactId>
......
...@@ -26,7 +26,8 @@ import org.springframework.data.mongodb.config.AbstractMongoConfiguration; ...@@ -26,7 +26,8 @@ import org.springframework.data.mongodb.config.AbstractMongoConfiguration;
* @author S. Koulouzis * @author S. Koulouzis
*/ */
@Configuration @Configuration
@ComponentScan(basePackages = {"nl.uva.sne.drip", "nl.uva.sne.drip.api", "nl.uva.sne.drip.configuration", "nl.uva.sne.drip.dao", "nl.uva.sne.drip.model", "nl.uva.sne.drip.service"}) @ComponentScan(basePackages = {"nl.uva.sne.drip", "nl.uva.sne.drip.api",
"nl.uva.sne.drip.configuration", "nl.uva.sne.drip.dao", "nl.uva.sne.drip.model", "nl.uva.sne.drip.service"})
public class MongoConfig extends AbstractMongoConfiguration { public class MongoConfig extends AbstractMongoConfiguration {
public static int MONGO_TEST_PORT = 12345; public static int MONGO_TEST_PORT = 12345;
......
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package nl.uva.sne.drip.configuration;
import com.github.fridujo.rabbitmq.mock.MockConnection;
import com.github.fridujo.rabbitmq.mock.MockConnectionFactory;
import nl.uva.sne.drip.configuration.*;
import com.rabbitmq.client.ConnectionFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
*
* @author S. Koulouzis
*/
@Configuration
public class RabbitMQConfig {
@Bean
public ConnectionFactory connectionFactory() {
MockConnectionFactory connectionFactory = new MockConnectionFactory();
connectionFactory.setHost("localhost");
connectionFactory.setUsername("guest");
connectionFactory.setPassword("guest");
connectionFactory.setPort(5555);
return connectionFactory;
}
}
...@@ -67,7 +67,6 @@ public class ServiceTests { ...@@ -67,7 +67,6 @@ public class ServiceTests {
@Autowired @Autowired
CredentialService credentialService; CredentialService credentialService;
private String credentialID;
@Autowired @Autowired
ProvisionerService provisionService; ProvisionerService provisionService;
......
Markdown is supported
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