user2633500
user2633500

Reputation: 1

Best approach to integrate testing for Spring, Rabbit MQ, mysql

I want to best appraoch to integration testing for spring, RabbitMQ and mysql, while removing any external dependencies to Mysql and RabbitMQ. I have tried using: 1. Mock test, but it not the ideal integration testing 2. I can use INMD, but its do't the actual replication for Mysql

Please help me!!

Thx, Prikshit

Upvotes: 0

Views: 976

Answers (1)

Nabil
Nabil

Reputation: 1811

The ideal case senario is to replace MySql By an H2 memory database : if you use Spring you can change the test configuration to reference an H2 memory .

For rabbitMq , my advice is to use a real RabbiMQ : this can be done by using Vagrant with chef for provisioning the RabbitMq and the Vagrant maven plugin to start the Box before Integration tests and halt it in the post phase of integration tests :

The Vagrant Maven plugin : http://nicoulaj.github.io/vagrant-maven-plugin/

Vagrant WebSite : http://www.vagrantup.com/

Cookbook Chef for RabbitMQ : https://github.com/opscode-cookbooks/rabbitmq

To Summarize you must :

  1. Install Vagrant and create an empty Box(Centos or Ubunutu).
  2. provision the VM with rabbitMQ cookbook .
  3. place .box into you home folder (rabbitMQ.box).
  4. Configure you maven Project to start the VM with vagrant up (~/rabbitMQ.box) in the pre phase of integration tests .
  5. Configure you maven Project to stop the VM with vagrant halt (~/rabbitMQ.box) in the pre phase of integration tests .

Hope that this help

Upvotes: 2

Related Questions