#139 - Switched to embedded MongoDB for integration tests.

Removed MongoDB dependency by adding Flapdoodle embedded MongoDB. That allows us to get rid of the utility module we had in place for the MongoDB samples guarding the tests to only run when a MongoDB instance is running.

Tweaked Travis setup to not require the MongoDB service anymore.
This commit is contained in:
Oliver Gierke
2015-10-29 17:14:38 +01:00
parent 5a9b785499
commit 9a5c270ec2
30 changed files with 84 additions and 330 deletions

View File

@@ -18,7 +18,6 @@ package example.springdata.mongodb.people;
import java.util.stream.Stream;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
@@ -27,8 +26,6 @@ import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.data.mongodb.core.mapping.event.LoggingEventListener;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import example.springdata.mongodb.util.RequiresMongoDB;
/**
* Integration test for {@link PersonRepository}.
*
@@ -39,8 +36,6 @@ import example.springdata.mongodb.util.RequiresMongoDB;
@SpringApplicationConfiguration(classes = ApplicationConfiguration.class)
public class PersonRepositoryIntegrationTest {
@ClassRule public static RequiresMongoDB mongodbAvailable = RequiresMongoDB.anyVersion();
@Autowired PersonRepository repository;
@Autowired MongoOperations operations;

View File

@@ -0,0 +1,2 @@
# Random port for embedded MongoDB
spring.data.mongodb.port=0